Skip to content

Commit 937d277

Browse files
authored
updates from spec (#142)
* latest spec * fix doc comments from spec
1 parent ecf3640 commit 937d277

File tree

4 files changed

+118
-86
lines changed

4 files changed

+118
-86
lines changed

async-openai/src/types/assistants/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use super::AssistantTools;
1212
pub struct RunObject {
1313
/// The identifier, which can be referenced in API endpoints.
1414
pub id: String,
15-
/// The object type, which is always `assistant.run`.
15+
/// The object type, which is always `thread.run`.
1616
pub object: String,
1717
/// The Unix timestamp (in seconds) for when the run was created.
1818
pub created_at: i32,

async-openai/src/types/assistants/step.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub enum RunStepType {
1616
pub struct RunStepObject {
1717
/// The identifier, which can be referenced in API endpoints.
1818
pub id: String,
19-
/// The object type, which is always `assistant.run.step`.
19+
/// The object type, which is always `thread.run.step`.
2020
pub object: String,
2121
/// The Unix timestamp (in seconds) for when the run step was created.
2222
pub created_at: i32,
@@ -33,7 +33,7 @@ pub struct RunStepObject {
3333
/// The type of run step, which can be either `message_creation` or `tool_calls`.
3434
pub r#type: RunStepType,
3535

36-
/// The status of the run, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
36+
/// The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`.
3737
pub status: RunStatus,
3838

3939
/// The details of the run step.

async-openai/src/types/types.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,11 @@ pub struct CreateChatCompletionRequest {
14101410
#[serde(skip_serializing_if = "Option::is_none")]
14111411
pub presence_penalty: Option<f32>, // min: -2.0, max: 2.0, default 0
14121412

1413-
/// An object specifying the format that the model must output. Used to enable JSON mode.
1413+
/// An object specifying the format that the model must output.
1414+
///
1415+
/// Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON.
1416+
///
1417+
/// **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in increased latency and appearance of a "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.
14141418
#[serde(skip_serializing_if = "Option::is_none")]
14151419
pub response_format: Option<ChatCompletionResponseFormat>,
14161420

@@ -1575,6 +1579,9 @@ pub struct CreateChatCompletionStreamResponse {
15751579
pub created: u32,
15761580
/// The model to generate the completion.
15771581
pub model: String,
1582+
/// This fingerprint represents the backend configuration that the model runs with.
1583+
/// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
1584+
pub system_fingerprint: Option<String>,
15781585
/// The object type, which is always `chat.completion.chunk`.
15791586
pub object: String,
15801587
}

0 commit comments

Comments
 (0)