Unverified Commit 0e55e821 authored by Michael Feil's avatar Michael Feil Committed by GitHub
Browse files

fix: tool call validation and stop words. (#5504)


Signed-off-by: default avatarMichael Feil <63565275+michaelfeil@users.noreply.github.com>
parent d56439ec
......@@ -104,7 +104,7 @@ pub struct AssistantObject {
pub model: String,
/// The system instructions that the assistant uses. The maximum length is 256,000 characters.
pub instructions: Option<String>,
/// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
/// A list of tool enabled on the assistant. There can be a maximum of 1536 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
#[serde(default)]
pub tools: Vec<AssistantTools>,
/// A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
......@@ -211,7 +211,7 @@ pub struct CreateAssistantRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
/// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
/// A list of tool enabled on the assistant. There can be a maximum of 1536 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
#[serde(skip_serializing_if = "Option::is_none")]
pub tools: Option<Vec<AssistantTools>>,
......@@ -260,7 +260,7 @@ pub struct ModifyAssistantRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
/// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
/// A list of tool enabled on the assistant. There can be a maximum of 1536 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
#[serde(skip_serializing_if = "Option::is_none")]
pub tools: Option<Vec<AssistantTools>>,
......
......@@ -967,7 +967,7 @@ pub struct CreateChatCompletionRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub service_tier: Option<ServiceTier>,
/// Up to 4 sequences where the API will stop generating further tokens.
/// Up to 32 sequences where the API will stop generating further tokens.
#[serde(skip_serializing_if = "Option::is_none")]
pub stop: Option<Stop>,
......
......@@ -162,7 +162,7 @@ pub struct CreateCompletionRequest {
#[serde(default, deserialize_with = "deserialize_echo_bool")]
pub echo: Option<bool>,
/// Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
/// Up to 32 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
#[serde(skip_serializing_if = "Option::is_none")]
pub stop: Option<Stop>,
......
......@@ -81,13 +81,13 @@ pub const MAX_BEST_OF: u8 = 20;
/// Allowed range of values for `best_of`
pub const BEST_OF_RANGE: (u8, u8) = (MIN_BEST_OF, MAX_BEST_OF);
/// Maximum allowed number of stop sequences
pub const MAX_STOP_SEQUENCES: usize = 4;
/// Maximum allowed number of tools
pub const MAX_TOOLS: usize = 128;
/// Maximum allowed number of stop sequences.
pub const MAX_STOP_SEQUENCES: usize = 32;
/// Maximum allowed number of tools.
pub const MAX_TOOLS: usize = 1536;
// Metadata validation constants removed - we are no longer restricting the metadata field char limits
/// Maximum allowed length for function names
pub const MAX_FUNCTION_NAME_LENGTH: usize = 64;
pub const MAX_FUNCTION_NAME_LENGTH: usize = 96;
/// Minimum allowed value for `repetition_penalty`
pub const MIN_REPETITION_PENALTY: f32 = 0.0;
/// Maximum allowed value for `repetition_penalty`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment