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
# don't return the new response to hide it from the user
44
44
return state
45
45
```
46
+
47
+
<Callouttype="warn"title="BEWARE!">
48
+
In LangGraph Python, the `config` variable in the surrounding namespace is **implicitly** passed into LangChain LLM calls, even when not explicitly provided.
49
+
50
+
This is why we create a new variable `modifiedConfig` rather than modifying `config` directly. If we modified `config` itself, it would change the default configuration for all subsequent LLM calls in that namespace.
51
+
52
+
```python
53
+
# if we override the config variable name with a new value
54
+
config = copilotkit_customize_config(config, ...)
55
+
56
+
# it will affect every subsequent LangChain LLM call in the same namespace, even when `config` is not explicitly provided
57
+
response =await model2.ainvoke(*state) # implicitly uses the modified config!
58
+
```
59
+
</Callout>
46
60
</Tab>
47
61
<Tabvalue="TypeScript">
48
62
```typescript
@@ -52,14 +66,17 @@ You can disable all message streaming and tool call streaming by passing `emit_m
52
66
// 1) Configure CopilotKit not to emit messages
53
67
const modifiedConfig =copilotkitCustomizeConfig(
54
68
config,
55
-
{ emitMessages: false, emitToolCalls: false }
69
+
{
70
+
emitMessages: false, // if you want to disable message streaming # [!code highlight]
71
+
emitToolCalls: false// if you want to disable tool call streaming # [!code highlight]
72
+
}
56
73
);
57
74
58
75
// 2) Provide the actions to the LLM
59
76
const model =ChatOpenAI({ model: 'gpt-4o' }).bind(state.copilotkit.actions);
60
77
61
-
// 3) Call the model with CopilotKit's modified config
0 commit comments