fixed anthropic support. Anthropic has different format of response when it has tool calls. Explicit handling added

This commit is contained in:
Edward Sun
2025-06-21 12:51:34 -07:00
parent 7eaf4d995f
commit 52284ce13c
5 changed files with 26 additions and 6 deletions

View File

@@ -47,9 +47,14 @@ def create_social_media_analyst(llm, toolkit):
result = chain.invoke(state["messages"])
report = ""
if len(result.tool_calls) == 0:
report = result.content
return {
"messages": [result],
"sentiment_report": result.content,
"sentiment_report": report,
}
return social_media_analyst_node