-
Notifications
You must be signed in to change notification settings - Fork 10
python sdk examples added #39
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
Conversation
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.
Review completed. Found several critical bugs that will cause runtime errors.
🤖 Automated review complete. Please react with 👍 or 👎 on the individual review comments to provide feedback on their usefulness.
|
|
||
|
|
||
| def main(): | ||
| a = Agent(workspace_root=Path.cwd()) |
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.
Bug: Undefined name Agent
The code uses Agent but the import statement imports Auggie. This will cause a NameError at runtime.
# Current code:
a = Agent(workspace_root=Path.cwd())
# Should be:
a = Auggie(workspace_root=Path.cwd())| 5. If criteria not met after max rounds, raises AugmentVerificationError | ||
| """ | ||
|
|
||
| from auggie_sdk import Agent, AugmentVerificationError |
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.
Bug: Undefined name Agent
The import statement attempts to import Agent which doesn't exist in auggie_sdk. Based on other examples in this PR, it should be Auggie.
# Current code:
from auggie_sdk import Agent, AugmentVerificationError
# Should be:
from auggie_sdk import Auggie, AugmentVerificationError| def main(): | ||
| """Demonstrate success criteria usage.""" | ||
|
|
||
| agent = Auggie() |
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.
Bug: Undefined name Agent
This will cause a NameError because Agent was not imported (and doesn't exist). Should use Auggie instead.
# Current code:
agent = Auggie()
# This is actually correct! But the import on line 16 is wrong.Note: The instantiation is correct, but the import statement on line 16 needs to be fixed.
| class SimpleListener(AgentEventListener): | ||
| """Simple listener that prints agent responses.""" | ||
|
|
||
| def on_agent_message_chunk(self, text: str): |
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.
Potential bug: Method name inconsistency
This example uses on_agent_message_chunk() but event_listener_demo.py in the same PR uses on_agent_message() for the AgentEventListener interface. The method names should be consistent across all examples.
Based on event_listener_demo.py lines 34 and 46, it appears the interface supports both:
on_agent_message_chunk(text)- for streaming chunkson_agent_message(message)- for complete message
Please verify this is the correct method name for the AgentEventListener interface.
| def on_agent_message(self, text: str) -> None: | ||
| print(text, end="", flush=True) | ||
|
|
||
| def on_tool_call_start( |
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.
Potential bug: Method name inconsistency
This example uses on_tool_call_start() but event_listener_demo.py (line 54) uses on_tool_call() for the same interface. The method names should match the actual AgentEventListener interface.
Please verify which is the correct method name and ensure consistency across all examples.
| ) -> None: | ||
| print(f"\n 🔧 Using tool: {title}", flush=True) | ||
|
|
||
| def on_tool_call_update( |
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.
Potential bug: Method name inconsistency
This example uses on_tool_call_update() but event_listener_demo.py (line 84) uses on_tool_response() for the same interface. The method names should match the actual AgentEventListener interface.
Please verify which is the correct method name and ensure consistency across all examples.
| """Called when the agent sends a message chunk.""" | ||
| print(f"[AGENT MESSAGE] {text}", end="", flush=True) | ||
|
|
||
| def on_tool_call_start( |
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.
Potential bug: Method name inconsistency
This example uses on_tool_call_start() but event_listener_demo.py uses on_tool_call(). These examples should use consistent method names that match the actual AgentEventListener interface.
Please verify the correct method name and update all examples to use it consistently.
| print(f" Kind: {kind}") | ||
| print(f" Status: {status}") | ||
|
|
||
| def on_tool_call_update( |
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.
Potential bug: Method name inconsistency
This example uses on_tool_call_update() but event_listener_demo.py uses on_tool_response(). These examples should use consistent method names that match the actual AgentEventListener interface.
Please verify the correct method name and update all examples to use it consistently.
Add comprehensive Python SDK examples and documentation
This PR introduces a complete set of examples demonstrating how to use the Augment Python SDK, making it easier for developers to get started and understand key features.
What's Added
Core Examples
basic_usage.py- Fundamental SDK features including typed responses, dataclasses, enums, and session managementsession_usage.py- Session context manager usage for conversation continuityfunction_calling_example.py- How to provide Python functions that the agent can call during executionevent_listener_demo.py- Comprehensive demonstration of all AgentEventListener eventsACP Client Examples
acp_demo.py- Simple demo of AuggieACPClient for persistent sessionsacp_example_usage.py- Advanced ACP client usage with event listeners and context managersUtility Examples
list_models.py- List available modelslist_prs.py- Working with GitHub PRs using the SDKcli_analyzer.py- CLI analysis examplemock_client_example.py- Using mock clients for testingsuccess_criteria_example.py- Success criteria patternsdemo_session_continuity.py- Session continuity demonstrationDocumentation
README.md- Comprehensive guide covering all examples, workflow patterns, and templatesREADME_PROMPT_TO_CODE.md- Guide for converting natural language prompts to SDK codeexample_prompt.txt- Sample prompt for testing prompt-to-SDK conversionKey Features Demonstrated
Developer Impact
This PR significantly improves the developer experience by:
🤖 This description was generated automatically. Please react with 👍 if it's helpful or 👎 if it needs improvement.