Skip to content

v0.3.0

Choose a tag to compare

@danielkov danielkov released this 17 Apr 23:19
· 88 commits to main since this release

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

  • HttpClient trait + Http handle for abstracting HTTP execution
  • Ergonomic HttpRequestBuilder / HttpResponse (JSON bodies, header helpers, streaming)
  • Default reqwest-client feature provides impl HttpClient for reqwest::Client
  • Optional reqwest-middleware-client feature for reqwest-middleware pipelines (retry, auth, tracing layers)

Completions adapter & providers

  • CompletionsAdapter now owns an Http instead of a reqwest::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

  • SseTransportConfig and StreamableHttpTransportConfig now take a pre-configured Http rather 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

  • CompletionsProvider trait (affects anyone implementing a custom provider):
    • preprocess_request: reqwest::RequestBuilderagentkit_http::HttpRequestBuilder
    • preprocess_response: reqwest::StatusCodeagentkit_http::StatusCode
  • CompletionsAdapter::with_client now takes agentkit_http::Http instead of reqwest::Client. Wrap existing clients with Http::new(client).
  • CompletionsError::HttpClient now wraps agentkit_http::HttpError instead of reqwest::Error.
  • SseTransportConfig / StreamableHttpTransportConfig: with_header(key, value) removed. Configure auth/custom headers on a reqwest::ClientBuilder::default_headers(...) (or any HttpClient impl) and pass it via with_client(Http::new(client)). See the mcp-dynamic-auth example.

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