#[non_exhaustive]pub enum OpenAIError {
Http(String),
Api(String),
Parse(String),
Config(String),
StreamInterrupted(String),
}Expand description
OpenAI error type
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http(String)
HTTP request error
Api(String)
API-returned error
Parse(String)
Response parse error
Config(String)
Configuration error (missing/malformed environment variables, etc.).
StreamInterrupted(String)
The SSE stream ended before a terminal marker ([DONE], or a chunk
carrying finish_reason) was observed — i.e. the connection dropped
mid-generation. A12: the partial text streamed so far is truncated and
must not be presented as a complete answer.
Trait Implementations§
Source§impl Debug for OpenAIError
impl Debug for OpenAIError
Source§impl Display for OpenAIError
impl Display for OpenAIError
Source§impl Error for OpenAIError
impl Error for OpenAIError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<OpenAIError> for ProviderError
impl From<OpenAIError> for ProviderError
Source§fn from(e: OpenAIError) -> Self
fn from(e: OpenAIError) -> Self
Source§impl From<OpenAIError> for LcelError
Allow OpenAIError to convert into LcelError for LCEL pipeline compatibility.
impl From<OpenAIError> for LcelError
Allow OpenAIError to convert into LcelError for LCEL pipeline compatibility.
OpenAIChat’s Runnable uses OpenAIError directly as its Error type; without the
bridge, OpenAIChat cannot enter a pipe() chain (which needs R2::Error: Into<LcelError>).
Qwen / DeepSeek go through OpenAI-compatible endpoints, but they wrap OpenAIError into
ProviderError and bridge from there, already covered by the impl above.