2024-04-10 16:42:52 -06:00
|
|
|
from matrix_gpt.config import global_config, VALID_API_TYPES
|
2024-04-07 22:27:00 -06:00
|
|
|
|
|
|
|
|
|
|
|
class CommandInfo:
|
2024-04-09 19:26:44 -06:00
|
|
|
def __init__(self, trigger: str, api_type: str, model: str, max_tokens: int, temperature: float, allowed_to_chat: list, allowed_to_thread: list, allowed_to_invite: list, system_prompt: str, injected_system_prompt: str, api_base: str = None, vision: bool = False, help: str = None):
|
2024-04-07 22:27:00 -06:00
|
|
|
self.trigger = trigger
|
2024-04-10 16:42:52 -06:00
|
|
|
assert api_type in VALID_API_TYPES
|
2024-04-07 22:27:00 -06:00
|
|
|
self.api_type = api_type
|
|
|
|
self.model = model
|
|
|
|
self.max_tokens = max_tokens
|
|
|
|
self.temperature = temperature
|
|
|
|
self.system_prompt = system_prompt
|
|
|
|
self.injected_system_prompt = injected_system_prompt
|
|
|
|
self.api_base = api_base
|
2024-04-09 19:26:44 -06:00
|
|
|
self.vision = vision
|
2024-04-07 23:42:09 -06:00
|
|
|
self.help = help
|
2024-04-07 22:27:00 -06:00
|
|
|
|
|
|
|
self.allowed_to_chat = allowed_to_chat
|
|
|
|
if not len(self.allowed_to_chat):
|
|
|
|
self.allowed_to_chat = global_config['allowed_to_chat']
|
|
|
|
|
|
|
|
self.allowed_to_thread = allowed_to_thread
|
|
|
|
if not len(self.allowed_to_thread):
|
|
|
|
self.allowed_to_thread = global_config['allowed_to_thread']
|
|
|
|
|
|
|
|
self.allowed_to_invite = allowed_to_invite
|
|
|
|
if not len(self.allowed_to_invite):
|
|
|
|
self.allowed_to_invite = global_config['allowed_to_invite']
|