-
-
Notifications
You must be signed in to change notification settings - Fork 743
Add Intelligent Travel Planning Agent Notebook #741
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
Add Intelligent Travel Planning Agent Notebook #741
Conversation
|
Warning Rate limit exceeded@Dhivya-Bharathy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 16 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 selected for processing (1)
WalkthroughA new Jupyter notebook example is added, showcasing an AI Enrollment Counselor agent for university admissions automation. The notebook demonstrates how to configure, interact with, and utilize the agent to answer applicant questions, check application completeness, and provide personalized admissions guidance using the PraisonAI library. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Notebook
participant PraisonAI Agent
User->>Notebook: Provide query (with optional submitted/required docs)
Notebook->>PraisonAI Agent: Send constructed prompt
PraisonAI Agent-->>Notebook: Return response (answers/guidance)
Notebook-->>User: Display agent's response
Possibly related PRs
Suggested labels
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Summary of Changes
Hello @Dhivya-Bharathy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new example Jupyter notebook that showcases an AI Enrollment Counselor agent. This agent, built with the PraisonAI framework, is designed to assist with university admissions by providing automated responses to applicant questions and helping to validate application completeness. Please note that the content of the notebook pertains to an 'AI Enrollment Counselor' despite the pull request title and description indicating a 'Travel Planning Agent'.
Highlights
- New Notebook Addition: A new Jupyter notebook,
AI_Enrollment_Counselor.ipynb, has been added to theexamples/cookbooksdirectory. This notebook introduces an AI agent for university admissions, despite the pull request title suggesting a 'Travel Planning Agent'. - AI Enrollment Counselor Agent: The notebook demonstrates the implementation of an AI Enrollment Counselor agent. This agent is designed to automate university admissions tasks, such as answering applicant questions and verifying application completeness.
- PraisonAI Framework Integration: The agent is built using the
PraisonAI Agentsframework, showcasing how to define an agent'sROLE,GOAL, andINSTRUCTIONSto guide its behavior in an admissions context. - Practical Demonstrations: The notebook includes executable code cells that illustrate the agent's capabilities, specifically demonstrating how it can check for missing application documents and respond to general admissions inquiries.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||
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 (2)
examples/cookbooks/AI_Enrollment_Counselor.ipynb (2)
68-68: Use a more secure API key placeholder.Consider using a more generic placeholder like
"your-openai-api-key-here"instead of"sk-..."to avoid any risk of users accidentally committing real API keys that match this pattern.-os.environ["OPENAI_API_KEY"] = "sk-..." # <-- Replace with your actual OpenAI API key +os.environ["OPENAI_API_KEY"] = "your-openai-api-key-here" # <-- Replace with your actual OpenAI API key
407-417: Add input validation and error handling to the helper function.The function could benefit from input validation and error handling to make it more robust for production use.
def ask_enrollment_agent(query, submitted=None, required=None): + """ + Ask the enrollment agent a question with optional document validation. + + Args: + query (str): The question to ask the agent + submitted (list, optional): List of submitted documents + required (list, optional): List of required documents + + Returns: + str: Agent's response + """ + if not query or not isinstance(query, str): + raise ValueError("Query must be a non-empty string") + if submitted and required: + if not isinstance(submitted, list) or not isinstance(required, list): + raise ValueError("Document lists must be lists") prompt = ( f"Applicant submitted documents: {submitted}\n" f"Required documents: {required}\n" f"{query}\n" "List any missing documents and provide guidance." ) return enrollment_agent.start(prompt) else: return enrollment_agent.start(query)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
examples/cookbooks/AI_Enrollment_Counselor.ipynb(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-agents/CLAUDE.md:0-0
Timestamp: 2025-06-30T10:06:17.673Z
Learning: Use the `Agent` class from `praisonaiagents/agent/` for core agent implementations, supporting LLM integration, tool calling, and self-reflection.
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-ts/.cursorrules:0-0
Timestamp: 2025-06-30T10:05:51.843Z
Learning: Applies to src/praisonai-ts/src/agents/autoagents.ts : The 'AutoAgents' class in 'src/agents/autoagents.ts' should provide high-level convenience for automatically generating agent/task configuration from user instructions, using 'aisdk' to parse config.
examples/cookbooks/AI_Enrollment_Counselor.ipynb (2)
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-ts/.cursorrules:0-0
Timestamp: 2025-06-30T10:05:51.843Z
Learning: Applies to src/praisonai-ts/src/agents/autoagents.ts : The 'AutoAgents' class in 'src/agents/autoagents.ts' should provide high-level convenience for automatically generating agent/task configuration from user instructions, using 'aisdk' to parse config.
Learnt from: CR
PR: MervinPraison/PraisonAI#0
File: src/praisonai-ts/.cursorrules:0-0
Timestamp: 2025-06-30T10:05:51.843Z
Learning: Applies to src/praisonai-ts/src/agent/agent.ts : The 'Agent' class in 'src/agent/agent.ts' should encapsulate a single agent's role, name, and methods for calling the LLM using 'aisdk'.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: GitGuardian Security Checks
🔇 Additional comments (4)
examples/cookbooks/AI_Enrollment_Counselor.ipynb (4)
9-18: Inconsistency detected between PR objectives and notebook content.The PR objectives describe this as an "Intelligent Travel Planning Agent" notebook, but the actual content is an "AI Enrollment Counselor" for university admissions. Please verify that the correct notebook was submitted or update the PR description accordingly.
Likely an incorrect or invalid review comment.
47-47: Dependencies installation looks good.The installation command is clean and appropriate for a demo notebook. The
--quietflag ensures clean output.
88-88: Clean import statement.The import follows best practices and aligns with the PraisonAI architecture using the Agent class.
108-118: Well-structured agent configuration.The role, goal, and instructions are clearly defined and provide appropriate guidance for an enrollment counselor agent. The configuration follows PraisonAI best practices.
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.
Code Review
This pull request adds the AI Enrollment Counselor notebook, demonstrating a PraisonAI agent implementation. The changes include setting up the agent and defining its role, goal, and instructions. The main feedback points are around improving API key security and mitigating prompt injection vulnerabilities.
| "import os\n", | ||
| "os.environ[\"OPENAI_API_KEY\"] = \"sk-...\" # <-- Replace with your actual OpenAI API key" |
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.
Storing the OpenAI API key directly in the notebook is not secure[^1]. It's recommended to load it from an environment variable or use a secure method like getpass to prompt the user for input at runtime.
Consider adding a check for the environment variable first and only prompting if it's not set.
import os
from getpass import getpass
if "OPENAI_API_KEY" not in os.environ:
os.environ["OPENAI_API_KEY"] = getpass("Enter your OpenAI API key: ")
| "def ask_enrollment_agent(query, submitted=None, required=None):\n", | ||
| " if submitted and required:\n", | ||
| " prompt = (\n", | ||
| " f\"Applicant submitted documents: {submitted}\\n\"\n", | ||
| " f\"Required documents: {required}\\n\"\n", | ||
| " f\"{query}\\n\"\n", | ||
| " \"List any missing documents and provide guidance.\"\n", | ||
| " )\n", | ||
| " return enrollment_agent.start(prompt)\n", | ||
| " else:\n", | ||
| " return enrollment_agent.start(query)\n", |
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.
The ask_enrollment_agent function is vulnerable to prompt injection because the query is directly concatenated into the prompt[^1]. Additionally, it doesn't handle cases where only one of submitted or required is provided, leading to incorrect behavior.
Refactor the function to validate arguments and use a structured prompt to mitigate these issues.
def ask_enrollment_agent(query, submitted=None, required=None):
if (submitted is not None and required is None) or \
(submitted is None and required is not None):
raise ValueError("For document checking, both 'submitted' and 'required' arguments must be provided.")
if submitted is not None and required is not None:
# Using a structured prompt to reduce injection risk
prompt = (
"You are checking for missing documents for a university application.\n"
f"Applicant submitted documents: {submitted}\n"
f"All required documents: {required}\n\n"
f"User query: '''{query}'''\n\n"
"Based on the information above, list any missing documents and provide guidance."
)
return enrollment_agent.start(prompt)
else:
return enrollment_agent.start(query)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #741 +/- ##
=======================================
Coverage 14.23% 14.23%
=======================================
Files 25 25
Lines 2571 2571
Branches 367 367
=======================================
Hits 366 366
Misses 2189 2189
Partials 16 16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
User description
This agent intelligently researches travel destinations and generates personalized itineraries using advanced language models.
It combines web search, cost estimation, and user preferences to deliver high-quality, actionable travel plans.
Ideal for users seeking automated, data-driven travel recommendations and planning assistance.
PR Type
Other
Description
Add AI Enrollment Counselor notebook for university admissions
Add Intelligent Travel Planning Agent notebook for travel automation
Both notebooks demonstrate PraisonAI agent implementations
Changes diagram
Changes walkthrough 📝
AI_Enrollment_Counselor.ipynb
AI Enrollment Counselor notebook implementationexamples/cookbooks/AI_Enrollment_Counselor.ipynb
intelligent_travel_planning_agent.ipynb
Intelligent Travel Planning Agent notebookexamples/cookbooks/intelligent_travel_planning_agent.ipynb
Summary by CodeRabbit