Skip to content

Commit 027470e

Browse files
chore: deprecate Assistants API
1 parent fd46533 commit 027470e

File tree

6 files changed

+65
-5
lines changed

6 files changed

+65
-5
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 97
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fc64d7c2c8f51f750813375356c3f3fdfc7fc1b1b34f19c20a5410279d445d37.yml
33
openapi_spec_hash: 618285fc70199ee32b9ebe4bf72f7e4c
4-
config_hash: 535b6e5f26a295d609b259c8cb8f656c
4+
config_hash: 3b590818075ca4b54949578b97494525

beta.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import (
1515
type BetaService struct {
1616
Options []option.RequestOption
1717
Assistants BetaAssistantService
18-
Threads BetaThreadService
18+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
19+
Threads BetaThreadService
1920
}
2021

2122
// NewBetaService generates a new service that applies the given options to each

betathread.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ import (
2525
// Note, unlike clients, this service does not read variables from the environment
2626
// automatically. You should not instantiate this service directly, and instead use
2727
// the [NewBetaThreadService] method instead.
28+
//
29+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
2830
type BetaThreadService struct {
29-
Options []option.RequestOption
30-
Runs BetaThreadRunService
31+
Options []option.RequestOption
32+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
33+
Runs BetaThreadRunService
34+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
3135
Messages BetaThreadMessageService
3236
}
3337

@@ -43,6 +47,8 @@ func NewBetaThreadService(opts ...option.RequestOption) (r BetaThreadService) {
4347
}
4448

4549
// Create a thread.
50+
//
51+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
4652
func (r *BetaThreadService) New(ctx context.Context, body BetaThreadNewParams, opts ...option.RequestOption) (res *Thread, err error) {
4753
opts = append(r.Options[:], opts...)
4854
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -52,6 +58,8 @@ func (r *BetaThreadService) New(ctx context.Context, body BetaThreadNewParams, o
5258
}
5359

5460
// Retrieves a thread.
61+
//
62+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
5563
func (r *BetaThreadService) Get(ctx context.Context, threadID string, opts ...option.RequestOption) (res *Thread, err error) {
5664
opts = append(r.Options[:], opts...)
5765
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -65,6 +73,8 @@ func (r *BetaThreadService) Get(ctx context.Context, threadID string, opts ...op
6573
}
6674

6775
// Modifies a thread.
76+
//
77+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
6878
func (r *BetaThreadService) Update(ctx context.Context, threadID string, body BetaThreadUpdateParams, opts ...option.RequestOption) (res *Thread, err error) {
6979
opts = append(r.Options[:], opts...)
7080
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -78,6 +88,8 @@ func (r *BetaThreadService) Update(ctx context.Context, threadID string, body Be
7888
}
7989

8090
// Delete a thread.
91+
//
92+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
8193
func (r *BetaThreadService) Delete(ctx context.Context, threadID string, opts ...option.RequestOption) (res *ThreadDeleted, err error) {
8294
opts = append(r.Options[:], opts...)
8395
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -91,6 +103,8 @@ func (r *BetaThreadService) Delete(ctx context.Context, threadID string, opts ..
91103
}
92104

93105
// Create a thread and run it in one request.
106+
//
107+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
94108
func (r *BetaThreadService) NewAndRun(ctx context.Context, body BetaThreadNewAndRunParams, opts ...option.RequestOption) (res *Run, err error) {
95109
opts = append(r.Options[:], opts...)
96110
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -100,6 +114,8 @@ func (r *BetaThreadService) NewAndRun(ctx context.Context, body BetaThreadNewAnd
100114
}
101115

102116
// Create a thread and run it in one request.
117+
//
118+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
103119
func (r *BetaThreadService) NewAndRunStreaming(ctx context.Context, body BetaThreadNewAndRunParams, opts ...option.RequestOption) (stream *ssestream.Stream[AssistantStreamEventUnion]) {
104120
var (
105121
raw *http.Response

betathreadmessage.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
// Note, unlike clients, this service does not read variables from the environment
2828
// automatically. You should not instantiate this service directly, and instead use
2929
// the [NewBetaThreadMessageService] method instead.
30+
//
31+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
3032
type BetaThreadMessageService struct {
3133
Options []option.RequestOption
3234
}
@@ -41,6 +43,8 @@ func NewBetaThreadMessageService(opts ...option.RequestOption) (r BetaThreadMess
4143
}
4244

4345
// Create a message.
46+
//
47+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
4448
func (r *BetaThreadMessageService) New(ctx context.Context, threadID string, body BetaThreadMessageNewParams, opts ...option.RequestOption) (res *Message, err error) {
4549
opts = append(r.Options[:], opts...)
4650
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -54,6 +58,8 @@ func (r *BetaThreadMessageService) New(ctx context.Context, threadID string, bod
5458
}
5559

5660
// Retrieve a message.
61+
//
62+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
5763
func (r *BetaThreadMessageService) Get(ctx context.Context, threadID string, messageID string, opts ...option.RequestOption) (res *Message, err error) {
5864
opts = append(r.Options[:], opts...)
5965
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -71,6 +77,8 @@ func (r *BetaThreadMessageService) Get(ctx context.Context, threadID string, mes
7177
}
7278

7379
// Modifies a message.
80+
//
81+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
7482
func (r *BetaThreadMessageService) Update(ctx context.Context, threadID string, messageID string, body BetaThreadMessageUpdateParams, opts ...option.RequestOption) (res *Message, err error) {
7583
opts = append(r.Options[:], opts...)
7684
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -88,6 +96,8 @@ func (r *BetaThreadMessageService) Update(ctx context.Context, threadID string,
8896
}
8997

9098
// Returns a list of messages for a given thread.
99+
//
100+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
91101
func (r *BetaThreadMessageService) List(ctx context.Context, threadID string, query BetaThreadMessageListParams, opts ...option.RequestOption) (res *pagination.CursorPage[Message], err error) {
92102
var raw *http.Response
93103
opts = append(r.Options[:], opts...)
@@ -110,11 +120,15 @@ func (r *BetaThreadMessageService) List(ctx context.Context, threadID string, qu
110120
}
111121

112122
// Returns a list of messages for a given thread.
123+
//
124+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
113125
func (r *BetaThreadMessageService) ListAutoPaging(ctx context.Context, threadID string, query BetaThreadMessageListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[Message] {
114126
return pagination.NewCursorPageAutoPager(r.List(ctx, threadID, query, opts...))
115127
}
116128

117129
// Deletes a message.
130+
//
131+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
118132
func (r *BetaThreadMessageService) Delete(ctx context.Context, threadID string, messageID string, opts ...option.RequestOption) (res *MessageDeleted, err error) {
119133
opts = append(r.Options[:], opts...)
120134
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)

betathreadrun.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ import (
2727
// Note, unlike clients, this service does not read variables from the environment
2828
// automatically. You should not instantiate this service directly, and instead use
2929
// the [NewBetaThreadRunService] method instead.
30+
//
31+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
3032
type BetaThreadRunService struct {
3133
Options []option.RequestOption
32-
Steps BetaThreadRunStepService
34+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
35+
Steps BetaThreadRunStepService
3336
}
3437

3538
// NewBetaThreadRunService generates a new service that applies the given options
@@ -43,6 +46,8 @@ func NewBetaThreadRunService(opts ...option.RequestOption) (r BetaThreadRunServi
4346
}
4447

4548
// Create a run.
49+
//
50+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
4651
func (r *BetaThreadRunService) New(ctx context.Context, threadID string, params BetaThreadRunNewParams, opts ...option.RequestOption) (res *Run, err error) {
4752
opts = append(r.Options[:], opts...)
4853
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -56,6 +61,8 @@ func (r *BetaThreadRunService) New(ctx context.Context, threadID string, params
5661
}
5762

5863
// Create a run.
64+
//
65+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
5966
func (r *BetaThreadRunService) NewStreaming(ctx context.Context, threadID string, params BetaThreadRunNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[AssistantStreamEventUnion]) {
6067
var (
6168
raw *http.Response
@@ -73,6 +80,8 @@ func (r *BetaThreadRunService) NewStreaming(ctx context.Context, threadID string
7380
}
7481

7582
// Retrieves a run.
83+
//
84+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
7685
func (r *BetaThreadRunService) Get(ctx context.Context, threadID string, runID string, opts ...option.RequestOption) (res *Run, err error) {
7786
opts = append(r.Options[:], opts...)
7887
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -90,6 +99,8 @@ func (r *BetaThreadRunService) Get(ctx context.Context, threadID string, runID s
9099
}
91100

92101
// Modifies a run.
102+
//
103+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
93104
func (r *BetaThreadRunService) Update(ctx context.Context, threadID string, runID string, body BetaThreadRunUpdateParams, opts ...option.RequestOption) (res *Run, err error) {
94105
opts = append(r.Options[:], opts...)
95106
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -107,6 +118,8 @@ func (r *BetaThreadRunService) Update(ctx context.Context, threadID string, runI
107118
}
108119

109120
// Returns a list of runs belonging to a thread.
121+
//
122+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
110123
func (r *BetaThreadRunService) List(ctx context.Context, threadID string, query BetaThreadRunListParams, opts ...option.RequestOption) (res *pagination.CursorPage[Run], err error) {
111124
var raw *http.Response
112125
opts = append(r.Options[:], opts...)
@@ -129,11 +142,15 @@ func (r *BetaThreadRunService) List(ctx context.Context, threadID string, query
129142
}
130143

131144
// Returns a list of runs belonging to a thread.
145+
//
146+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
132147
func (r *BetaThreadRunService) ListAutoPaging(ctx context.Context, threadID string, query BetaThreadRunListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[Run] {
133148
return pagination.NewCursorPageAutoPager(r.List(ctx, threadID, query, opts...))
134149
}
135150

136151
// Cancels a run that is `in_progress`.
152+
//
153+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
137154
func (r *BetaThreadRunService) Cancel(ctx context.Context, threadID string, runID string, opts ...option.RequestOption) (res *Run, err error) {
138155
opts = append(r.Options[:], opts...)
139156
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -154,6 +171,8 @@ func (r *BetaThreadRunService) Cancel(ctx context.Context, threadID string, runI
154171
// `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
155172
// tool calls once they're all completed. All outputs must be submitted in a single
156173
// request.
174+
//
175+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
157176
func (r *BetaThreadRunService) SubmitToolOutputs(ctx context.Context, threadID string, runID string, body BetaThreadRunSubmitToolOutputsParams, opts ...option.RequestOption) (res *Run, err error) {
158177
opts = append(r.Options[:], opts...)
159178
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -174,6 +193,8 @@ func (r *BetaThreadRunService) SubmitToolOutputs(ctx context.Context, threadID s
174193
// `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
175194
// tool calls once they're all completed. All outputs must be submitted in a single
176195
// request.
196+
//
197+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
177198
func (r *BetaThreadRunService) SubmitToolOutputsStreaming(ctx context.Context, threadID string, runID string, body BetaThreadRunSubmitToolOutputsParams, opts ...option.RequestOption) (stream *ssestream.Stream[AssistantStreamEventUnion]) {
178199
var (
179200
raw *http.Response

betathreadrunstep.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
// Note, unlike clients, this service does not read variables from the environment
2828
// automatically. You should not instantiate this service directly, and instead use
2929
// the [NewBetaThreadRunStepService] method instead.
30+
//
31+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
3032
type BetaThreadRunStepService struct {
3133
Options []option.RequestOption
3234
}
@@ -41,6 +43,8 @@ func NewBetaThreadRunStepService(opts ...option.RequestOption) (r BetaThreadRunS
4143
}
4244

4345
// Retrieves a run step.
46+
//
47+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
4448
func (r *BetaThreadRunStepService) Get(ctx context.Context, threadID string, runID string, stepID string, query BetaThreadRunStepGetParams, opts ...option.RequestOption) (res *RunStep, err error) {
4549
opts = append(r.Options[:], opts...)
4650
opts = append([]option.RequestOption{option.WithHeader("OpenAI-Beta", "assistants=v2")}, opts...)
@@ -62,6 +66,8 @@ func (r *BetaThreadRunStepService) Get(ctx context.Context, threadID string, run
6266
}
6367

6468
// Returns a list of run steps belonging to a run.
69+
//
70+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
6571
func (r *BetaThreadRunStepService) List(ctx context.Context, threadID string, runID string, query BetaThreadRunStepListParams, opts ...option.RequestOption) (res *pagination.CursorPage[RunStep], err error) {
6672
var raw *http.Response
6773
opts = append(r.Options[:], opts...)
@@ -88,6 +94,8 @@ func (r *BetaThreadRunStepService) List(ctx context.Context, threadID string, ru
8894
}
8995

9096
// Returns a list of run steps belonging to a run.
97+
//
98+
// Deprecated: The Assistants API is deprecated in favor of the Responses API
9199
func (r *BetaThreadRunStepService) ListAutoPaging(ctx context.Context, threadID string, runID string, query BetaThreadRunStepListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[RunStep] {
92100
return pagination.NewCursorPageAutoPager(r.List(ctx, threadID, runID, query, opts...))
93101
}

0 commit comments

Comments
 (0)