Skip to content

Commit b2a7e2b

Browse files
committed
fix: address typo in ui
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
1 parent f87533b commit b2a7e2b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

agent/agent.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ async def chat_node(state: AgentState, config: RunnableConfig) -> Command[Litera
5959
# 1. Define the model
6060
model = ChatOpenAI(model="gpt-4o")
6161

62-
print(state)
63-
6462
# 2. Bind the tools to the model
6563
model_with_tools = model.bind_tools(
6664
[
67-
*state["tools"], # bind tools defined by ag-ui
65+
*state.get("tools", []), # bind tools defined by ag-ui
6866
get_weather,
6967
# your_tool_here
7068
],

src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type AgentState = {
4242

4343
function YourMainContent({ themeColor }: { themeColor: string }) {
4444
// 🪁 Shared State: https://docs.copilotkit.ai/coagents/shared-state
45-
const {state, setState} = useCoAgent<AgentState>({
45+
const { state, setState } = useCoAgent<AgentState>({
4646
name: "sample_agent",
4747
initialState: {
4848
proverbs: [
@@ -69,7 +69,7 @@ function YourMainContent({ themeColor }: { themeColor: string }) {
6969

7070
//🪁 Generative UI: https://docs.copilotkit.ai/coagents/generative-ui
7171
useCopilotAction({
72-
name: "getWeather",
72+
name: "get_weather",
7373
description: "Get the weather for a given location.",
7474
available: "disabled",
7575
parameters: [

0 commit comments

Comments
 (0)