@@ -11,7 +11,6 @@ import (
11
11
const (
12
12
assistantsSuffix = "/assistants"
13
13
assistantsFilesSuffix = "/files"
14
- openaiAssistantsV1 = "assistants=v1"
15
14
)
16
15
17
16
type Assistant struct {
@@ -116,7 +115,7 @@ type AssistantFilesList struct {
116
115
// CreateAssistant creates a new assistant.
117
116
func (c * Client ) CreateAssistant (ctx context.Context , request AssistantRequest ) (response Assistant , err error ) {
118
117
req , err := c .newRequest (ctx , http .MethodPost , c .fullURL (assistantsSuffix ), withBody (request ),
119
- withBetaAssistantV1 ( ))
118
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
120
119
if err != nil {
121
120
return
122
121
}
@@ -132,7 +131,7 @@ func (c *Client) RetrieveAssistant(
132
131
) (response Assistant , err error ) {
133
132
urlSuffix := fmt .Sprintf ("%s/%s" , assistantsSuffix , assistantID )
134
133
req , err := c .newRequest (ctx , http .MethodGet , c .fullURL (urlSuffix ),
135
- withBetaAssistantV1 ( ))
134
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
136
135
if err != nil {
137
136
return
138
137
}
@@ -149,7 +148,7 @@ func (c *Client) ModifyAssistant(
149
148
) (response Assistant , err error ) {
150
149
urlSuffix := fmt .Sprintf ("%s/%s" , assistantsSuffix , assistantID )
151
150
req , err := c .newRequest (ctx , http .MethodPost , c .fullURL (urlSuffix ), withBody (request ),
152
- withBetaAssistantV1 ( ))
151
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
153
152
if err != nil {
154
153
return
155
154
}
@@ -165,7 +164,7 @@ func (c *Client) DeleteAssistant(
165
164
) (response AssistantDeleteResponse , err error ) {
166
165
urlSuffix := fmt .Sprintf ("%s/%s" , assistantsSuffix , assistantID )
167
166
req , err := c .newRequest (ctx , http .MethodDelete , c .fullURL (urlSuffix ),
168
- withBetaAssistantV1 ( ))
167
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
169
168
if err != nil {
170
169
return
171
170
}
@@ -203,7 +202,7 @@ func (c *Client) ListAssistants(
203
202
204
203
urlSuffix := fmt .Sprintf ("%s%s" , assistantsSuffix , encodedValues )
205
204
req , err := c .newRequest (ctx , http .MethodGet , c .fullURL (urlSuffix ),
206
- withBetaAssistantV1 ( ))
205
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
207
206
if err != nil {
208
207
return
209
208
}
@@ -221,7 +220,7 @@ func (c *Client) CreateAssistantFile(
221
220
urlSuffix := fmt .Sprintf ("%s/%s%s" , assistantsSuffix , assistantID , assistantsFilesSuffix )
222
221
req , err := c .newRequest (ctx , http .MethodPost , c .fullURL (urlSuffix ),
223
222
withBody (request ),
224
- withBetaAssistantV1 ( ))
223
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
225
224
if err != nil {
226
225
return
227
226
}
@@ -238,7 +237,7 @@ func (c *Client) RetrieveAssistantFile(
238
237
) (response AssistantFile , err error ) {
239
238
urlSuffix := fmt .Sprintf ("%s/%s%s/%s" , assistantsSuffix , assistantID , assistantsFilesSuffix , fileID )
240
239
req , err := c .newRequest (ctx , http .MethodGet , c .fullURL (urlSuffix ),
241
- withBetaAssistantV1 ( ))
240
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
242
241
if err != nil {
243
242
return
244
243
}
@@ -255,7 +254,7 @@ func (c *Client) DeleteAssistantFile(
255
254
) (err error ) {
256
255
urlSuffix := fmt .Sprintf ("%s/%s%s/%s" , assistantsSuffix , assistantID , assistantsFilesSuffix , fileID )
257
256
req , err := c .newRequest (ctx , http .MethodDelete , c .fullURL (urlSuffix ),
258
- withBetaAssistantV1 ( ))
257
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
259
258
if err != nil {
260
259
return
261
260
}
@@ -294,7 +293,7 @@ func (c *Client) ListAssistantFiles(
294
293
295
294
urlSuffix := fmt .Sprintf ("%s/%s%s%s" , assistantsSuffix , assistantID , assistantsFilesSuffix , encodedValues )
296
295
req , err := c .newRequest (ctx , http .MethodGet , c .fullURL (urlSuffix ),
297
- withBetaAssistantV1 ( ))
296
+ withBetaAssistantVersion ( c . config . AssistantVersion ))
298
297
if err != nil {
299
298
return
300
299
}
0 commit comments