Repository navigation
Python: Fix core docstring examples that use missing APIs #9751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1343,7 +1343,8 @@ class LabelTrackingFunctionMiddleware(FunctionMiddleware, _SecurityScopeBinding) | |
| Examples: | ||
| .. code-block:: python | ||
|
|
||
| from agent_framework import Agent, LabelTrackingFunctionMiddleware, tool | ||
| from agent_framework import Agent, tool | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naveen Chatlapalli (@1aifanatic), the run call below was already broken before this PR: |
||
| from agent_framework.security import LabelTrackingFunctionMiddleware | ||
|
|
||
|
|
||
| @tool(additional_properties={"source_integrity": "trusted"}) | ||
|
|
@@ -4314,7 +4315,7 @@ def get_security_tools() -> list[FunctionTool]: | |
| from agent_framework.security import get_security_tools | ||
|
|
||
| agent = Agent( | ||
| chat_client=client, | ||
| client=client, | ||
| instructions="You are a helpful assistant.", | ||
| tools=[my_tool, *get_security_tools()], | ||
| ) | ||
|
|
@@ -4467,10 +4468,10 @@ async def apply_mcp_security_labels( | |
|
|
||
| async with MCPStdioTool(name="github", command="gh-mcp", args=["stdio"]) as mcp: | ||
| await apply_mcp_security_labels(mcp) | ||
| agent = ChatCompletionAgent( | ||
| chat_client=client, | ||
| agent = Agent( | ||
| client=client, | ||
| tools=[mcp], | ||
| context_providers=[SecureAgentConfig(chat_client=client)], | ||
| context_providers=[SecureAgentConfig(quarantine_chat_client=client)], | ||
| ) | ||
| """ | ||
| if not getattr(mcp_tool, "is_connected", False): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naveen Chatlapalli (@1aifanatic), this local example has another pre-existing problem: it calls
tool_called_checkwithout importing it, so copying it raisesNameErrorbefore evaluation starts. Could you addtool_called_checkto theagent_frameworkimport here and in theLocalEvaluatorbasic-usage example, which has the same omission?