-
Notifications
You must be signed in to change notification settings - Fork 5
[examples] Add agno/recipe-creator via template #58
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
- Implemented RecipeCreator agent wrapper following existing pattern - Added agno and exa_py dependencies to pyproject.toml - Updated agentuity.yaml configuration (removed project_id, updated agent entry) - Created comprehensive README with usage examples - Added .env.example for local development - Dependencies successfully installed with uv sync Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Warning Rate limit exceeded@devin-ai-integration[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 56 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughAdds a new Agentuity-based “Recipe Creator” example under frameworks/agno/recipe-creator, including project config, server startup, an agent definition and runtime, environment template, and documentation. Introduces a ChefGenius agent configured with ExaTools and an async handler that executes the recipe flow and returns normalized responses. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant GW as Agentuity Gateway
participant RA as RecipeCreator Agent (run)
participant CFG as recipe_agent (ChefGenius)
participant XT as ExaTools
participant EXA as Exa API
U->>GW: Send prompt
GW->>RA: AgentRequest(text)
RA->>RA: Validate/normalize input
RA->>CFG: Execute recipe_agent.run(prompt) (thread pool)
CFG->>XT: semanticSearch(ingredients/query)
XT->>EXA: /search
EXA-->>XT: results
XT-->>CFG: curated links/snippets
CFG-->>RA: structured markdown content
RA->>GW: AgentResponse(content)
GW-->>U: Rendered recipe
rect rgba(255,235,205,0.35)
note over RA,CFG: New/changed flow: async handler with return-type normalization and error handling
end
alt Error
RA->>GW: Generic internal error message
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (12)
frameworks/agno/recipe-creator/.env.example (1)
1-1: Add required third‑party keys (OpenAI, Exa) and optional API key variant.The agent will need OpenAI and Exa credentials at runtime. Also include AGENTUITY_API_KEY for completeness.
AGENTUITY_SDK_KEY=your_sdk_key_here +AGENTUITY_API_KEY=your_api_key_here +OPENAI_API_KEY=your_openai_api_key_here +EXA_API_KEY=your_exa_api_key_hereframeworks/agno/recipe-creator/main.py (1)
1-6: Align the message with this example to reduce confusion.def main(): - print("Hello from py-template!") + print("Recipe Creator example. Start the dev server with: agentuity dev")frameworks/agno/recipe-creator/README.md (2)
37-37: Fix markdownlint MD034: wrap bare URL.-3. The agent will be available at the printed local URL (typically http://127.0.0.1:3500) +3. The agent will be available at the printed local URL (typically <http://127.0.0.1:3500>)
25-36: Document required env vars for local dev.Add a brief step to set AGENTUITY_(SDK|API)_KEY, OPENAI_API_KEY, and EXA_API_KEY so the agent runs end‑to‑end.
frameworks/agno/recipe-creator/server.py (1)
8-18: Clarify error message (either API or SDK key), print to stderr, and use yellow for warnings.- # Check if AGENTUITY_API_KEY is set + # Require either AGENTUITY_API_KEY or AGENTUITY_SDK_KEY if not os.environ.get("AGENTUITY_API_KEY") and not os.environ.get( "AGENTUITY_SDK_KEY" ): - print( - "\033[31m[ERROR] AGENTUITY_SDK_KEY is not set. This should have been set automatically by the Agentuity CLI or picked up from the .env file.\033[0m" - ) + print( + "\033[31m[ERROR] Neither AGENTUITY_API_KEY nor AGENTUITY_SDK_KEY is set. These should be set by the Agentuity CLI or via your .env file.\033[0m", + file=sys.stderr, + ) if os.environ.get("_", "").endswith("uv") and os.path.exists(".env"): - print( - "\033[31m[ERROR] Re-run the command with `uv run --env-file .env server.py`\033[0m" - ) + print( + "\033[31m[ERROR] Re-run the command with `uv run --env-file .env server.py`\033[0m", + file=sys.stderr, + ) sys.exit(1) # Check if AGENTUITY_TRANSPORT_URL is set if not os.environ.get("AGENTUITY_TRANSPORT_URL"): - print( - "\033[31m[WARN] You are running this agent outside of the Agentuity environment. Any automatic Agentuity features will be disabled.\033[0m" - ) - print( - "\033[31m[WARN] Recommend running `agentuity dev` to run your project locally instead of `python script`.\033[0m" - ) + print( + "\033[33m[WARN] You are running this agent outside of the Agentuity environment. Any automatic Agentuity features will be disabled.\033[0m", + file=sys.stderr, + ) + print( + "\033[33m[WARN] Recommend running `agentuity dev` to run your project locally instead of `python script`.\033[0m", + file=sys.stderr, + )Also applies to: 20-27
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py (5)
15-15: Unify log tag with agent name.- context.logger.info(f"[RecipeAgent] prompt: {prompt!r}") + context.logger.info(f"[RecipeCreator] prompt: {prompt!r}")
18-20: Use asyncio.to_thread for simplicity.- loop = asyncio.get_running_loop() - raw = await loop.run_in_executor(None, lambda: recipe_agent.run(prompt)) + raw = await asyncio.to_thread(recipe_agent.run, prompt)
21-29: Handle None returns explicitly.- if isinstance(raw, str): + if raw is None: + output = "" + elif isinstance(raw, str): output = raw elif hasattr(raw, "content"): output = raw.content elif hasattr(raw, "reply"): output = raw.reply else: output = str(raw)
31-31: Adjust log tag.- context.logger.error("[RecipeAgent] empty output") + context.logger.error("[RecipeCreator] empty output")
37-37: Adjust log tag.- context.logger.error(f"[RecipeAgent] fatal error: {exc}", exc_info=True) + context.logger.error(f"[RecipeCreator] fatal error: {exc}", exc_info=True)frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/recipe_agent.py (2)
1-1: Make model/tool config environment-driven and fail-soft when EXA_API_KEY is missing.Prevents startup/runtime failures on dev setups without keys and eases model switching in different environments.
Apply this diff:
from textwrap import dedent +import os +import warnings from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.tools.exa import ExaTools +exa_tools = [] +if os.getenv("EXA_API_KEY"): + exa_tools = [ExaTools()] +else: + warnings.warn( + "EXA_API_KEY not set; ExaTools disabled. Set it to enable semantic recipe search.", + stacklevel=1, + ) + recipe_agent = Agent( name="ChefGenius", - tools=[ExaTools()], - model=OpenAIChat(id="gpt-4o"), + tools=exa_tools, + model=OpenAIChat(id=os.getenv("OPENAI_MODEL", "gpt-4o")), @@ - show_tool_calls=True, + show_tool_calls=os.getenv("SHOW_TOOL_CALLS", "0") == "1", )Also applies to: 7-11, 67-70
28-34: Explicitly instruct the model to actually call Exa tools.Reduces hallucinated “search” and nudges deterministic tool use before composing recipes.
Apply this diff:
2. Recipe Selection 🔍 - - Use Exa to search for relevant recipes + - Use Exa to search for relevant recipes + - When research is needed, call the available Exa tools to retrieve 3–5 high‑quality candidates before composing the final recipe; cite sources briefly where helpful - Ensure ingredients match availability - Verify cooking times are appropriate - Consider seasonal ingredients - Check recipe ratings and reviews
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
frameworks/agno/recipe-creator/.env.example(1 hunks)frameworks/agno/recipe-creator/README.md(1 hunks)frameworks/agno/recipe-creator/agentuity.yaml(1 hunks)frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py(1 hunks)frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/recipe_agent.py(1 hunks)frameworks/agno/recipe-creator/agentuity_agents/__init__.py(1 hunks)frameworks/agno/recipe-creator/main.py(1 hunks)frameworks/agno/recipe-creator/pyproject.toml(1 hunks)frameworks/agno/recipe-creator/server.py(1 hunks)
🧰 Additional context used
🧠 Learnings (21)
📚 Learning: 2025-06-23T17:16:16.519Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:16:16.519Z
Learning: The Agentuity configuration file (agentuity.yaml) is reserved for configuring the AI Agent project and should not be edited or suggested for edits during code review.
Applied to files:
frameworks/agno/recipe-creator/.env.exampleframeworks/agno/recipe-creator/agentuity_agents/__init__.pyframeworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-06-23T17:16:13.875Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:16:13.875Z
Learning: In Agentuity AI Agent Python files (agents/**/*.py), the main entry point should be an async function named `run` that accepts parameters of types AgentRequest, AgentResponse, and AgentContext.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-07-17T13:40:30.298Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/tavily_agent/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-07-17T13:40:30.298Z
Learning: Applies to agents/tavily_agent/agents/**/*.py : The main handler function for an agent should be defined as an async function named 'run' with parameters (request: AgentRequest, response: AgentResponse, context: AgentContext)
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:14:53.981Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/llamaindex/basic/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:14:53.981Z
Learning: When writing Python AI Agent files for the Agentuity platform (in files matching agents/**/*.py), always define an async function named `run` as the entry point.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:15:43.688Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/miscellaneous/mem0/mem0demo/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:15:43.688Z
Learning: When writing Agentuity AI Agents in Python, always define an async function named `run` that serves as the entry point for the agent.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:14:03.437Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/crewai/socialagent/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:14:03.437Z
Learning: In the Agentuity Python SDK, the main agent handler should be an async function named 'run' that accepts 'request: AgentRequest', 'response: AgentResponse', and 'context: AgentContext' as arguments.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:14:31.499Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langchain/basic/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:14:31.499Z
Learning: In the Agentuity Python SDK, the main agent handler should be an async function named 'run' that accepts 'request: AgentRequest', 'response: AgentResponse', and 'context: AgentContext' as parameters.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-07-17T13:40:58.033Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/agno/from_agno/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:40:58.033Z
Learning: Applies to frameworks/agno/from_agno/agents/**/*.py : The file should define an async function named `run`
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:15:05.904Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/llamaindex/basic/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:15:05.904Z
Learning: In the Agentuity Python SDK, the main agent handler function should be defined as an async function named 'run' that accepts 'request' (AgentRequest), 'response' (AgentResponse), and 'context' (AgentContext) as parameters.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:15:53.658Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/miscellaneous/mem0/mem0demo/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:15:53.658Z
Learning: In the Agentuity Python SDK, the main entry point for an agent is an async function named 'run' that takes three arguments: request (AgentRequest), response (AgentResponse), and context (AgentContext).
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:16:43.214Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/pydantic/basic/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:16:43.214Z
Learning: In the Agentuity Python SDK, the main handler for an agent is an async function named 'run' that takes 'request', 'response', and 'context' as parameters.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:16:25.368Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:16:25.368Z
Learning: In the Agentuity Python SDK, the main handler function for an agent should be defined as an async function named 'run' with the signature: async def run(request: AgentRequest, response: AgentResponse, context: AgentContext) -> Any.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py
📚 Learning: 2025-06-23T17:16:33.550Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/pydantic/basic/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:16:33.550Z
Learning: The agentuity.yaml file is a configuration file used by Agentuity to configure the AI Agent project and should not be edited or suggested for edits during code review.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/__init__.pyframeworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-06-23T17:15:30.804Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/miscellaneous/grokLiveSearch/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:15:30.804Z
Learning: In the context of Agentuity AI projects, the 'agentuity.yaml' file is a configuration file that should not be edited or suggested for edits during code review.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/__init__.pyframeworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-07-17T13:41:01.314Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/agno/from_agno/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-07-17T13:41:01.314Z
Learning: Applies to frameworks/agno/from_agno/**/agentuity.yaml : Do not suggest edits to the Agentuity AI Configuration file (agentuity.yaml)
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/__init__.pyframeworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-06-23T17:13:52.368Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/crewai/socialagent/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:13:52.368Z
Learning: The 'agentuity.yaml' file is a configuration file used by Agentuity to configure the AI Agent project and should not be edited or suggested for edits.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/__init__.pyframeworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-06-23T17:14:18.092Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langchain/basic/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:14:18.092Z
Learning: The file 'agentuity.yaml' is used to configure the Agentuity AI Agent project and should not be edited or suggested for edits.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/__init__.pyframeworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-06-23T17:17:12.992Z
Learnt from: CR
PR: agentuity/examples#0
File: patterns/llmAsJury/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:17:12.992Z
Learning: In the context of Agentuity AI projects, the agentuity.yaml file is a configuration file that should not be edited or suggested for edits during code review.
Applied to files:
frameworks/agno/recipe-creator/agentuity_agents/__init__.pyframeworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-06-23T17:15:46.735Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/miscellaneous/mem0/mem0demo/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:15:46.735Z
Learning: The Agentuity configuration file (agentuity.yaml) is used to configure the AI Agent project and should not be edited or suggested for edits.
Applied to files:
frameworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-06-23T17:16:02.063Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai-typescript/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:16:02.063Z
Learning: The Agentuity AI Configuration file (agentuity.yaml) is used to configure the AI Agent project and should not be edited or suggested for edits.
Applied to files:
frameworks/agno/recipe-creator/agentuity.yaml
📚 Learning: 2025-07-17T13:39:39.665Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-07-17T13:39:39.665Z
Learning: Applies to agents/composio/**/agentuity.yaml : Do NOT suggest edits to the Agentuity AI Configuration file (agentuity.yaml)
Applied to files:
frameworks/agno/recipe-creator/agentuity.yaml
🪛 markdownlint-cli2 (0.18.1)
frameworks/agno/recipe-creator/README.md
37-37: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (6)
frameworks/agno/recipe-creator/agentuity_agents/__init__.py (1)
1-1: LGTM — minimal package init is fine.frameworks/agno/recipe-creator/agentuity.yaml (1)
1-66: No suggestions — config file is out of review scope per project policy.frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/agent.py (1)
4-4: Import path and symbol verifiedframeworks/agno/recipe-creator/agentuity_agents/RecipeCreator/recipe_agent.py defines
recipe_agent = Agent(...), so the import is valid.frameworks/agno/recipe-creator/pyproject.toml (1)
6-11: Use canonical PyPI name and pin critical depsConfirmed: PyPI project name is "exa-py" (package imported/installed as exa_py). Update frameworks/agno/recipe-creator/pyproject.toml — replace "exa_py" with "exa-py" and pin both agno and exa-py to explicit versions to avoid dependency drift.
frameworks/agno/recipe-creator/agentuity_agents/RecipeCreator/recipe_agent.py (2)
11-18: Well-scoped agent persona and output structure.Clear, actionable instructions and presentation guidance. This should yield consistent, high‑quality responses.
Also applies to: 35-44, 53-66
3-5: Confirm Agno 2.0.8 API compatibility & dependency pin
- Docs show OpenAIChat accepts id="gpt-4o" (default); Agent supports markdown, add_datetime_to_instructions, show_tool_calls; Exa is imported as
from agno.tools.exa import ExaTools.- Action: ensure the repo pins Agno >= 2.0.8 in frameworks/agno/recipe-creator/pyproject.toml (script output didn’t show the pin).
- Add uv.lock with locked dependency versions - Add __init__.py for RecipeCreator module - Add AGENTS.md configuration file Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
[examples] Add agno/recipe-creator via template
Summary
Converts the Agno recipe-creator example to an Agentuity agent following the py_template structure. This creates a new
frameworks/agno/recipe-creator/directory with:RecipeCreatoragent wrapper that uses asyncio to execute the synchronous Agno agentChefGeniusagent using Agno framework with Exa semantic search for recipe recommendationsagnoandexa_pyto pyproject.toml (dependencies installed successfully withuv sync)The agent provides intelligent recipe recommendations based on available ingredients, dietary restrictions, and time constraints, using Exa search to find relevant recipes and providing detailed cooking instructions with rich markdown formatting.
Review & Testing Checklist for Human
agentuity devin the recipe-creator directory and confirm no errors/welcomeendpoint: Confirm it returns valid JSON with exact format{ welcome: string }(no prompts array)from agentuity_agents.RecipeCreator.recipe_agent import recipe_agentresolves correctlyagnoandexa_pywork together without version conflictsNotes
uv syncgenerating 133 packages includingagno==2.0.8andexa-py==1.15.6frameworks/agno/from_agno/agents/RecipeAgent/Link to Devin run: https://app.devin.ai/sessions/495820ca32444be393ac4eb6f72c4ca2
Requested by: Dhilan Fye (dfye@agentuity.com)
Summary by CodeRabbit
New Features
Documentation
Chores