@@ -14,16 +14,17 @@ const (
1414)
1515
1616type Assistant struct {
17- ID string `json:"id"`
18- Object string `json:"object"`
19- CreatedAt int64 `json:"created_at"`
20- Name * string `json:"name,omitempty"`
21- Description * string `json:"description,omitempty"`
22- Model string `json:"model"`
23- Instructions * string `json:"instructions,omitempty"`
24- Tools []AssistantTool `json:"tools"`
25- FileIDs []string `json:"file_ids,omitempty"`
26- Metadata map [string ]any `json:"metadata,omitempty"`
17+ ID string `json:"id"`
18+ Object string `json:"object"`
19+ CreatedAt int64 `json:"created_at"`
20+ Name * string `json:"name,omitempty"`
21+ Description * string `json:"description,omitempty"`
22+ Model string `json:"model"`
23+ Instructions * string `json:"instructions,omitempty"`
24+ Tools []AssistantTool `json:"tools"`
25+ FileIDs []string `json:"file_ids,omitempty"`
26+ Metadata map [string ]any `json:"metadata,omitempty"`
27+ ToolResources * AssistantToolResource `json:"tool_resources,omitempty"`
2728
2829 httpHeader
2930}
@@ -34,26 +35,41 @@ const (
3435 AssistantToolTypeCodeInterpreter AssistantToolType = "code_interpreter"
3536 AssistantToolTypeRetrieval AssistantToolType = "retrieval"
3637 AssistantToolTypeFunction AssistantToolType = "function"
38+ AssistantToolTypeFileSearch AssistantToolType = "file_search"
3739)
3840
3941type AssistantTool struct {
4042 Type AssistantToolType `json:"type"`
4143 Function * FunctionDefinition `json:"function,omitempty"`
4244}
4345
46+ type AssistantToolFileSearch struct {
47+ VectorStoreIDs []string `json:"vector_store_ids"`
48+ }
49+
50+ type AssistantToolCodeInterpreter struct {
51+ FileIDs []string `json:"file_ids"`
52+ }
53+
54+ type AssistantToolResource struct {
55+ FileSearch * AssistantToolFileSearch `json:"file_search,omitempty"`
56+ CodeInterpreter * AssistantToolCodeInterpreter `json:"code_interpreter,omitempty"`
57+ }
58+
4459// AssistantRequest provides the assistant request parameters.
4560// When modifying the tools the API functions as the following:
4661// If Tools is undefined, no changes are made to the Assistant's tools.
4762// If Tools is empty slice it will effectively delete all of the Assistant's tools.
4863// If Tools is populated, it will replace all of the existing Assistant's tools with the provided tools.
4964type AssistantRequest struct {
50- Model string `json:"model"`
51- Name * string `json:"name,omitempty"`
52- Description * string `json:"description,omitempty"`
53- Instructions * string `json:"instructions,omitempty"`
54- Tools []AssistantTool `json:"-"`
55- FileIDs []string `json:"file_ids,omitempty"`
56- Metadata map [string ]any `json:"metadata,omitempty"`
65+ Model string `json:"model"`
66+ Name * string `json:"name,omitempty"`
67+ Description * string `json:"description,omitempty"`
68+ Instructions * string `json:"instructions,omitempty"`
69+ Tools []AssistantTool `json:"-"`
70+ FileIDs []string `json:"file_ids,omitempty"`
71+ Metadata map [string ]any `json:"metadata,omitempty"`
72+ ToolResources * AssistantToolResource `json:"tool_resources,omitempty"`
5773}
5874
5975// MarshalJSON provides a custom marshaller for the assistant request to handle the API use cases
0 commit comments