pub enum BuildError {
UnsupportedPart {
role: ItemKind,
part_kind: PartKindName,
},
InvalidToolName(String),
SchemaViolation(String),
PredictionConflicts(&'static str),
OutOfRange {
field: &'static str,
message: String,
},
MissingEnv(&'static str),
TopLogprobsWithoutLogprobs,
Serialize(Error),
}Expand description
Errors produced while assembling a Cerebras chat-completions request body.
Variants§
UnsupportedPart
Transcript contained a content part the Cerebras API cannot accept for
the given role (e.g. a raw Custom part on a user message).
Fields
§
part_kind: PartKindNameKind of the offending part.
InvalidToolName(String)
Tool name failed the Cerebras name regex (^[a-zA-Z0-9_-]{1,64}$).
SchemaViolation(String)
JSON-Schema passed to OutputFormat::JsonSchema violated a documented
Cerebras constraint (e.g. pattern, $ref outside $defs, nest depth).
PredictionConflicts(&'static str)
prediction was set together with an incompatible parameter.
OutOfRange
A field fell outside the documented valid range.
Fields
MissingEnv(&'static str)
from_env() could not locate a required variable.
TopLogprobsWithoutLogprobs
top_logprobs was set without logprobs: true.
Serialize(Error)
Generic JSON serialization failure.
Trait Implementations§
Source§impl Debug for BuildError
impl Debug for BuildError
Source§impl Display for BuildError
impl Display for BuildError
Source§impl Error for BuildError
impl Error for BuildError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<BuildError> for CerebrasError
impl From<BuildError> for CerebrasError
Source§fn from(source: BuildError) -> Self
fn from(source: BuildError) -> Self
Converts to this type from the input type.
Source§impl From<BuildError> for LoopError
impl From<BuildError> for LoopError
Source§fn from(error: BuildError) -> Self
fn from(error: BuildError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for BuildError
impl !UnwindSafe for BuildError
impl Freeze for BuildError
impl Send for BuildError
impl Sync for BuildError
impl Unpin for BuildError
impl UnsafeUnpin for BuildError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.