Skip to content

Conversation

@YueTwo
Copy link
Contributor

@YueTwo YueTwo commented Jul 4, 2025

Key improvements:

  • Converted single tool example to multi-tool demonstration
    • switched to an open model which is able to achieve expected output
    • updated task description to showcase multiple tool capabilities
  • Modified the system prompt
    • ensured a more stable performance

Note: Upgrading to paid premium models can deliver more stable performance, and the current free open model is sensitive to the prompt.

Comparison of runtime results:

  • Before improvement:
    ea7c63c705b6aba4b6602a82dcd147d
    image
    OR
    cad5930087e8c1cf288017e65fdfe56
  • After improvement:
    5cce516f12f9213e79cda4e76fefe94
    fafcd6091f35faedd6a28f3b983d4a5
    ...
    68822929940b14ee072ece60a6537c7
    f8f3ce54b6f1c3b358ccc00ea473164

Summary by CodeRabbit

  • New Features
    • Enhanced initial instructions to include starring a specific GitHub repository after searching for information.
  • Improvements
    • Clarified prompt instructions for function usage and tool list management.
    • Updated chat completion model to a newer version for improved performance.

@coderabbitai
Copy link

coderabbitai bot commented Jul 4, 2025

Walkthrough

The script for an agent using dynamic tool discovery was updated to clarify prompt instructions, switch the Mistral chat model from "large" to "medium", and add a new user task involving starring a GitHub repository after performing a web search.

Changes

File(s) Change Summary
examples/mistral/agent_with_dynamic_tool_discovery_pattern_1.py Updated prompt for clarity, changed model to "mistral-medium-latest", and added a new user instruction.

Possibly related PRs

  • Added mistral #16: Refactored the same script by introducing initial prompt and model selection logic, which is directly refined in this PR.

Suggested reviewers

  • alex-aipolabs

Poem

A bunny hops through code so neat,
Tweaks the prompt and swaps the seat,
From large to medium, Mistral flows,
Now starring repos as it goes!
Discovery tools, instructions clear—
The agent’s smarter, give a cheer!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fffa0e2 and 2fb4717.

📒 Files selected for processing (1)
  • examples/mistral/agent_with_dynamic_tool_discovery_pattern_1.py (2 hunks)
🔇 Additional comments (3)
examples/mistral/agent_with_dynamic_tool_discovery_pattern_1.py (3)

25-26: LGTM! Improved prompt clarity for better LLM understanding.

The clarifications enhance the prompt by:

  • Specifying that ACI_SEARCH_FUNCTIONS takes the complete user input as a parameter
  • Correcting "appended" to "refreshed" which better describes the tools list management behavior

These changes should improve the LLM's understanding of how to use the meta function effectively.


45-45: Model downgrade aligns with PR objectives.

The change from "mistral-large-latest" to "mistral-medium-latest" supports the PR's goal of using a free open model. The enhanced prompt clarity should help compensate for any potential performance differences.

Consider monitoring the model's performance with the new multi-tool tasks to ensure it meets the expected output quality mentioned in the PR objectives.


53-53: Excellent multi-tool demonstration enhancement.

The extended user task effectively showcases the dynamic multi-tool capabilities by:

  • Combining web search (Brave) and GitHub operations in a single request
  • Creating a logical flow from information gathering to action execution
  • Demonstrating the agent's ability to chain multiple tools together

This aligns perfectly with the PR objective of converting from a single-tool to multi-tool demonstration.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@recurseml
Copy link

recurseml bot commented Jul 14, 2025

✨ No issues found! Your code is sparkling clean! ✨

Need help? Join our Discord for support!
https://discord.gg/qEjHQk64Z9

"ACI_SEARCH_FUNCTIONS"
"You can use ACI_SEARCH_FUNCTIONS to find relevant functions across all apps."
"Once you have identified the functions you need to use, you can append them to the tools list and use them in future tool calls."
"Taking complete user input as parameter value, you can use ACI_SEARCH_FUNCTIONS to find relevant functions across all apps."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Taking complete user input as parameter value, you can use ACI_SEARCH_FUNCTIONS to find relevant functions across all apps."
"Based on user intent, you can use ACI_SEARCH_FUNCTIONS to find relevant functions across all apps."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, Could you please check if the changes work as expected? I’ve updated the prompt to better handle complex queries involving multiple tools.
Previously, If just "based on the user query", the search tool didn’t always return all the necessary tools then the model will output "can't ……" as the ouput.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was because the model couldn’t generate suitable values for the search tool, so I updated the prompt to take the full user input as the parameter value.

"You can use ACI_SEARCH_FUNCTIONS to find relevant functions across all apps."
"Once you have identified the functions you need to use, you can append them to the tools list and use them in future tool calls."
"Taking complete user input as parameter value, you can use ACI_SEARCH_FUNCTIONS to find relevant functions across all apps."
"Once you have identified the functions you need to use, you can refresh the tools list and use them in future tool calls."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Once you have identified the functions you need to use, you can refresh the tools list and use them in future tool calls." this should not be part of the prompt, as it is orchestrated by you (dev) not the agent/LLM directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants