pub struct EmbeddingBody {
pub model: EmbeddingModel,
pub input: EmbeddingInput,
pub dimensions: Option<EmbeddingDimensions>,
}Expand description
Request body for embeddings
Fields§
§model: EmbeddingModel嵌入模型:embedding-3 或 embedding-2
input: EmbeddingInput输入文本,支持字符串或字符串数组
dimensions: Option<EmbeddingDimensions>输出维度,Embedding-3 支持 256/512/1024/2048;Embedding-2 固定 1024(可不填)
Implementations§
Source§impl EmbeddingBody
impl EmbeddingBody
pub fn new(model: EmbeddingModel, input: EmbeddingInput) -> Self
pub fn with_dimensions(self, dims: EmbeddingDimensions) -> Self
Sourcepub fn validate_model_constraints(&self) -> Result<(), ValidationError>
pub fn validate_model_constraints(&self) -> Result<(), ValidationError>
Optional helper to enforce cross-field constraints at runtime. Call this before sending if you want strict validation.
Trait Implementations§
Source§impl Clone for EmbeddingBody
impl Clone for EmbeddingBody
Source§fn clone(&self) -> EmbeddingBody
fn clone(&self) -> EmbeddingBody
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbeddingBody
impl Debug for EmbeddingBody
Auto Trait Implementations§
impl Freeze for EmbeddingBody
impl RefUnwindSafe for EmbeddingBody
impl Send for EmbeddingBody
impl Sync for EmbeddingBody
impl Unpin for EmbeddingBody
impl UnsafeUnpin for EmbeddingBody
impl UnwindSafe for EmbeddingBody
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