From 21f32cf1e25dcd204e3a595c97c7c821cd622f4d Mon Sep 17 00:00:00 2001 From: MadeEasy Date: Thu, 18 Jul 2024 21:01:49 +0800 Subject: [PATCH 1/2] Add more parameters to support Assistant v2 --- assistant.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assistant.go b/assistant.go index cc13a3020..b9f9cb421 100644 --- a/assistant.go +++ b/assistant.go @@ -70,6 +70,9 @@ type AssistantRequest struct { FileIDs []string `json:"file_ids,omitempty"` Metadata map[string]any `json:"metadata,omitempty"` ToolResources *AssistantToolResource `json:"tool_resources,omitempty"` + ResponseFormat any `json:"response_format,omitempty"` + Temperature *float32 `json:"temperature,omitempty"` + TopP *float32 `json:"top_p,omitempty"` } // MarshalJSON provides a custom marshaller for the assistant request to handle the API use cases From 8a05028997ec96e86cf69d8920ac8d60b23a482a Mon Sep 17 00:00:00 2001 From: MadeEasy Date: Thu, 18 Jul 2024 21:25:25 +0800 Subject: [PATCH 2/2] Add goimports --- assistant.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/assistant.go b/assistant.go index b9f9cb421..4c89c1b2f 100644 --- a/assistant.go +++ b/assistant.go @@ -62,17 +62,17 @@ type AssistantToolResource struct { // If Tools is empty slice it will effectively delete all of the Assistant's tools. // If Tools is populated, it will replace all of the existing Assistant's tools with the provided tools. type AssistantRequest struct { - Model string `json:"model"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - Instructions *string `json:"instructions,omitempty"` - Tools []AssistantTool `json:"-"` - FileIDs []string `json:"file_ids,omitempty"` - Metadata map[string]any `json:"metadata,omitempty"` - ToolResources *AssistantToolResource `json:"tool_resources,omitempty"` - ResponseFormat any `json:"response_format,omitempty"` - Temperature *float32 `json:"temperature,omitempty"` - TopP *float32 `json:"top_p,omitempty"` + Model string `json:"model"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Instructions *string `json:"instructions,omitempty"` + Tools []AssistantTool `json:"-"` + FileIDs []string `json:"file_ids,omitempty"` + Metadata map[string]any `json:"metadata,omitempty"` + ToolResources *AssistantToolResource `json:"tool_resources,omitempty"` + ResponseFormat any `json:"response_format,omitempty"` + Temperature *float32 `json:"temperature,omitempty"` + TopP *float32 `json:"top_p,omitempty"` } // MarshalJSON provides a custom marshaller for the assistant request to handle the API use cases