Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.