Skip to main content

Crate stringflow

Crate stringflow 

Source
Expand description

Flow strings through language models.

Provider-agnostic LLM client supporting multiple wire formats:

  • OpenAI Chat Completions (/v1/chat/completions)
  • OpenAI Responses (/v1/responses)
  • Anthropic Messages (/v1/messages)

A provider is just a base URL + wire format + auth config.

§Module structure

  • wire_formats/ — request/response types and parsing per format
  • providers/ — provider configurations (llama, openai, anthropic, etc.)
  • client — HTTP client (chat, streaming, health checks)

Re-exports§

pub use providers::AuthConfig;
pub use providers::ProviderConfig;

Modules§

providers
Provider configurations.

Structs§

ChatMessage
A chat message (role + content), shared across all wire formats
HealthResponse
Health check response from /health

Enums§

Error
StreamEvent
A streaming event from a chat response
WireFormat
Wire format for LLM API requests

Functions§

chat
Send a blocking chat request. Retries on transient errors with exponential backoff + jitter.
chat_async
Send an async chat request. Retries on transient errors with exponential backoff + jitter.
chat_stream
Send an async streaming chat request. Returns a stream of events.
health_check
Send an async health check
health_check_blocking
Send a blocking health check