Add AIML API provider-specific example scripts#1243
Conversation
Added three example scripts under examples/provider_specific/aimlapi: run_agent.py demonstrates agent execution and file writing, structured_output.py shows structured JSON output for developer resources, and tools_agent.py illustrates tool-using agents for event planning. Updated .gitignore to exclude .idea directory.
There was a problem hiding this comment.
Pull Request Overview
This PR adds three new example files demonstrating how to use the AI/ML API provider with Marvin. The examples showcase basic agent usage, structured output generation, and agents with custom tools.
- Added helper function
get_provider()for AI/ML API authentication and configuration - Implemented three example scripts showing different AI/ML API use cases: basic agent, structured output, and tools integration
- Maintained consistency with existing provider-specific examples
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| examples/provider_specific/aimlapi/run_agent.py | Demonstrates basic agent usage with file writing tool |
| examples/provider_specific/aimlapi/structured_output.py | Shows structured output generation with TypedDict |
| examples/provider_specific/aimlapi/tools_agent.py | Illustrates agent with multiple custom tools for date and weather |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
|
|
||
| for resource in resources: | ||
| print(f"- {resource['title']}\n {resource['url']}\n {resource['summary']}\n") |
There was a problem hiding this comment.
[nitpick] The nested f-string with multiple escape sequences reduces readability. Consider using a multi-line formatted string or separate print statements for cleaner code, e.g., print(f\"- {resource['title']}\"), print(f\" {resource['url']}\"), print(f\" {resource['summary']}\n\").
| print(f"- {resource['title']}\n {resource['url']}\n {resource['summary']}\n") | |
| print(f"- {resource['title']}") | |
| print(f" {resource['url']}") | |
| print(f" {resource['summary']}\n") |
|
@zzstoatzz Hi team! I’ve just added a provider-specific example set for AI/ML API , covering agent execution, structured outputs, and tool-using agents. We’d like to stay in sync with the Marvin team for future updates and testing. |
Added three example scripts under examples/provider_specific/aimlapi: run_agent.py demonstrates agent execution and file writing, structured_output.py shows structured JSON output for developer resources, and tools_agent.py illustrates tool-using agents for event planning.
From pr #1217 and issue #1171