Merged
Conversation
Fix Qwen model prompt formatting:
- Add Qwen system message to system_messages dictionary
- Refactor get_system_prompt to use format_chat_history for consistent
formatting
- Fix empty assistant responses and extra newlines in Qwen chat format
- Fix following error message
```
[2025-03-24 14:30:04] | ERROR | aiohttp.server.log_exception | web_protocol.py:451 | Error handling request from 127.0.0.1
Traceback (most recent call last):
File "C:\Users\kalin\miniconda3\envs\gaiaenv3\lib\site-packages\aiohttp\web_protocol.py", line 480, in _handle_request
resp = await request_handler(request)
File "C:\Users\kalin\miniconda3\envs\gaiaenv3\lib\site-packages\aiohttp\web_app.py", line 569, in _handle
return await handler(request)
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\agent.py", line 204, in _on_prompt_received
response = self.prompt_received(data["prompt"])
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\Chaty\app.py", line 41, in prompt_received
response = self.prompt_llm(prompt)
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\Chaty\app.py", line 31, in prompt_llm
prompt = Prompts.get_system_prompt(
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\Chaty\prompts.py", line 264, in get_system_prompt
system_message = cls.system_messages[model_type]
KeyError: 'qwen'
```
Closed
itomek
approved these changes
Mar 25, 2025
vgodsoe
approved these changes
Mar 26, 2025
itomek
pushed a commit
that referenced
this pull request
Mar 12, 2026
Fix Qwen model prompt formatting:
- Add Qwen system message to system_messages dictionary
- Refactor get_system_prompt to use format_chat_history for consistent
formatting
- Fix empty assistant responses and extra newlines in Qwen chat format
- Fix following error message
```
[2025-03-24 14:30:04] | ERROR | aiohttp.server.log_exception | web_protocol.py:451 | Error handling request from 127.0.0.1
Traceback (most recent call last):
File "C:\Users\kalin\miniconda3\envs\gaiaenv3\lib\site-packages\aiohttp\web_protocol.py", line 480, in _handle_request
resp = await request_handler(request)
File "C:\Users\kalin\miniconda3\envs\gaiaenv3\lib\site-packages\aiohttp\web_app.py", line 569, in _handle
return await handler(request)
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\agent.py", line 204, in _on_prompt_received
response = self.prompt_received(data["prompt"])
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\Chaty\app.py", line 41, in prompt_received
response = self.prompt_llm(prompt)
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\Chaty\app.py", line 31, in prompt_llm
prompt = Prompts.get_system_prompt(
File "C:\Users\kalin\Work\gaia3\src\gaia\agents\Chaty\prompts.py", line 264, in get_system_prompt
system_message = cls.system_messages[model_type]
KeyError: 'qwen'
```
closes #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Qwen model prompt formatting:
closes #24