Closed GregorBeuster closed 1 month ago
Thanks. Hmmm... there is a bug in the error message code, which is why you're seeing [object Object]
I have fixed the bug, so if you upgrade, we will see the correct error message. (@assistant-ui/react-langgraph@0.0.17)
Could you console.log(JSON.stringify(values, null, 2))
so that we see what's inside the mysterious Array? Somewhere inside of this array, there is an unrecognized type
{ "messages": [ { "content": "merk dir dass 1,92m gross bin", "additional_kwargs": {}, "response_metadata": {}, "type": "human", "name": null, "id": "d7f633e1-5e5e-4dbb-bb2e-770b3274043f", "example": false }, { "content": [ { "text": "Natürlich, ich werde mir das für Sie merken! Lassen Sie mich diese Information in meiner Datenbank speichern.", "type": "text", "index": 0 }, { "id": "toolu_01PHWu1V6SfC4WQRsWyAJn57", "input": {}, "name": "upsert_memory", "type": "tool_use", "index": 1, "partial_json": "{\"content\": \"Der Benutzer ist 1,92m groß.\", \"context\": \"Der Benutzer bat darum, sich zu merken, dass er 1,92m groß ist. Dies ist eine wichtige persönliche Information über seine Körpergröße.\"}" } ], "additional_kwargs": {}, "response_metadata": { "stop_reason": "tool_use", "stop_sequence": null }, "type": "ai", "name": null, "id": "run-ac9c1abd-9bc0-4b27-b10d-f1a562f2b4dc", "example": false, "tool_calls": [ { "name": "upsert_memory", "args": { "content": "Der Benutzer ist 1,92m groß.", "context": "Der Benutzer bat darum, sich zu merken, dass er 1,92m groß ist. Dies ist eine wichtige persönliche Information über seine Körpergröße." }, "id": "toolu_01PHWu1V6SfC4WQRsWyAJn57", "type": "tool_call" } ], "invalid_tool_calls": [], "usage_metadata": { "input_tokens": 1623, "output_tokens": 162, "total_tokens": 1785, "input_token_details": {} } }, { "content": "Stored memory None", "additional_kwargs": {}, "response_metadata": {}, "type": "tool", "name": null, "id": "25fdafe6-8b4b-4a97-9c20-17f12474c9b8", "tool_call_id": "toolu_01PHWu1V6SfC4WQRsWyAJn57", "artifact": null, "status": "success" }, { "content": [ { "text": "\n\nVielen Dank für diese Information! Ich habe mir notiert, dass Sie 1,92m groß sind. Das ist eine beeindruckende Größe! Darf ich fragen, ob Sie diese Größe in irgendeiner Weise besonders finden, zum Beispiel beim Einkaufen von Kleidung oder in Ihrem Alltag? Es wäre interessant zu hören, wie sich das auf Ihr Leben auswirkt.", "type": "text", "index": 0 } ], "additional_kwargs": {}, "response_metadata": { "stop_reason": "end_turn", "stop_sequence": null }, "type": "ai", "name": null, "id": "run-00771331-8ba5-478f-8438-4ec494fa6cd3", "example": false, "tool_calls": [], "invalid_tool_calls": [], "usage_metadata": { "input_tokens": 1788, "output_tokens": 120, "total_tokens": 1908, "input_token_details": {} } } ] }
So it's the "tool_use" content part that is confusing assistant-ui
- thanks for catching this!
Just fixed in #994 / @assistant-ui/react-langgraph v0.0.18
Can you confirm that this is fixed? Thanks a lot and sorry about the back and forth!
Fixed :-) Many thanks man!!!
Amazing :)
[ { "content": "merk dir dass 1,92m gross bin", "additional_kwargs": {}, "response_metadata": {}, "type": "human", "name": null }, { "content": Array, <-- THIS COULD BE THE NEW PROBLEM? "additional_kwargs": {}, "response_metadata": { "stop_reason": "tool_use", "stop_sequence": null }, "type": "ai", "name": null }, { "content": "Stored memory None", "additional_kwargs": {}, "response_metadata": {}, "type": "tool", "name": null }, { "content": [ { "text": "↵↵Vielen Dank für diese Information!", "type": "text", "index": 0 } ], "additional_kwargs": {}, "response_metadata": { "stop_reason": "end_turn", "stop_sequence": null }, "type": "ai", "name": null } ]
When I try to display this thread containing 4 messages, I don´t get the error regaring trim function not defined anymore but a new one:
Error: Unknown content part type: [object Object]
...