@@ -40,6 +40,7 @@ import { RequestOptions } from '../../../../internal/request-options';
4040import { AssistantStream , RunCreateParamsBaseStream } from '../../../../lib/AssistantStream' ;
4141import { sleep } from '../../../../internal/utils/sleep' ;
4242import { RunSubmitToolOutputsParamsStream } from '../../../../lib/AssistantStream' ;
43+ import { path } from '../../../../internal/utils/path' ;
4344
4445export class Runs extends APIResource {
4546 steps : StepsAPI . Steps = new StepsAPI . Steps ( this . _client ) ;
@@ -64,7 +65,7 @@ export class Runs extends APIResource {
6465 options ?: RequestOptions ,
6566 ) : APIPromise < Run > | APIPromise < Stream < AssistantsAPI . AssistantStreamEvent > > {
6667 const { include, ...body } = params ;
67- return this . _client . post ( `/threads/${ threadID } /runs` , {
68+ return this . _client . post ( path `/threads/${ threadID } /runs` , {
6869 query : { include } ,
6970 body,
7071 ...options ,
@@ -78,7 +79,7 @@ export class Runs extends APIResource {
7879 */
7980 retrieve ( runID : string , params : RunRetrieveParams , options ?: RequestOptions ) : APIPromise < Run > {
8081 const { thread_id } = params ;
81- return this . _client . get ( `/threads/${ thread_id } /runs/${ runID } ` , {
82+ return this . _client . get ( path `/threads/${ thread_id } /runs/${ runID } ` , {
8283 ...options ,
8384 headers : buildHeaders ( [ { 'OpenAI-Beta' : 'assistants=v2' } , options ?. headers ] ) ,
8485 } ) ;
@@ -89,7 +90,7 @@ export class Runs extends APIResource {
8990 */
9091 update ( runID : string , params : RunUpdateParams , options ?: RequestOptions ) : APIPromise < Run > {
9192 const { thread_id, ...body } = params ;
92- return this . _client . post ( `/threads/${ thread_id } /runs/${ runID } ` , {
93+ return this . _client . post ( path `/threads/${ thread_id } /runs/${ runID } ` , {
9394 body,
9495 ...options ,
9596 headers : buildHeaders ( [ { 'OpenAI-Beta' : 'assistants=v2' } , options ?. headers ] ) ,
@@ -104,7 +105,7 @@ export class Runs extends APIResource {
104105 query : RunListParams | null | undefined = { } ,
105106 options ?: RequestOptions ,
106107 ) : PagePromise < RunsPage , Run > {
107- return this . _client . getAPIList ( `/threads/${ threadID } /runs` , CursorPage < Run > , {
108+ return this . _client . getAPIList ( path `/threads/${ threadID } /runs` , CursorPage < Run > , {
108109 query,
109110 ...options ,
110111 headers : buildHeaders ( [ { 'OpenAI-Beta' : 'assistants=v2' } , options ?. headers ] ) ,
@@ -116,7 +117,7 @@ export class Runs extends APIResource {
116117 */
117118 cancel ( runID : string , params : RunCancelParams , options ?: RequestOptions ) : APIPromise < Run > {
118119 const { thread_id } = params ;
119- return this . _client . post ( `/threads/${ thread_id } /runs/${ runID } /cancel` , {
120+ return this . _client . post ( path `/threads/${ thread_id } /runs/${ runID } /cancel` , {
120121 ...options ,
121122 headers : buildHeaders ( [ { 'OpenAI-Beta' : 'assistants=v2' } , options ?. headers ] ) ,
122123 } ) ;
@@ -239,7 +240,7 @@ export class Runs extends APIResource {
239240 options ?: RequestOptions ,
240241 ) : APIPromise < Run > | APIPromise < Stream < AssistantsAPI . AssistantStreamEvent > > {
241242 const { thread_id, ...body } = params ;
242- return this . _client . post ( `/threads/${ thread_id } /runs/${ runID } /submit_tool_outputs` , {
243+ return this . _client . post ( path `/threads/${ thread_id } /runs/${ runID } /submit_tool_outputs` , {
243244 body,
244245 ...options ,
245246 headers : buildHeaders ( [ { 'OpenAI-Beta' : 'assistants=v2' } , options ?. headers ] ) ,
0 commit comments