pub struct Floopy { /* private fields */ }Expand description
The Floopy gateway client.
Wraps the official async_openai client (reachable via
Floopy::openai) and exposes typed Floopy-only resources. A Floopy
is cheap to clone (Arc internally) and safe to share across tasks.
Implementations§
Source§impl Floopy
impl Floopy
Sourcepub fn new(api_key: impl Into<String>) -> Result<Self>
pub fn new(api_key: impl Into<String>) -> Result<Self>
Construct a client with default settings. api_key is required
(starts with fl_).
§Errors
Returns crate::Error::Config if api_key is empty, or
crate::Error::Connection if the HTTP client cannot be built.
Sourcepub fn builder(api_key: impl Into<String>) -> FloopyBuilder
pub fn builder(api_key: impl Into<String>) -> FloopyBuilder
Start building a client. Chain setters then call
FloopyBuilder::build.
Sourcepub fn openai(&self) -> &OpenAIClient<OpenAIConfig>
pub fn openai(&self) -> &OpenAIClient<OpenAIConfig>
A lazily-built async_openai client pre-configured to talk to the
Floopy gateway. client.openai().chat() / .embeddings() /
.models() are 1:1 drop-in replacements for upstream async-openai.
§Panics
Panics only if the delegate cannot be constructed (invalid forwarded header); this is unreachable for headers the SDK itself produces.
Sourcepub fn experiments(&self) -> Experiments
pub fn experiments(&self) -> Experiments
Manage A/B routing experiments.
Sourcepub fn constraints(&self) -> Constraints
pub fn constraints(&self) -> Constraints
Read and full-replace org spend/rate constraints.
Sourcepub fn evaluations(&self) -> Evaluations
pub fn evaluations(&self) -> Evaluations
Run and inspect dataset evaluations.