I'm attempting to pass custom values to the langgraph agent endpoint via the frontend:
<CopilotKit
runtimeUrl="/api/copilotkit"
properties={{
userId: 'vncq55ajcjhdng2wu0t5z8bq',
propertyId: 'ctxz5vxl1asmzxnuas3ghxyz',
}}
>
<Box
component="main"
sx={{
flexFlow: 'center',
alignItems: 'center',
flexGrow: 1,
}}
>
{children}
</Box>
<CopilotSidebar
defaultOpen={false}
instructions={
'You are assisting the user as best as you can. Answer in the best way possible given the data you have.'
}
labels={{
title: 'Sidebar Assistant',
initial: 'How can I help you today?',
}}
/>
</CopilotKit>
I then capture the custom value via the following in langgraph (python):
def build_agents(context):
return [
LangGraphAgent(
name="sample_agent",
description="Answers questions about the weather and the subject property",
graph=graph,
langgraph_config={
"propertyId": context["properties"].get("propertyId", "")
},
)
]
This seems to cause the client to sometimes omit the properties value altogether in a non-deterministic way. Is there something I'm missing?