@@ -82,38 +82,38 @@ func (r *BetaThreadRunService) NewStreaming(ctx context.Context, threadID string
8282// Retrieves a run.
8383//
8484// Deprecated: The Assistants API is deprecated in favor of the Responses API
85- func (r * BetaThreadRunService ) Get (ctx context.Context , threadID string , runID string , opts ... option.RequestOption ) (res * Run , err error ) {
85+ func (r * BetaThreadRunService ) Get (ctx context.Context , runID string , query BetaThreadRunGetParams , opts ... option.RequestOption ) (res * Run , err error ) {
8686 opts = append (r .Options [:], opts ... )
8787 opts = append ([]option.RequestOption {option .WithHeader ("OpenAI-Beta" , "assistants=v2" )}, opts ... )
88- if threadID == "" {
88+ if query . ThreadID == "" {
8989 err = errors .New ("missing required thread_id parameter" )
9090 return
9191 }
9292 if runID == "" {
9393 err = errors .New ("missing required run_id parameter" )
9494 return
9595 }
96- path := fmt .Sprintf ("threads/%s/runs/%s" , threadID , runID )
96+ path := fmt .Sprintf ("threads/%s/runs/%s" , query . ThreadID , runID )
9797 err = requestconfig .ExecuteNewRequest (ctx , http .MethodGet , path , nil , & res , opts ... )
9898 return
9999}
100100
101101// Modifies a run.
102102//
103103// Deprecated: The Assistants API is deprecated in favor of the Responses API
104- func (r * BetaThreadRunService ) Update (ctx context.Context , threadID string , runID string , body BetaThreadRunUpdateParams , opts ... option.RequestOption ) (res * Run , err error ) {
104+ func (r * BetaThreadRunService ) Update (ctx context.Context , runID string , params BetaThreadRunUpdateParams , opts ... option.RequestOption ) (res * Run , err error ) {
105105 opts = append (r .Options [:], opts ... )
106106 opts = append ([]option.RequestOption {option .WithHeader ("OpenAI-Beta" , "assistants=v2" )}, opts ... )
107- if threadID == "" {
107+ if params . ThreadID == "" {
108108 err = errors .New ("missing required thread_id parameter" )
109109 return
110110 }
111111 if runID == "" {
112112 err = errors .New ("missing required run_id parameter" )
113113 return
114114 }
115- path := fmt .Sprintf ("threads/%s/runs/%s" , threadID , runID )
116- err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
115+ path := fmt .Sprintf ("threads/%s/runs/%s" , params . ThreadID , runID )
116+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , params , & res , opts ... )
117117 return
118118}
119119
@@ -151,18 +151,18 @@ func (r *BetaThreadRunService) ListAutoPaging(ctx context.Context, threadID stri
151151// Cancels a run that is `in_progress`.
152152//
153153// Deprecated: The Assistants API is deprecated in favor of the Responses API
154- func (r * BetaThreadRunService ) Cancel (ctx context.Context , threadID string , runID string , opts ... option.RequestOption ) (res * Run , err error ) {
154+ func (r * BetaThreadRunService ) Cancel (ctx context.Context , runID string , body BetaThreadRunCancelParams , opts ... option.RequestOption ) (res * Run , err error ) {
155155 opts = append (r .Options [:], opts ... )
156156 opts = append ([]option.RequestOption {option .WithHeader ("OpenAI-Beta" , "assistants=v2" )}, opts ... )
157- if threadID == "" {
157+ if body . ThreadID == "" {
158158 err = errors .New ("missing required thread_id parameter" )
159159 return
160160 }
161161 if runID == "" {
162162 err = errors .New ("missing required run_id parameter" )
163163 return
164164 }
165- path := fmt .Sprintf ("threads/%s/runs/%s/cancel" , threadID , runID )
165+ path := fmt .Sprintf ("threads/%s/runs/%s/cancel" , body . ThreadID , runID )
166166 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , nil , & res , opts ... )
167167 return
168168}
@@ -173,19 +173,19 @@ func (r *BetaThreadRunService) Cancel(ctx context.Context, threadID string, runI
173173// request.
174174//
175175// Deprecated: The Assistants API is deprecated in favor of the Responses API
176- func (r * BetaThreadRunService ) SubmitToolOutputs (ctx context.Context , threadID string , runID string , body BetaThreadRunSubmitToolOutputsParams , opts ... option.RequestOption ) (res * Run , err error ) {
176+ func (r * BetaThreadRunService ) SubmitToolOutputs (ctx context.Context , runID string , params BetaThreadRunSubmitToolOutputsParams , opts ... option.RequestOption ) (res * Run , err error ) {
177177 opts = append (r .Options [:], opts ... )
178178 opts = append ([]option.RequestOption {option .WithHeader ("OpenAI-Beta" , "assistants=v2" )}, opts ... )
179- if threadID == "" {
179+ if params . ThreadID == "" {
180180 err = errors .New ("missing required thread_id parameter" )
181181 return
182182 }
183183 if runID == "" {
184184 err = errors .New ("missing required run_id parameter" )
185185 return
186186 }
187- path := fmt .Sprintf ("threads/%s/runs/%s/submit_tool_outputs" , threadID , runID )
188- err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
187+ path := fmt .Sprintf ("threads/%s/runs/%s/submit_tool_outputs" , params . ThreadID , runID )
188+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , params , & res , opts ... )
189189 return
190190}
191191
@@ -195,23 +195,23 @@ func (r *BetaThreadRunService) SubmitToolOutputs(ctx context.Context, threadID s
195195// request.
196196//
197197// Deprecated: The Assistants API is deprecated in favor of the Responses API
198- func (r * BetaThreadRunService ) SubmitToolOutputsStreaming (ctx context.Context , threadID string , runID string , body BetaThreadRunSubmitToolOutputsParams , opts ... option.RequestOption ) (stream * ssestream.Stream [AssistantStreamEventUnion ]) {
198+ func (r * BetaThreadRunService ) SubmitToolOutputsStreaming (ctx context.Context , runID string , params BetaThreadRunSubmitToolOutputsParams , opts ... option.RequestOption ) (stream * ssestream.Stream [AssistantStreamEventUnion ]) {
199199 var (
200200 raw * http.Response
201201 err error
202202 )
203203 opts = append (r .Options [:], opts ... )
204204 opts = append ([]option.RequestOption {option .WithHeader ("OpenAI-Beta" , "assistants=v2" ), option .WithJSONSet ("stream" , true )}, opts ... )
205- if threadID == "" {
205+ if params . ThreadID == "" {
206206 err = errors .New ("missing required thread_id parameter" )
207207 return
208208 }
209209 if runID == "" {
210210 err = errors .New ("missing required run_id parameter" )
211211 return
212212 }
213- path := fmt .Sprintf ("threads/%s/runs/%s/submit_tool_outputs" , threadID , runID )
214- err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & raw , opts ... )
213+ path := fmt .Sprintf ("threads/%s/runs/%s/submit_tool_outputs" , params . ThreadID , runID )
214+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , params , & raw , opts ... )
215215 return ssestream .NewStream [AssistantStreamEventUnion ](ssestream .NewDecoder (raw ), err )
216216}
217217
@@ -868,7 +868,13 @@ func init() {
868868 )
869869}
870870
871+ type BetaThreadRunGetParams struct {
872+ ThreadID string `path:"thread_id,required" json:"-"`
873+ paramObj
874+ }
875+
871876type BetaThreadRunUpdateParams struct {
877+ ThreadID string `path:"thread_id,required" json:"-"`
872878 // Set of 16 key-value pairs that can be attached to an object. This can be useful
873879 // for storing additional information about the object in a structured format, and
874880 // querying for objects via API or the dashboard.
@@ -927,7 +933,13 @@ const (
927933 BetaThreadRunListParamsOrderDesc BetaThreadRunListParamsOrder = "desc"
928934)
929935
936+ type BetaThreadRunCancelParams struct {
937+ ThreadID string `path:"thread_id,required" json:"-"`
938+ paramObj
939+ }
940+
930941type BetaThreadRunSubmitToolOutputsParams struct {
942+ ThreadID string `path:"thread_id,required" json:"-"`
931943 // A list of tools for which the outputs are being submitted.
932944 ToolOutputs []BetaThreadRunSubmitToolOutputsParamsToolOutput `json:"tool_outputs,omitzero,required"`
933945 paramObj
0 commit comments