Commit Graph

9 Commits

Author SHA1 Message Date
Ran Shemtov de02e9cef0 Merge branch 'main' into fix/2667-langgraph-agui-agent-dict-repr 2026-03-11 16:27:00 +01:00
Valen 95fada4490 fix(sdk-python): fix emit_messages and emit_tool_calls config not working
Fixes #2066

## Problem

`copilotkit_customize_config(config, emit_messages=False)` does not work -
TEXT_MESSAGE_* events are still emitted despite the configuration.

## Root Causes

1. **Metadata Reading Bug**: In `langgraph_agui_agent.py`, the code uses
   `getattr(raw_event, 'metadata', {})` to read metadata, but `raw_event`
   is a dict, not an object. This should use `.get()` instead.

2. **Encoder Crash Bug**: When the filtering logic works (after fixing bug #1),
   it returns `""` (empty string) to skip dispatching events. However, this
   empty string gets yielded to the event encoder which expects event objects
   with `model_dump_json()` method, causing an `AttributeError`.

## Fixes

1. Changed metadata reading to handle both dict and object cases.
2. Changed return value from `""` to `None` for filtered events.
3. Added `run()` method override to filter out `None` values before yielding
   to encoder.
2026-03-06 08:29:04 -08:00
Ran Shem Tov b21db3a8fc fix: do not override predict state metadata if no cpk prefixed metadata present 2026-03-02 13:30:33 +01:00
Charlie Tonneslan fb613ad07a fix(sdk-python): add dict_repr method to LangGraphAGUIAgent
Adds missing dict_repr() method to LangGraphAGUIAgent class to fix
AttributeError when SDK tries to serialize agent info.

The method was present in the parent LangGraphAgent class but not
overridden in LangGraphAGUIAgent, causing failures when calling
sdk.info() with AGUI agents in FastAPI integrations.

Fixes #2667
2025-10-27 15:37:31 -04:00
alexforrestf 8f76efc384 fix(sdk-python): compatibility with langchain v1 (#2633) (#2634) 2025-10-23 15:47:53 -04:00
Ran Shemtov a0155b03e6 fix: ensure stringified args when emitting tool calls (#2571) 2025-10-03 17:05:25 +02:00
Ran Shemtov b7bc3a03e9 feat: pass copilot readable context to agui agents (#2426) 2025-09-15 12:37:55 +02:00
Ran Shemtov a010b323d5 chore: use url from deployment when routing to agent (#2171) 2025-07-17 18:15:58 +02:00
Ran Shemtov df25f34d30 feat: add agui fastAPI compatible langgraph agent (#2117) 2025-07-15 19:49:15 +02:00