pub struct TextBatchRequest {Show 13 fields
pub id: String,
pub model_id: ModelId,
pub system: Option<Instructions>,
pub prompt: Option<String>,
pub messages: Option<Vec<Message>>,
pub allow_system_in_messages: bool,
pub tools: ToolSet,
pub tool_choice: Option<ToolChoice>,
pub active_tools: Option<Vec<ToolName>>,
pub tool_order: Vec<ToolName>,
pub tools_context: Option<JsonValue>,
pub settings: CallSettings,
pub response_format: Option<ResponseFormat>,
}Expand description
A text generation request of a batch (the settings part of
generate_text, without callbacks or cancellation).
Fields§
§id: StringRequest id, unique within the batch.
model_id: ModelIdModel id at the provider.
system: Option<Instructions>System instructions.
prompt: Option<String>Single user prompt (exclusive with messages).
messages: Option<Vec<Message>>Conversation (exclusive with prompt).
allow_system_in_messages: boolWhether system messages may appear inside messages.
tools: ToolSetTools offered to the model (the batch provider cannot execute them).
tool_choice: Option<ToolChoice>Tool choice.
active_tools: Option<Vec<ToolName>>Tools sent to the model (all when None).
tool_order: Vec<ToolName>Tool order.
tools_context: Option<JsonValue>Shared tool context used to resolve dynamic descriptions.
settings: CallSettingsSampling settings and provider options.
response_format: Option<ResponseFormat>Response format.
Implementations§
Source§impl TextBatchRequest
impl TextBatchRequest
Sourcepub fn new(id: impl Into<String>, model_id: impl Into<ModelId>) -> Self
pub fn new(id: impl Into<String>, model_id: impl Into<ModelId>) -> Self
Creates a request for model_id.
Sourcepub fn system(self, system: impl Into<Instructions>) -> Self
pub fn system(self, system: impl Into<Instructions>) -> Self
Sets the system instructions.
Sourcepub fn messages(self, messages: impl IntoIterator<Item = Message>) -> Self
pub fn messages(self, messages: impl IntoIterator<Item = Message>) -> Self
Sets the conversation.
Sourcepub fn allow_system_in_messages(self, allow: bool) -> Self
pub fn allow_system_in_messages(self, allow: bool) -> Self
Allows system messages inside the conversation.
Sourcepub fn tool_choice(self, tool_choice: ToolChoice) -> Self
pub fn tool_choice(self, tool_choice: ToolChoice) -> Self
Sets the tool choice.
Sourcepub fn active_tools(
self,
active_tools: impl IntoIterator<Item = impl Into<ToolName>>,
) -> Self
pub fn active_tools( self, active_tools: impl IntoIterator<Item = impl Into<ToolName>>, ) -> Self
Restricts the tools sent to the model.
Sourcepub fn tool_order(
self,
tool_order: impl IntoIterator<Item = impl Into<ToolName>>,
) -> Self
pub fn tool_order( self, tool_order: impl IntoIterator<Item = impl Into<ToolName>>, ) -> Self
Sets the tool order.
Sourcepub fn tools_context(self, context: JsonValue) -> Self
pub fn tools_context(self, context: JsonValue) -> Self
Sets the shared tool context.
Sourcepub fn settings(self, settings: CallSettings) -> Self
pub fn settings(self, settings: CallSettings) -> Self
Sets the sampling settings and provider options.
Sourcepub fn response_format(self, response_format: ResponseFormat) -> Self
pub fn response_format(self, response_format: ResponseFormat) -> Self
Sets the response format.
Sourcepub fn provider_options(self, provider_options: ProviderOptions) -> Self
pub fn provider_options(self, provider_options: ProviderOptions) -> Self
Sets the provider options.
Trait Implementations§
Source§impl Clone for TextBatchRequest
impl Clone for TextBatchRequest
Source§fn clone(&self) -> TextBatchRequest
fn clone(&self) -> TextBatchRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more