MatrixGPT/matrix_gpt/generate_clients/command_info.py

29 lines
1.2 KiB
Python
Raw Normal View History

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
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
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']