Skip to content

Commit ce1103f

Browse files
Varnavasvp777
authored andcommitted
last commit introduced a bug by having metadata['id'] set to dict, he didnt notice since gemini which he used doesnt set that. There was also a bug in the call_args creation, json.dumps is supposed to be called when args_json attribute doesnt exist
1 parent 76fe4dd commit ce1103f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/pydantic_ai_examples/weather_agent_gradio.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ async def stream_from_agent(prompt: str, chatbot: list[dict], past_messages: lis
3636
call_args = (
3737
call.args.args_json
3838
if hasattr(call.args, 'args_json')
39-
else json.dumps(call.args.args_dict)
39+
else json.dumps(call.args)
4040
)
4141
metadata = {
4242
'title': f'🛠️ Using {TOOL_TO_DISPLAY_NAME[call.tool_name]}',
4343
}
4444
if call.tool_call_id is not None:
45-
metadata['id'] = {call.tool_call_id}
45+
metadata['id'] = call.tool_call_id
4646

4747
gr_message = {
4848
'role': 'assistant',

0 commit comments

Comments
 (0)