-
Notifications
You must be signed in to change notification settings - Fork 1
Prompts #13
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
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.
Pull Request Overview
This pull request introduces prompt management capabilities to the Vancouver framework, adding modules to define, list, and execute prompts as well as integrating these changes into the dispatch logic and server initialization.
- Added a dedicated Prompts module that defines prompt behavior and helper functions for sending responses.
- Introduced PromptsList and PromptsGet modules to handle fetching prompt definitions and executing prompt actions respectively.
- Updated existing modules (Initialize, Tool, Dispatch) to integrate the new prompt functionality into the overall framework.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
test/vancouver/methods/prompts_list_test.exs | Added unit tests to verify the correct behavior when returning an empty prompt list. |
lib/vancouver/tool.ex | Updated documentation and removed the unused validate_arguments function while adding new response helpers. |
lib/vancouver/prompt.ex | Introduced a new module for prompt definitions including callback specifications and response helpers. |
lib/vancouver/plugs/dispatch.ex | Updated dispatch logic to route prompt-related methods. |
lib/vancouver/methods/prompts_list.ex | Implements listing of prompt definitions. |
lib/vancouver/methods/prompts_get.ex | Implements prompt resolution and execution with argument validation. |
lib/vancouver/methods/initialize.ex | Updated server initialization to include prompts in the capabilities. |
Comments suppressed due to low confidence (1)
lib/vancouver/tool.ex:33
- The module documentation lists send_audio/3, send_image/3, and send_text/2, but their implementations accept an optional options parameter (making their effective arity send_audio/4, send_image/4, and send_text/3). Consider updating the docs to clearly indicate the optional parameter for better clarity.
- - `send_audio/3` - sends an audio response
This pull request introduces a new feature for managing "prompts" in the Vancouver framework, including their definition, execution, and integration into existing methods. It also adds helper functions for sending various types of responses and updates the dispatch logic to support prompt-related operations.
New Prompt Management Feature:
lib/vancouver/prompt.ex
: Introduced theVancouver.Prompt
module, which defines the structure and behavior for prompts. It includes callbacks for defining prompts (name
,description
,arguments
), executing them (run
), and helper functions for sending responses (e.g.,send_text
,send_audio
,send_image
).Integration of Prompt Methods:
lib/vancouver/methods/prompts_get.ex
: Added theVancouver.Methods.PromptsGet
module to handle fetching and executing specific prompts based on their name and arguments. Includes validation logic for prompt arguments.lib/vancouver/methods/prompts_list.ex
: Added theVancouver.Methods.PromptsList
module to list all available prompt definitions.lib/vancouver/plugs/dispatch.ex
: Updated the dispatch logic to routeprompts/list
andprompts/get
methods to their respective modules.Updates to Existing Modules:
lib/vancouver/methods/initialize.ex
: Modified theInitialize
method to include "prompts" in the server's capabilities.lib/vancouver/tool.ex
: Removedvalidate_arguments
method and added documentation for new response types (send_audio
,send_image
). [1] [2]Test Coverage:
test/vancouver/methods/prompts_list_test.exs
: Added unit tests for thePromptsList
method to verify it correctly handles empty prompt lists.