-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Expand tool registration documentation and examples #403
Conversation
- Added comprehensive TypeScript documentation for tool registration methods in `docs/js/typescript.mdx` - Created new README example file `examples/README-tool-examples.md` with detailed tool registration approaches - Updated example scripts to demonstrate direct function tool registration - Refined agent tool registration logic to support multiple function registration styles - Bumped package version to 1.0.19
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.
Hello @MervinPraison, 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!
Summary of Changes
This pull request focuses on expanding the documentation and examples for tool registration within the PraisonAI TypeScript framework. It introduces comprehensive TypeScript documentation for tool registration methods, a new README example file with detailed tool registration approaches, updates to example scripts to demonstrate direct function tool registration, and refines agent tool registration logic to support multiple function registration styles. Additionally, the package version is bumped to 1.0.19.
Highlights
- Documentation: Added comprehensive TypeScript documentation for tool registration methods in
docs/js/typescript.mdx
, including examples for single agent tool calls and direct function tools. - Examples: Created a new README example file
examples/README-tool-examples.md
that provides detailed examples of different tool registration approaches, including using thetools
array with function objects, thetoolFunctions
object, and pre-defined tool definitions. - Direct Function Registration: Updated example scripts and refined agent tool registration logic to support direct function tool registration, allowing functions to be registered directly as tools without needing to be made globally available.
- Package Version: Bumped the package version to 1.0.19.
Changelog
Click here to see the changelog
- docs/js/typescript.mdx
- Added a new section with comprehensive examples for tool calls, including single agent tool call and direct function tools.
- Demonstrates how to create agents with tool calling capabilities and directly registered function tools.
- src/praisonai-ts/examples/README-tool-examples.md
- Created a new file to demonstrate different ways to register tool functions in PraisonAI.
- Provides examples for using the
tools
array with function objects, thetoolFunctions
object, and pre-defined tool definitions. - Includes a combined approach example to showcase mixing different registration methods.
- src/praisonai-ts/examples/simple/direct-function-tools.ts
- Updated the example to register functions directly as an array in the
tools
option instead of using thetoolFunctions
object. - Simplified the agent configuration by directly passing the functions in the
tools
array.
- Updated the example to register functions directly as an array in the
- src/praisonai-ts/package.json
- Bumped the package version from 1.0.18 to 1.0.19.
- src/praisonai-ts/src/agent/simple.ts
- Modified the
tools
property in theSimpleAgentConfig
interface to accept an array ofany
orFunction
types. - Updated the agent initialization logic to process the
tools
array, handling both tool definitions and functions. - Added logic to automatically generate tool definitions for functions passed in the
tools
array, including generating a random name for functions without names. - Ensured that function names are valid and auto-generated if necessary.
- Added debug logging for auto-generated tool definitions.
- Refactored to use function names or generate names if not provided.
- Modified the
- src/praisonai-ts/src/llm/openai.ts
- Added a check to ensure the function name is valid and generate a random name if it's missing or empty.
- Modified the
convertToOpenAITool
function to generate a valid function name if none is provided. - Added a default description for tools if none is provided.
- src/praisonai-ts/tests/development/simple/direct-function-tools.ts
- Updated the test example to register functions directly as an array in the
tools
option instead of using thetoolFunctions
object. - Simplified the agent configuration by directly passing the functions in the
tools
array.
- Updated the test example to register functions directly as an array in the
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.
In realms of code, where agents roam,
A tool's true worth is in its home.
Register it well, with docs so clear,
And watch your agent conquer fear.
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. ↩
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
The pull request enhances the documentation and examples for tool registration in PraisonAI, providing comprehensive TypeScript documentation, new README examples, and refined agent tool registration logic. The changes aim to clarify and simplify the process of registering tools for agents, supporting multiple function registration styles. Overall, the changes are well-structured and contribute positively to the usability of the framework.
Merge Readiness
The pull request is well-structured and provides valuable enhancements to the documentation and examples for tool registration in PraisonAI. The changes clarify and simplify the process of registering tools for agents, supporting multiple function registration styles. Given the thoroughness of the changes and the absence of any critical or high severity issues, the pull request is in good shape to be merged, but please have others review and approve this code before merging. I am unable to directly approve the pull request.
✅ Deploy Preview for praisonai ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
docs/js/typescript.mdx
examples/README-tool-examples.md
with detailed tool registration approaches