ChatTogether and JsonOuputFunctionParser #21516
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Ɑ: parsing
Related to output parser module
Checked other resources
Example Code
The following python code:
Error Message and Stack Trace (if applicable)
Description
I'm trying to use the
JsonOutputFunctionParser
and realized that this is very specific for the OpenAI response and not for the Together API response:OpenAI
message.additional_kwargs["function_call"]
:{'function_call': {'arguments': '{"query":"SELECT AVG(age) AS average_age FROM users"}', 'name': 'SQLQuery'}}
Together
message.additional_kwargs["function_call"]
:None
-> ErrorAnd this is because from function calls we receive this:
{'tool_calls': [{'id': 'call_1x6sobhg8l5q95h7cozs28kq', 'function': {'arguments': '{"query":"SELECT AVG(age) FROM users"}', 'name': 'SQLQuery'}, 'type': 'function'}]}
So the
JsonOutputFunctionParser
is not getting thefunction
key-value. Will it be good to have a differentJsonOutputFunctionParser
for Together? It is easy to parse from Together since the output is very similar to the OpenAI response, it will need to get thefunction
key instead offunction_call
.I can work on that if you want.
System Info
langchain==0.1.19
langchain-community==0.0.38
langchain-core==0.1.52
langchain-openai==0.1.6
langchain-text-splitters==0.0.1
langchain-together==0.1.1
Platform:
Mac
Python version:
Python 3.10.14
The text was updated successfully, but these errors were encountered: