You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a very simple graph.
First node calls an llm and get back structured data. I need that result as returned all at once.
that is passed in the state, the second and last node is a simple LLM invoke with the human message.
(I did not add any of the real logic I actually need to have there to keep this simple).
First node:
def chatbot(state: State):
llm = AzureChatOpenAI(
api_version=config["apiVersion"],
streaming=True,
azure_deployment=config["model"],
temperature=config["temprature"],
).with_structured_output(schema=ClassificationRouterStruct, strict=True)
res = llm.invoke(state["messages"]
return {"route": "operations","prefetch_tools":[]}. # <--------- NOTICE I PUT HARD CODED RETURN TO ELIMINATE ISSUES HERE
This still streams my first node (I print each chunk so I see it)
This result in getting:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/itay/.local/share/virtualenvs/backend-XCG2kbnH/lib/python3.12/site-packages/openai/lib/streaming/chat/_completions.py", line 393, in _accumulate_chunk
cast("dict[object, object]", choice.delta.to_dict()),
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'to_dict'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a very simple graph.
First node calls an llm and get back structured data. I need that result as returned all at once.
that is passed in the state, the second and last node is a simple LLM invoke with the human message.
(I did not add any of the real logic I actually need to have there to keep this simple).
First node:
Second/last node:
This still streams my first node (I print each chunk so I see it)
This result in getting:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/itay/.local/share/virtualenvs/backend-XCG2kbnH/lib/python3.12/site-packages/openai/lib/streaming/chat/_completions.py", line 393, in _accumulate_chunk
cast("dict[object, object]", choice.delta.to_dict()),
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'to_dict'
Beta Was this translation helpful? Give feedback.
All reactions