@@ -27,7 +27,9 @@ public function create(string $threadId, array $parameters): ThreadMessageRespon
2727 $ payload = Payload::create ("threads/ $ threadId/messages " , $ parameters );
2828
2929 /** @var Response<array{id: string, object: string, created_at: int, thread_id: string, role: string, content: array<int, array{type: 'image_url', image_url: array{url: string, detail?: string}}|array{type: 'image_file', image_file: array{file_id: string, detail?: string}}|array{type: 'text', text: array{value: string, annotations: array<int, array{type: 'file_citation', text: string, file_citation: array{file_id: string, quote?: string}, start_index: int, end_index: int}|array{type: 'file_path', text: string, file_path: array{file_id: string}, start_index: int, end_index: int}>}}>, assistant_id: ?string, run_id: ?string, attachments?: array<int, array{file_id: string, tools: array<int, array{type: 'file_search'}|array{type: 'code_interpreter'}>}>, metadata: array<string, string>}> $response */
30- $ response = $ this ->transporter ->requestObject ($ payload );
30+ $ response = $ this ->transporter
31+ ->addHeader ('OpenAI-Beta ' , 'assistants=v2 ' )
32+ ->requestObject ($ payload );
3133
3234 return ThreadMessageResponse::from ($ response ->data (), $ response ->meta ());
3335 }
@@ -42,7 +44,9 @@ public function retrieve(string $threadId, string $messageId): ThreadMessageResp
4244 $ payload = Payload::retrieve ("threads/ $ threadId/messages " , $ messageId );
4345
4446 /** @var Response<array{id: string, object: string, created_at: int, thread_id: string, role: string, content: array<int, array{type: 'image_url', image_url: array{url: string, detail?: string}}|array{type: 'image_file', image_file: array{file_id: string, detail?: string}}|array{type: 'text', text: array{value: string, annotations: array<int, array{type: 'file_citation', text: string, file_citation: array{file_id: string, quote?: string}, start_index: int, end_index: int}|array{type: 'file_path', text: string, file_path: array{file_id: string}, start_index: int, end_index: int}>}}>, assistant_id: ?string, run_id: ?string, attachments?: array<int, array{file_id: string, tools: array<int, array{type: 'file_search'}|array{type: 'code_interpreter'}>}>, metadata: array<string, string>}> $response */
45- $ response = $ this ->transporter ->requestObject ($ payload );
47+ $ response = $ this ->transporter
48+ ->addHeader ('OpenAI-Beta ' , 'assistants=v2 ' )
49+ ->requestObject ($ payload );
4650
4751 return ThreadMessageResponse::from ($ response ->data (), $ response ->meta ());
4852 }
@@ -59,7 +63,9 @@ public function modify(string $threadId, string $messageId, array $parameters):
5963 $ payload = Payload::modify ("threads/ $ threadId/messages " , $ messageId , $ parameters );
6064
6165 /** @var Response<array{id: string, object: string, created_at: int, thread_id: string, role: string, content: array<int, array{type: 'image_url', image_url: array{url: string, detail?: string}}|array{type: 'image_file', image_file: array{file_id: string, detail?: string}}|array{type: 'text', text: array{value: string, annotations: array<int, array{type: 'file_citation', text: string, file_citation: array{file_id: string, quote?: string}, start_index: int, end_index: int}|array{type: 'file_path', text: string, file_path: array{file_id: string}, start_index: int, end_index: int}>}}>, assistant_id: ?string, run_id: ?string, attachments?: array<int, array{file_id: string, tools: array<int, array{type: 'file_search'}|array{type: 'code_interpreter'}>}>, metadata: array<string, string>}> $response */
62- $ response = $ this ->transporter ->requestObject ($ payload );
66+ $ response = $ this ->transporter
67+ ->addHeader ('OpenAI-Beta ' , 'assistants=v2 ' )
68+ ->requestObject ($ payload );
6369
6470 return ThreadMessageResponse::from ($ response ->data (), $ response ->meta ());
6571 }
@@ -74,7 +80,9 @@ public function delete(string $threadId, string $messageId): ThreadMessageDelete
7480 $ payload = Payload::delete ("threads/ $ threadId/messages " , $ messageId );
7581
7682 /** @var Response<array{id: string, object: string, deleted: bool}> $response */
77- $ response = $ this ->transporter ->requestObject ($ payload );
83+ $ response = $ this ->transporter
84+ ->addHeader ('OpenAI-Beta ' , 'assistants=v2 ' )
85+ ->requestObject ($ payload );
7886
7987 return ThreadMessageDeleteResponse::from ($ response ->data (), $ response ->meta ());
8088 }
@@ -91,7 +99,9 @@ public function list(string $threadId, array $parameters = []): ThreadMessageLis
9199 $ payload = Payload::list ("threads/ $ threadId/messages " , $ parameters );
92100
93101 /** @var Response<array{object: string, data: array<int, array{id: string, object: string, created_at: int, thread_id: string, role: string, content: array<int, array{type: 'image_url', image_url: array{url: string, detail?: string}}|array{type: 'image_file', image_file: array{file_id: string, detail?: string}}|array{type: 'text', text: array{value: string, annotations: array<int, array{type: 'file_citation', text: string, file_citation: array{file_id: string, quote?: string}, start_index: int, end_index: int}|array{type: 'file_path', text: string, file_path: array{file_id: string}, start_index: int, end_index: int}>}}>, assistant_id: ?string, run_id: ?string, attachments?: array<int, array{file_id: string, tools: array<int, array{type: 'file_search'}|array{type: 'code_interpreter'}>}>, metadata: array<string, string>}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */
94- $ response = $ this ->transporter ->requestObject ($ payload );
102+ $ response = $ this ->transporter
103+ ->addHeader ('OpenAI-Beta ' , 'assistants=v2 ' )
104+ ->requestObject ($ payload );
95105
96106 return ThreadMessageListResponse::from ($ response ->data (), $ response ->meta ());
97107 }
0 commit comments