fix missing key
This commit is contained in:
parent
fe4cb78e8a
commit
1027cf189e
|
@ -33,7 +33,7 @@ command_prefix: '!c'
|
||||||
reply_in_thread: true
|
reply_in_thread: true
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
log_level: 'info'
|
log_level: info
|
||||||
|
|
||||||
# Log the full response (prompt + response) at debug level.
|
# Log the full response (prompt + response) at debug level.
|
||||||
log_full_response: false
|
log_full_response: false
|
||||||
|
|
25
main.py
25
main.py
|
@ -85,8 +85,14 @@ async def main():
|
||||||
# Logging in with a new device each time seems to fix encryption errors
|
# Logging in with a new device each time seems to fix encryption errors
|
||||||
device_id = config_data['bot_auth'].get('device_id', str(uuid4()))
|
device_id = config_data['bot_auth'].get('device_id', str(uuid4()))
|
||||||
|
|
||||||
matrix_helper = MatrixNioGPTHelper(auth_file=Path(config_data['bot_auth']['store_path'], 'bot_auth.json'), user_id=config_data['bot_auth']['username'], passwd=config_data['bot_auth']['password'], homeserver=config_data['bot_auth']['homeserver'], store_path=config_data['bot_auth']['store_path'],
|
matrix_helper = MatrixNioGPTHelper(
|
||||||
device_id=device_id, )
|
auth_file=Path(config_data['bot_auth']['store_path'], 'bot_auth.json'),
|
||||||
|
user_id=config_data['bot_auth']['username'],
|
||||||
|
passwd=config_data['bot_auth']['password'],
|
||||||
|
homeserver=config_data['bot_auth']['homeserver'],
|
||||||
|
store_path=config_data['bot_auth']['store_path'],
|
||||||
|
device_id=device_id,
|
||||||
|
)
|
||||||
client = matrix_helper.client
|
client = matrix_helper.client
|
||||||
|
|
||||||
openai.api_key = config_data['openai']['api_key']
|
openai.api_key = config_data['openai']['api_key']
|
||||||
|
@ -94,9 +100,18 @@ async def main():
|
||||||
storage = Storage(Path(config_data['data_storage'], 'matrixgpt.db'))
|
storage = Storage(Path(config_data['data_storage'], 'matrixgpt.db'))
|
||||||
|
|
||||||
# Set up event callbacks
|
# Set up event callbacks
|
||||||
callbacks = Callbacks(client, storage, openai_obj=openai, command_prefix=config_data['command_prefix'], openai_model=config_data['openai']['model'], reply_in_thread=config_data.get('reply_in_thread', False), allowed_to_invite=config_data['allowed_to_invite'],
|
callbacks = Callbacks(client, storage,
|
||||||
allowed_to_chat=config_data['allowed_to_chat'], log_full_response=config_data.get('log_full_response', False), system_prompt=config_data['openai'].get('system_prompt'), injected_system_prompt=config_data['openai'].get('injected_system_prompt', False),
|
openai_obj=openai,
|
||||||
hyper_temperature=config_data['openai'].get('temperature', 0))
|
command_prefix=config_data['command_prefix'],
|
||||||
|
openai_model=config_data['openai']['model'],
|
||||||
|
reply_in_thread=config_data.get('reply_in_thread', False),
|
||||||
|
allowed_to_invite=config_data['allowed_to_invite'],
|
||||||
|
allowed_to_chat=config_data['allowed_to_chat'],
|
||||||
|
log_full_response=config_data['logging'].get('log_full_response', False),
|
||||||
|
system_prompt=config_data['openai'].get('system_prompt'),
|
||||||
|
injected_system_prompt=config_data['openai'].get('injected_system_prompt', False),
|
||||||
|
hyper_temperature=config_data['openai'].get('temperature', 0)
|
||||||
|
)
|
||||||
client.add_event_callback(callbacks.message, RoomMessageText)
|
client.add_event_callback(callbacks.message, RoomMessageText)
|
||||||
client.add_event_callback(callbacks.invite_event_filtered_callback, InviteMemberEvent)
|
client.add_event_callback(callbacks.invite_event_filtered_callback, InviteMemberEvent)
|
||||||
client.add_event_callback(callbacks.decryption_failure, MegolmEvent)
|
client.add_event_callback(callbacks.decryption_failure, MegolmEvent)
|
||||||
|
|
Loading…
Reference in New Issue