add vision to help text

This commit is contained in:
Cyberes 2024-04-09 19:34:05 -06:00
parent 7b20e71d65
commit 5f4fa86480
3 changed files with 9 additions and 2 deletions

View File

@ -45,3 +45,8 @@ The bot can give helpful reactions:
- 🕒 means the API timed out. - 🕒 means the API timed out.
- ❌ means the bot encountered an exception. - ❌ means the bot encountered an exception.
- ❌ 🔐 means there was a decryption failure. - ❌ 🔐 means there was a decryption failure.
## TODO
- [ ] Dalle bot
- [ ] Fix the typing indicator being removed when two responses are generating

View File

@ -57,6 +57,7 @@ DEFAULT_LISTS = {
'system_prompt': None, 'system_prompt': None,
'injected_system_prompt': None, 'injected_system_prompt': None,
'api_base': None, 'api_base': None,
'vision': False,
'help': None, 'help': None,
} }
} }

View File

@ -117,11 +117,12 @@ async def sound_off(room: MatrixRoom, event: RoomMessageText, client_helper: Mat
`!matrixgpt` - show this help message.\n\n""" `!matrixgpt` - show this help message.\n\n"""
for command in global_config['command']: for command in global_config['command']:
max_tokens = command['max_tokens'] if command['max_tokens'] > 0 else 'max' max_tokens = f' Max tokens: {command["max_tokens"]}.' if command['max_tokens'] > 0 else ''
system_prompt_text = f" System prompt: yes." if command['system_prompt'] else '' system_prompt_text = f" System prompt: yes." if command['system_prompt'] else ''
injected_system_prompt_text = f" Injected system prompt: yes." if command['injected_system_prompt'] else '' injected_system_prompt_text = f" Injected system prompt: yes." if command['injected_system_prompt'] else ''
help_text = f" ***{command['help'].strip('.')}.***" if command['help'] else '' help_text = f" ***{command['help'].strip('.')}.***" if command['help'] else ''
text_response = text_response + f"`{command['trigger']}` - Model: {command['model']}. Temperature: {command['temperature']}. Max tokens: {max_tokens}.{system_prompt_text}{injected_system_prompt_text}{help_text}\n\n" vision_text = ' Vision: yes.' if command['vision'] else ''
text_response = text_response + f"`{command['trigger']}` - Model: {command['model']}. Temperature: {command['temperature']}.{max_tokens}{vision_text}{system_prompt_text}{injected_system_prompt_text}{help_text}\n\n"
return await client_helper.send_text_to_room( return await client_helper.send_text_to_room(
room.room_id, room.room_id,
text_response, text_response,