Skip to content

Commit 4657da6

Browse files
committed
✨ feat(context): enhance context metadata with LangGraph node bindings
- Add json_schema_extra metadata to context fields for LangGraph Studio integration - Improve metadata formatting with proper trailing commas - Bind model field to call_model node and tool-related fields to tools node
1 parent 7a45995 commit 4657da6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/common/context.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,32 @@ class Context:
1616
default=prompts.SYSTEM_PROMPT,
1717
metadata={
1818
"description": "The system prompt to use for the agent's interactions. "
19-
"This prompt sets the context and behavior for the agent."
19+
"This prompt sets the context and behavior for the agent.",
2020
},
2121
)
2222

2323
model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field(
2424
default="qwen:qwen-flash",
2525
metadata={
2626
"description": "The name of the language model to use for the agent's main interactions. "
27-
"Should be in the form: provider:model-name."
27+
"Should be in the form: provider:model-name.",
28+
"json_schema_extra": {"langgraph_nodes": ["call_model"]},
2829
},
2930
)
3031

3132
max_search_results: int = field(
3233
default=5,
3334
metadata={
34-
"description": "The maximum number of search results to return for each search query."
35+
"description": "The maximum number of search results to return for each search query.",
36+
"json_schema_extra": {"langgraph_nodes": ["tools"]},
3537
},
3638
)
3739

3840
enable_deepwiki: bool = field(
3941
default=False,
4042
metadata={
41-
"description": "Whether to enable the DeepWiki MCP tool for accessing open source project documentation."
43+
"description": "Whether to enable the DeepWiki MCP tool for accessing open source project documentation.",
44+
"json_schema_extra": {"langgraph_nodes": ["tools"]},
4245
},
4346
)
4447

0 commit comments

Comments
 (0)