@@ -14,16 +14,17 @@ const (
14
14
)
15
15
16
16
type 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"`
27
28
28
29
httpHeader
29
30
}
@@ -34,26 +35,41 @@ const (
34
35
AssistantToolTypeCodeInterpreter AssistantToolType = "code_interpreter"
35
36
AssistantToolTypeRetrieval AssistantToolType = "retrieval"
36
37
AssistantToolTypeFunction AssistantToolType = "function"
38
+ AssistantToolTypeFileSearch AssistantToolType = "file_search"
37
39
)
38
40
39
41
type AssistantTool struct {
40
42
Type AssistantToolType `json:"type"`
41
43
Function * FunctionDefinition `json:"function,omitempty"`
42
44
}
43
45
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
+
44
59
// AssistantRequest provides the assistant request parameters.
45
60
// When modifying the tools the API functions as the following:
46
61
// If Tools is undefined, no changes are made to the Assistant's tools.
47
62
// If Tools is empty slice it will effectively delete all of the Assistant's tools.
48
63
// If Tools is populated, it will replace all of the existing Assistant's tools with the provided tools.
49
64
type 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"`
57
73
}
58
74
59
75
// MarshalJSON provides a custom marshaller for the assistant request to handle the API use cases
0 commit comments