Skip to content
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

refactor(cody): add input schema support to CodyTool #6786

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abeatrix
Copy link
Contributor

This change adds support for input schemas to the CodyTool class. The input schema is defined in the CodyToolConfig and is used to generate the prompt instruction for the tool matching the pattern used by MCP. This allows for more structured and validated input from the user.

The changes include:

  • Adding an input_schema property to the CodyToolConfig interface
  • Updating the getInstruction() method in CodyTool to handle the input schema
  • Updating the default tool configurations to include input schemas
  • Updating the CodyToolProvider and CodyToolProvider.test.ts to handle the new ToolConfiguration interface

Test plan

Test Agentic Chat

This change adds support for input schemas to the CodyTool class. The input schema is defined in the CodyToolConfig and is used to generate the prompt instruction for the tool matching the pattern used by MCP. This allows for more structured and validated input from the user.

The changes include:

- Adding an `input_schema` property to the CodyToolConfig interface
- Updating the `getInstruction()` method in CodyTool to handle the input schema
- Updating the default tool configurations to include input schemas
- Updating the CodyToolProvider and CodyToolProvider.test.ts to handle the new ToolConfiguration interface
Copy link

‼️ Hey @sourcegraph/cody-security, please review this PR carefully as it introduces the usage of an unsafe_ function or abuses PromptString.

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.

1 participant