dspy icon indicating copy to clipboard operation
dspy copied to clipboard

Implement a more lenient fields parsing for newlines in ChatAdapter

Open FireMasterK opened this issue 5 months ago • 0 comments

This allows the parser to parse the response, even if the newlines aren't present correctly due to the model not including newlines.

Example error:
Adapter ChatAdapter failed to parse the LM response. 

LM Response: [[ ## next_thought ## ]]
The user wants me to ...snip...transactions.[[ ## next_tool_name ## ]]
redacted[[ ## next_tool_args ## ]]
{
    "query": "redacted"
}
[[ ## completed ## ]] 

Expected to find output fields in the LM response: [next_thought, next_tool_name, next_tool_args] 

Actual output fields parsed from the LM response: [next_thought] 

FireMasterK avatar Jun 13 '25 07:06 FireMasterK