v0.3.0
Highlights
This release introduces a pluggable HTTP transport layer (agentkit-http) and refactors the completions adapter and MCP transports to use it. The motivating use case is being able to compose middleware (retries, auth refresh, tracing) uniformly across providers and MCP, without each crate owning a reqwest::Client.
What's Changed
New agentkit-http crate
HttpClienttrait +Httphandle for abstracting HTTP execution- Ergonomic
HttpRequestBuilder/HttpResponse(JSON bodies, header helpers, streaming) - Default
reqwest-clientfeature providesimpl HttpClient for reqwest::Client - Optional
reqwest-middleware-clientfeature forreqwest-middlewarepipelines (retry, auth, tracing layers)
Completions adapter & providers
CompletionsAdapternow owns anHttpinstead of areqwest::Client- Provider adapters (
openai,groq,mistral,ollama,openrouter,vllm) updated to the new trait surface; their public constructors (OpenAIProvider::new(api_key)etc.) are unchanged
MCP transports
SseTransportConfigandStreamableHttpTransportConfignow take a pre-configuredHttprather than carrying a header list- Default transport still builds a reqwest-backed client automatically when no client is supplied
New example: mcp-dynamic-auth
End-to-end demo of refreshing a bearer token per request via reqwest-middleware, validated against an in-process MCP mock endpoint.
Breaking changes
CompletionsProvidertrait (affects anyone implementing a custom provider):preprocess_request:reqwest::RequestBuilder→agentkit_http::HttpRequestBuilderpreprocess_response:reqwest::StatusCode→agentkit_http::StatusCode
CompletionsAdapter::with_clientnow takesagentkit_http::Httpinstead ofreqwest::Client. Wrap existing clients withHttp::new(client).CompletionsError::HttpClientnow wrapsagentkit_http::HttpErrorinstead ofreqwest::Error.SseTransportConfig/StreamableHttpTransportConfig:with_header(key, value)removed. Configure auth/custom headers on areqwest::ClientBuilder::default_headers(...)(or anyHttpClientimpl) and pass it viawith_client(Http::new(client)). See themcp-dynamic-authexample.
Commits
- feat: abstract http + reqwest by default (4119cb6)
- feat(http): add reqwest_middleware client (46a58f5)
- chore: release 0.3.0 (b668ec8)
Full Changelog: v0.2.3...v0.3.0