1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! `af-llm` — unified async LLM access for the Agent Factory platform.
//!
//! Provider-neutral model transport and request types. Provides:
//!
//! - [`LlmClient`] — async chat completions against any OpenAI-compatible
//! endpoint, with a hard per-request timeout and a shared
//! [`CircuitBreaker`].
//! - Strongly-typed request/response models ([`CompletionRequest`],
//! [`CompletionResponse`], [`ChatMessage`], [`Tool`], …) — the Pydantic
//! equivalent, validated at the wire boundary.
//! - [`parse_json`] — pull structured output out of fenced LLM text into any
//! `serde` type.
//!
//! # Example
//!
//! ```no_run
//! use af_llm::{LlmClient, LlmConfig, CompletionRequest, ChatMessage};
//!
//! # async fn run() -> af_llm::Result<()> {
//! let client = LlmClient::new(LlmConfig::new("http://localhost:4000/v1", ""))?;
//! let req = CompletionRequest::new(
//! "deepseek/deepseek-chat",
//! vec![ChatMessage::user("Say hi in one word.")],
//! );
//! let resp = client.complete_stream_single_attempt(&req, |_, _| {}).await?;
//! println!("{:?}", resp.first_content());
//! # Ok(())
//! # }
//! ```
/// Governed binary resource resolution at the provider boundary.
pub use ;
pub use ;
pub use ;
pub use ;
pub use StreamDelta;
pub use ;