Skip to content

Commit

Permalink
Add New Optional Parameters to AssistantRequest Struct (#795)
Browse files Browse the repository at this point in the history
* Add more parameters to support Assistant v2

* Add goimports
  • Loading branch information
Vanessamae23 authored Jul 19, 2024
1 parent a7e9f0e commit 966ee68
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions assistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 966ee68

Please sign in to comment.