From 966ee682b11ca580c2c2c3ac067c27b51bd6d749 Mon Sep 17 00:00:00 2001 From: VanessaMae23 <60029664+Vanessamae23@users.noreply.github.com> Date: Fri, 19 Jul 2024 22:18:16 +0800 Subject: [PATCH] Add New Optional Parameters to `AssistantRequest` Struct (#795) * Add more parameters to support Assistant v2 * Add goimports --- assistant.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/assistant.go b/assistant.go index cc13a3020..4c89c1b2f 100644 --- a/assistant.go +++ b/assistant.go @@ -62,14 +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"` + 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