MatrixGPT/matrix_gpt/generate_clients/command_info.py

28 lines
1.2 KiB
Python
Raw Normal View History

2024-04-07 22:27:00 -06:00
from matrix_gpt.config import global_config
class CommandInfo:
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, help: str = None):
2024-04-07 22:27:00 -06:00
self.trigger = trigger
assert api_type in ['openai', 'anth']
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
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']