You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request introduces significant enhancements to the Hermes
server and its client interactions, focusing on adding sampling request
capabilities, improving error handling, and extending interactivity in
the Mix commands. Below is a categorized summary of the most important
changes:
### Sampling Request Support
* Added a new callback `handle_sampling_response/3` to process responses
from sampling requests, including detailed documentation and examples
(`lib/hermes/server.ex`).
* Implemented `send_sampling_request/3` for asynchronously sending
sampling requests to clients, supporting options like `system_prompt`
and `max_tokens` (`lib/hermes/server.ex`).
* Introduced helper functions in `Hermes.Server.Base` to manage sampling
requests, including timeout handling, validation of client capabilities,
and response/error processing (`lib/hermes/server/base.ex`).
[[1]](diffhunk://#diff-1146a134b004c3f80ca5063ac01c480f7a3364c39d4ce152f102e24db0f18673R867-R1026)
[[2]](diffhunk://#diff-1146a134b004c3f80ca5063ac01c480f7a3364c39d4ce152f102e24db0f18673R229-R248)
[[3]](diffhunk://#diff-1146a134b004c3f80ca5063ac01c480f7a3364c39d4ce152f102e24db0f18673R317-R325)
### Server State and Error Handling
* Updated the server state structure to include `server_requests` for
tracking active sampling requests (`lib/hermes/server/base.ex`).
[[1]](diffhunk://#diff-1146a134b004c3f80ca5063ac01c480f7a3364c39d4ce152f102e24db0f18673L34-R43)
[[2]](diffhunk://#diff-1146a134b004c3f80ca5063ac01c480f7a3364c39d4ce152f102e24db0f18673L124-R134)
* Added robust error handling for invalid requests and unexpected
responses, improving server resilience (`lib/hermes/server/base.ex`).
[[1]](diffhunk://#diff-1146a134b004c3f80ca5063ac01c480f7a3364c39d4ce152f102e24db0f18673R397-R405)
[[2]](diffhunk://#diff-1146a134b004c3f80ca5063ac01c480f7a3364c39d4ce152f102e24db0f18673R229-R248)
### Mix Command Enhancements
* Enhanced `call_tool` and `get_prompt` commands to accept arguments in
JSON or file paths, providing greater flexibility
(`lib/mix/interactive/commands.ex`).
[[1]](diffhunk://#diff-f3574853ac8b62e805132df55e7d657b6617d3faa4443a69f8aadf584e4667faL96-R128)
[[2]](diffhunk://#diff-f3574853ac8b62e805132df55e7d657b6617d3faa4443a69f8aadf584e4667faL146-R190)
* Introduced support for custom timeouts in all server-interacting
commands, improving usability for long-running operations
(`lib/mix/interactive/commands.ex`).
[[1]](diffhunk://#diff-f3574853ac8b62e805132df55e7d657b6617d3faa4443a69f8aadf584e4667faR74-R90)
[[2]](diffhunk://#diff-f3574853ac8b62e805132df55e7d657b6617d3faa4443a69f8aadf584e4667faR143-R145)
### Workflow Adjustment
* Simplified the test execution command in the CI workflow by removing
the `--trace` flag, potentially improving test performance
(`.github/workflows/ci.yml`).
### Miscellaneous Improvements
* Added a new alias `Hermes.MCP.ID` in `Hermes.Server.Base` for
generating request IDs, streamlining request tracking
(`lib/hermes/server/base.ex`).
* Updated the transport layer to support routing responses and errors to
the appropriate server handlers
(`lib/hermes/server/transport/streamable_http.ex`).
0 commit comments