openai/openai-python

Public

mirrored from https://github.com/openai/openai-pythonAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.100.2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

tests/api_resources/beta/threads/test_runs.py

1117lines · modeblame

5cfb125aStainless Bot2 years ago1# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
baa9f07fRobert Craigie2 years ago2
3from __future__ import annotations
4
5import os
86379b44Stainless Bot2 years ago6from typing import Any, cast
baa9f07fRobert Craigie2 years ago7
8import pytest
9
10from openai import OpenAI, AsyncOpenAI
11from tests.utils import assert_matches_type
12from openai.pagination import SyncCursorPage, AsyncCursorPage
4a0f0fa0Stainless Bot2 years ago13from openai.types.beta.threads import (
14Run,
15)
baa9f07fRobert Craigie2 years ago16
595f3b36Stainless Bot2 years ago17# pyright: reportDeprecated=false
18
baa9f07fRobert Craigie2 years ago19base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
20
21
22class TestRuns:
98d779fbStainless Bot2 years ago23parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
baa9f07fRobert Craigie2 years ago24
25@parametrize
5429f696Stainless Bot2 years ago26def test_method_create_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago27with pytest.warns(DeprecationWarning):
28run = client.beta.threads.runs.create(
29thread_id="thread_id",
30assistant_id="assistant_id",
31)
32
baa9f07fRobert Craigie2 years ago33assert_matches_type(Run, run, path=["response"])
34
35@parametrize
5429f696Stainless Bot2 years ago36def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago37with pytest.warns(DeprecationWarning):
38run = client.beta.threads.runs.create(
39thread_id="thread_id",
40assistant_id="assistant_id",
41include=["step_details.tool_calls[*].file_search.results[*].content"],
42additional_instructions="additional_instructions",
43additional_messages=[
44{
45"content": "string",
46"role": "user",
47"attachments": [
48{
49"file_id": "file_id",
50"tools": [{"type": "code_interpreter"}],
51}
52],
53"metadata": {"foo": "string"},
54}
55],
56instructions="instructions",
57max_completion_tokens=256,
58max_prompt_tokens=256,
59metadata={"foo": "string"},
60model="string",
61parallel_tool_calls=True,
caf837bbstainless-app[bot]10 months ago62reasoning_effort="minimal",
cca09707stainless-app[bot]1 years ago63response_format="auto",
64stream=False,
65temperature=1,
66tool_choice="none",
67tools=[{"type": "code_interpreter"}],
68top_p=1,
69truncation_strategy={
70"type": "auto",
71"last_messages": 1,
72},
73)
74
baa9f07fRobert Craigie2 years ago75assert_matches_type(Run, run, path=["response"])
76
77@parametrize
5429f696Stainless Bot2 years ago78def test_raw_response_create_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago79with pytest.warns(DeprecationWarning):
80response = client.beta.threads.runs.with_raw_response.create(
81thread_id="thread_id",
82assistant_id="assistant_id",
83)
86379b44Stainless Bot2 years ago84
85assert response.is_closed is True
baa9f07fRobert Craigie2 years ago86assert response.http_request.headers.get("X-Stainless-Lang") == "python"
87run = response.parse()
88assert_matches_type(Run, run, path=["response"])
89
86379b44Stainless Bot2 years ago90@parametrize
5429f696Stainless Bot2 years ago91def test_streaming_response_create_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago92with pytest.warns(DeprecationWarning):
93with client.beta.threads.runs.with_streaming_response.create(
94thread_id="thread_id",
95assistant_id="assistant_id",
96) as response:
97assert not response.is_closed
98assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago99
cca09707stainless-app[bot]1 years ago100run = response.parse()
101assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago102
103assert cast(Any, response.is_closed) is True
104
023a4e66Stainless Bot2 years ago105@parametrize
5429f696Stainless Bot2 years ago106def test_path_params_create_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago107with pytest.warns(DeprecationWarning):
108with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
109client.beta.threads.runs.with_raw_response.create(
110thread_id="",
111assistant_id="assistant_id",
112)
023a4e66Stainless Bot2 years ago113
5429f696Stainless Bot2 years ago114@parametrize
115def test_method_create_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago116with pytest.warns(DeprecationWarning):
117run_stream = client.beta.threads.runs.create(
118thread_id="thread_id",
119assistant_id="assistant_id",
120stream=True,
121)
122
5429f696Stainless Bot2 years ago123run_stream.response.close()
124
125@parametrize
126def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago127with pytest.warns(DeprecationWarning):
128run_stream = client.beta.threads.runs.create(
129thread_id="thread_id",
130assistant_id="assistant_id",
131stream=True,
132include=["step_details.tool_calls[*].file_search.results[*].content"],
133additional_instructions="additional_instructions",
134additional_messages=[
135{
136"content": "string",
137"role": "user",
138"attachments": [
139{
140"file_id": "file_id",
141"tools": [{"type": "code_interpreter"}],
142}
143],
144"metadata": {"foo": "string"},
145}
146],
147instructions="instructions",
148max_completion_tokens=256,
149max_prompt_tokens=256,
150metadata={"foo": "string"},
151model="string",
152parallel_tool_calls=True,
caf837bbstainless-app[bot]10 months ago153reasoning_effort="minimal",
cca09707stainless-app[bot]1 years ago154response_format="auto",
155temperature=1,
156tool_choice="none",
157tools=[{"type": "code_interpreter"}],
158top_p=1,
159truncation_strategy={
160"type": "auto",
161"last_messages": 1,
162},
163)
164
5429f696Stainless Bot2 years ago165run_stream.response.close()
166
167@parametrize
168def test_raw_response_create_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago169with pytest.warns(DeprecationWarning):
170response = client.beta.threads.runs.with_raw_response.create(
171thread_id="thread_id",
172assistant_id="assistant_id",
173stream=True,
174)
5429f696Stainless Bot2 years ago175
176assert response.http_request.headers.get("X-Stainless-Lang") == "python"
177stream = response.parse()
178stream.close()
179
180@parametrize
181def test_streaming_response_create_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago182with pytest.warns(DeprecationWarning):
183with client.beta.threads.runs.with_streaming_response.create(
184thread_id="thread_id",
185assistant_id="assistant_id",
186stream=True,
187) as response:
188assert not response.is_closed
189assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5429f696Stainless Bot2 years ago190
cca09707stainless-app[bot]1 years ago191stream = response.parse()
192stream.close()
5429f696Stainless Bot2 years ago193
194assert cast(Any, response.is_closed) is True
195
196@parametrize
197def test_path_params_create_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago198with pytest.warns(DeprecationWarning):
199with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
200client.beta.threads.runs.with_raw_response.create(
201thread_id="",
202assistant_id="assistant_id",
203stream=True,
204)
5429f696Stainless Bot2 years ago205
baa9f07fRobert Craigie2 years ago206@parametrize
207def test_method_retrieve(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago208with pytest.warns(DeprecationWarning):
209run = client.beta.threads.runs.retrieve(
210run_id="run_id",
211thread_id="thread_id",
212)
213
baa9f07fRobert Craigie2 years ago214assert_matches_type(Run, run, path=["response"])
215
216@parametrize
217def test_raw_response_retrieve(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago218with pytest.warns(DeprecationWarning):
219response = client.beta.threads.runs.with_raw_response.retrieve(
220run_id="run_id",
221thread_id="thread_id",
222)
86379b44Stainless Bot2 years ago223
224assert response.is_closed is True
baa9f07fRobert Craigie2 years ago225assert response.http_request.headers.get("X-Stainless-Lang") == "python"
226run = response.parse()
227assert_matches_type(Run, run, path=["response"])
228
86379b44Stainless Bot2 years ago229@parametrize
230def test_streaming_response_retrieve(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago231with pytest.warns(DeprecationWarning):
232with client.beta.threads.runs.with_streaming_response.retrieve(
233run_id="run_id",
234thread_id="thread_id",
235) as response:
236assert not response.is_closed
237assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago238
cca09707stainless-app[bot]1 years ago239run = response.parse()
240assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago241
242assert cast(Any, response.is_closed) is True
243
023a4e66Stainless Bot2 years ago244@parametrize
245def test_path_params_retrieve(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago246with pytest.warns(DeprecationWarning):
247with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
248client.beta.threads.runs.with_raw_response.retrieve(
249run_id="run_id",
250thread_id="",
251)
023a4e66Stainless Bot2 years ago252
cca09707stainless-app[bot]1 years ago253with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
254client.beta.threads.runs.with_raw_response.retrieve(
255run_id="",
256thread_id="thread_id",
257)
023a4e66Stainless Bot2 years ago258
baa9f07fRobert Craigie2 years ago259@parametrize
260def test_method_update(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago261with pytest.warns(DeprecationWarning):
262run = client.beta.threads.runs.update(
263run_id="run_id",
264thread_id="thread_id",
265)
266
baa9f07fRobert Craigie2 years ago267assert_matches_type(Run, run, path=["response"])
268
269@parametrize
270def test_method_update_with_all_params(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago271with pytest.warns(DeprecationWarning):
272run = client.beta.threads.runs.update(
273run_id="run_id",
274thread_id="thread_id",
275metadata={"foo": "string"},
276)
277
baa9f07fRobert Craigie2 years ago278assert_matches_type(Run, run, path=["response"])
279
280@parametrize
281def test_raw_response_update(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago282with pytest.warns(DeprecationWarning):
283response = client.beta.threads.runs.with_raw_response.update(
284run_id="run_id",
285thread_id="thread_id",
286)
86379b44Stainless Bot2 years ago287
288assert response.is_closed is True
baa9f07fRobert Craigie2 years ago289assert response.http_request.headers.get("X-Stainless-Lang") == "python"
290run = response.parse()
291assert_matches_type(Run, run, path=["response"])
292
86379b44Stainless Bot2 years ago293@parametrize
294def test_streaming_response_update(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago295with pytest.warns(DeprecationWarning):
296with client.beta.threads.runs.with_streaming_response.update(
297run_id="run_id",
298thread_id="thread_id",
299) as response:
300assert not response.is_closed
301assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago302
cca09707stainless-app[bot]1 years ago303run = response.parse()
304assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago305
306assert cast(Any, response.is_closed) is True
307
023a4e66Stainless Bot2 years ago308@parametrize
309def test_path_params_update(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago310with pytest.warns(DeprecationWarning):
311with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
312client.beta.threads.runs.with_raw_response.update(
313run_id="run_id",
314thread_id="",
315)
023a4e66Stainless Bot2 years ago316
cca09707stainless-app[bot]1 years ago317with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
318client.beta.threads.runs.with_raw_response.update(
319run_id="",
320thread_id="thread_id",
321)
023a4e66Stainless Bot2 years ago322
baa9f07fRobert Craigie2 years ago323@parametrize
324def test_method_list(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago325with pytest.warns(DeprecationWarning):
326run = client.beta.threads.runs.list(
327thread_id="thread_id",
328)
329
baa9f07fRobert Craigie2 years ago330assert_matches_type(SyncCursorPage[Run], run, path=["response"])
331
332@parametrize
333def test_method_list_with_all_params(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago334with pytest.warns(DeprecationWarning):
335run = client.beta.threads.runs.list(
336thread_id="thread_id",
337after="after",
338before="before",
339limit=0,
340order="asc",
341)
342
baa9f07fRobert Craigie2 years ago343assert_matches_type(SyncCursorPage[Run], run, path=["response"])
344
345@parametrize
346def test_raw_response_list(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago347with pytest.warns(DeprecationWarning):
348response = client.beta.threads.runs.with_raw_response.list(
349thread_id="thread_id",
350)
86379b44Stainless Bot2 years ago351
352assert response.is_closed is True
baa9f07fRobert Craigie2 years ago353assert response.http_request.headers.get("X-Stainless-Lang") == "python"
354run = response.parse()
355assert_matches_type(SyncCursorPage[Run], run, path=["response"])
356
86379b44Stainless Bot2 years ago357@parametrize
358def test_streaming_response_list(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago359with pytest.warns(DeprecationWarning):
360with client.beta.threads.runs.with_streaming_response.list(
361thread_id="thread_id",
362) as response:
363assert not response.is_closed
364assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago365
cca09707stainless-app[bot]1 years ago366run = response.parse()
367assert_matches_type(SyncCursorPage[Run], run, path=["response"])
86379b44Stainless Bot2 years ago368
369assert cast(Any, response.is_closed) is True
370
023a4e66Stainless Bot2 years ago371@parametrize
372def test_path_params_list(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago373with pytest.warns(DeprecationWarning):
374with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
375client.beta.threads.runs.with_raw_response.list(
376thread_id="",
377)
023a4e66Stainless Bot2 years ago378
baa9f07fRobert Craigie2 years ago379@parametrize
380def test_method_cancel(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago381with pytest.warns(DeprecationWarning):
382run = client.beta.threads.runs.cancel(
383run_id="run_id",
384thread_id="thread_id",
385)
386
baa9f07fRobert Craigie2 years ago387assert_matches_type(Run, run, path=["response"])
388
389@parametrize
390def test_raw_response_cancel(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago391with pytest.warns(DeprecationWarning):
392response = client.beta.threads.runs.with_raw_response.cancel(
393run_id="run_id",
394thread_id="thread_id",
395)
86379b44Stainless Bot2 years ago396
397assert response.is_closed is True
baa9f07fRobert Craigie2 years ago398assert response.http_request.headers.get("X-Stainless-Lang") == "python"
399run = response.parse()
400assert_matches_type(Run, run, path=["response"])
401
86379b44Stainless Bot2 years ago402@parametrize
403def test_streaming_response_cancel(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago404with pytest.warns(DeprecationWarning):
405with client.beta.threads.runs.with_streaming_response.cancel(
406run_id="run_id",
407thread_id="thread_id",
408) as response:
409assert not response.is_closed
410assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago411
cca09707stainless-app[bot]1 years ago412run = response.parse()
413assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago414
415assert cast(Any, response.is_closed) is True
416
023a4e66Stainless Bot2 years ago417@parametrize
418def test_path_params_cancel(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago419with pytest.warns(DeprecationWarning):
420with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
421client.beta.threads.runs.with_raw_response.cancel(
422run_id="run_id",
423thread_id="",
424)
023a4e66Stainless Bot2 years ago425
cca09707stainless-app[bot]1 years ago426with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
427client.beta.threads.runs.with_raw_response.cancel(
428run_id="",
429thread_id="thread_id",
430)
023a4e66Stainless Bot2 years ago431
baa9f07fRobert Craigie2 years ago432@parametrize
5429f696Stainless Bot2 years ago433def test_method_submit_tool_outputs_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago434with pytest.warns(DeprecationWarning):
435run = client.beta.threads.runs.submit_tool_outputs(
436run_id="run_id",
437thread_id="thread_id",
438tool_outputs=[{}],
439)
440
baa9f07fRobert Craigie2 years ago441assert_matches_type(Run, run, path=["response"])
442
443@parametrize
5429f696Stainless Bot2 years ago444def test_method_submit_tool_outputs_with_all_params_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago445with pytest.warns(DeprecationWarning):
446run = client.beta.threads.runs.submit_tool_outputs(
447run_id="run_id",
448thread_id="thread_id",
449tool_outputs=[
450{
451"output": "output",
452"tool_call_id": "tool_call_id",
453}
454],
455stream=False,
456)
457
5429f696Stainless Bot2 years ago458assert_matches_type(Run, run, path=["response"])
459
460@parametrize
461def test_raw_response_submit_tool_outputs_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago462with pytest.warns(DeprecationWarning):
463response = client.beta.threads.runs.with_raw_response.submit_tool_outputs(
464run_id="run_id",
465thread_id="thread_id",
466tool_outputs=[{}],
467)
86379b44Stainless Bot2 years ago468
469assert response.is_closed is True
baa9f07fRobert Craigie2 years ago470assert response.http_request.headers.get("X-Stainless-Lang") == "python"
471run = response.parse()
472assert_matches_type(Run, run, path=["response"])
473
86379b44Stainless Bot2 years ago474@parametrize
5429f696Stainless Bot2 years ago475def test_streaming_response_submit_tool_outputs_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago476with pytest.warns(DeprecationWarning):
477with client.beta.threads.runs.with_streaming_response.submit_tool_outputs(
478run_id="run_id",
479thread_id="thread_id",
480tool_outputs=[{}],
481) as response:
482assert not response.is_closed
483assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago484
cca09707stainless-app[bot]1 years ago485run = response.parse()
486assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago487
488assert cast(Any, response.is_closed) is True
489
023a4e66Stainless Bot2 years ago490@parametrize
5429f696Stainless Bot2 years ago491def test_path_params_submit_tool_outputs_overload_1(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago492with pytest.warns(DeprecationWarning):
493with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
494client.beta.threads.runs.with_raw_response.submit_tool_outputs(
495run_id="run_id",
496thread_id="",
497tool_outputs=[{}],
498)
499
500with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
501client.beta.threads.runs.with_raw_response.submit_tool_outputs(
502run_id="",
503thread_id="thread_id",
504tool_outputs=[{}],
505)
5429f696Stainless Bot2 years ago506
cca09707stainless-app[bot]1 years ago507@parametrize
508def test_method_submit_tool_outputs_overload_2(self, client: OpenAI) -> None:
509with pytest.warns(DeprecationWarning):
510run_stream = client.beta.threads.runs.submit_tool_outputs(
511run_id="run_id",
dd19d4f9Stainless Bot1 years ago512thread_id="thread_id",
cca09707stainless-app[bot]1 years ago513stream=True,
dd19d4f9Stainless Bot1 years ago514tool_outputs=[{}],
5429f696Stainless Bot2 years ago515)
516
517run_stream.response.close()
518
519@parametrize
520def test_raw_response_submit_tool_outputs_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago521with pytest.warns(DeprecationWarning):
522response = client.beta.threads.runs.with_raw_response.submit_tool_outputs(
523run_id="run_id",
524thread_id="thread_id",
525stream=True,
526tool_outputs=[{}],
527)
5429f696Stainless Bot2 years ago528
529assert response.http_request.headers.get("X-Stainless-Lang") == "python"
530stream = response.parse()
531stream.close()
532
533@parametrize
534def test_streaming_response_submit_tool_outputs_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago535with pytest.warns(DeprecationWarning):
536with client.beta.threads.runs.with_streaming_response.submit_tool_outputs(
537run_id="run_id",
538thread_id="thread_id",
539stream=True,
540tool_outputs=[{}],
541) as response:
542assert not response.is_closed
543assert response.http_request.headers.get("X-Stainless-Lang") == "python"
544
545stream = response.parse()
546stream.close()
5429f696Stainless Bot2 years ago547
548assert cast(Any, response.is_closed) is True
549
550@parametrize
551def test_path_params_submit_tool_outputs_overload_2(self, client: OpenAI) -> None:
cca09707stainless-app[bot]1 years ago552with pytest.warns(DeprecationWarning):
553with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
554client.beta.threads.runs.with_raw_response.submit_tool_outputs(
555run_id="run_id",
556thread_id="",
557stream=True,
558tool_outputs=[{}],
559)
560
561with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
562client.beta.threads.runs.with_raw_response.submit_tool_outputs(
563run_id="",
564thread_id="thread_id",
565stream=True,
566tool_outputs=[{}],
567)
023a4e66Stainless Bot2 years ago568
baa9f07fRobert Craigie2 years ago569
570class TestAsyncRuns:
c62e9907stainless-app[bot]1 years ago571parametrize = pytest.mark.parametrize(
572"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
573)
baa9f07fRobert Craigie2 years ago574
575@parametrize
5429f696Stainless Bot2 years ago576async def test_method_create_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago577with pytest.warns(DeprecationWarning):
578run = await async_client.beta.threads.runs.create(
579thread_id="thread_id",
580assistant_id="assistant_id",
581)
582
baa9f07fRobert Craigie2 years ago583assert_matches_type(Run, run, path=["response"])
584
585@parametrize
5429f696Stainless Bot2 years ago586async def test_method_create_with_all_params_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago587with pytest.warns(DeprecationWarning):
588run = await async_client.beta.threads.runs.create(
589thread_id="thread_id",
590assistant_id="assistant_id",
591include=["step_details.tool_calls[*].file_search.results[*].content"],
592additional_instructions="additional_instructions",
593additional_messages=[
594{
595"content": "string",
596"role": "user",
597"attachments": [
598{
599"file_id": "file_id",
600"tools": [{"type": "code_interpreter"}],
601}
602],
603"metadata": {"foo": "string"},
604}
605],
606instructions="instructions",
607max_completion_tokens=256,
608max_prompt_tokens=256,
609metadata={"foo": "string"},
610model="string",
611parallel_tool_calls=True,
caf837bbstainless-app[bot]10 months ago612reasoning_effort="minimal",
cca09707stainless-app[bot]1 years ago613response_format="auto",
614stream=False,
615temperature=1,
616tool_choice="none",
617tools=[{"type": "code_interpreter"}],
618top_p=1,
619truncation_strategy={
620"type": "auto",
621"last_messages": 1,
622},
623)
624
baa9f07fRobert Craigie2 years ago625assert_matches_type(Run, run, path=["response"])
626
627@parametrize
5429f696Stainless Bot2 years ago628async def test_raw_response_create_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago629with pytest.warns(DeprecationWarning):
630response = await async_client.beta.threads.runs.with_raw_response.create(
631thread_id="thread_id",
632assistant_id="assistant_id",
633)
86379b44Stainless Bot2 years ago634
635assert response.is_closed is True
baa9f07fRobert Craigie2 years ago636assert response.http_request.headers.get("X-Stainless-Lang") == "python"
637run = response.parse()
638assert_matches_type(Run, run, path=["response"])
639
86379b44Stainless Bot2 years ago640@parametrize
5429f696Stainless Bot2 years ago641async def test_streaming_response_create_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago642with pytest.warns(DeprecationWarning):
643async with async_client.beta.threads.runs.with_streaming_response.create(
644thread_id="thread_id",
645assistant_id="assistant_id",
646) as response:
647assert not response.is_closed
648assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago649
cca09707stainless-app[bot]1 years ago650run = await response.parse()
651assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago652
653assert cast(Any, response.is_closed) is True
654
023a4e66Stainless Bot2 years ago655@parametrize
5429f696Stainless Bot2 years ago656async def test_path_params_create_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago657with pytest.warns(DeprecationWarning):
658with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
659await async_client.beta.threads.runs.with_raw_response.create(
660thread_id="",
661assistant_id="assistant_id",
662)
023a4e66Stainless Bot2 years ago663
5429f696Stainless Bot2 years ago664@parametrize
665async def test_method_create_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago666with pytest.warns(DeprecationWarning):
667run_stream = await async_client.beta.threads.runs.create(
668thread_id="thread_id",
669assistant_id="assistant_id",
670stream=True,
671)
672
5429f696Stainless Bot2 years ago673await run_stream.response.aclose()
674
675@parametrize
676async def test_method_create_with_all_params_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago677with pytest.warns(DeprecationWarning):
678run_stream = await async_client.beta.threads.runs.create(
679thread_id="thread_id",
680assistant_id="assistant_id",
681stream=True,
682include=["step_details.tool_calls[*].file_search.results[*].content"],
683additional_instructions="additional_instructions",
684additional_messages=[
685{
686"content": "string",
687"role": "user",
688"attachments": [
689{
690"file_id": "file_id",
691"tools": [{"type": "code_interpreter"}],
692}
693],
694"metadata": {"foo": "string"},
695}
696],
697instructions="instructions",
698max_completion_tokens=256,
699max_prompt_tokens=256,
700metadata={"foo": "string"},
701model="string",
702parallel_tool_calls=True,
caf837bbstainless-app[bot]10 months ago703reasoning_effort="minimal",
cca09707stainless-app[bot]1 years ago704response_format="auto",
705temperature=1,
706tool_choice="none",
707tools=[{"type": "code_interpreter"}],
708top_p=1,
709truncation_strategy={
710"type": "auto",
711"last_messages": 1,
712},
713)
714
5429f696Stainless Bot2 years ago715await run_stream.response.aclose()
716
717@parametrize
718async def test_raw_response_create_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago719with pytest.warns(DeprecationWarning):
720response = await async_client.beta.threads.runs.with_raw_response.create(
721thread_id="thread_id",
722assistant_id="assistant_id",
723stream=True,
724)
5429f696Stainless Bot2 years ago725
726assert response.http_request.headers.get("X-Stainless-Lang") == "python"
727stream = response.parse()
728await stream.close()
729
730@parametrize
731async def test_streaming_response_create_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago732with pytest.warns(DeprecationWarning):
733async with async_client.beta.threads.runs.with_streaming_response.create(
734thread_id="thread_id",
735assistant_id="assistant_id",
736stream=True,
737) as response:
738assert not response.is_closed
739assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5429f696Stainless Bot2 years ago740
cca09707stainless-app[bot]1 years ago741stream = await response.parse()
742await stream.close()
5429f696Stainless Bot2 years ago743
744assert cast(Any, response.is_closed) is True
745
746@parametrize
747async def test_path_params_create_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago748with pytest.warns(DeprecationWarning):
749with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
750await async_client.beta.threads.runs.with_raw_response.create(
751thread_id="",
752assistant_id="assistant_id",
753stream=True,
754)
5429f696Stainless Bot2 years ago755
baa9f07fRobert Craigie2 years ago756@parametrize
98d779fbStainless Bot2 years ago757async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago758with pytest.warns(DeprecationWarning):
759run = await async_client.beta.threads.runs.retrieve(
760run_id="run_id",
761thread_id="thread_id",
762)
763
baa9f07fRobert Craigie2 years ago764assert_matches_type(Run, run, path=["response"])
765
766@parametrize
98d779fbStainless Bot2 years ago767async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago768with pytest.warns(DeprecationWarning):
769response = await async_client.beta.threads.runs.with_raw_response.retrieve(
770run_id="run_id",
771thread_id="thread_id",
772)
86379b44Stainless Bot2 years ago773
774assert response.is_closed is True
baa9f07fRobert Craigie2 years ago775assert response.http_request.headers.get("X-Stainless-Lang") == "python"
776run = response.parse()
777assert_matches_type(Run, run, path=["response"])
778
86379b44Stainless Bot2 years ago779@parametrize
98d779fbStainless Bot2 years ago780async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago781with pytest.warns(DeprecationWarning):
782async with async_client.beta.threads.runs.with_streaming_response.retrieve(
783run_id="run_id",
784thread_id="thread_id",
785) as response:
786assert not response.is_closed
787assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago788
cca09707stainless-app[bot]1 years ago789run = await response.parse()
790assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago791
792assert cast(Any, response.is_closed) is True
793
023a4e66Stainless Bot2 years ago794@parametrize
98d779fbStainless Bot2 years ago795async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago796with pytest.warns(DeprecationWarning):
797with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
798await async_client.beta.threads.runs.with_raw_response.retrieve(
799run_id="run_id",
800thread_id="",
801)
023a4e66Stainless Bot2 years ago802
cca09707stainless-app[bot]1 years ago803with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
804await async_client.beta.threads.runs.with_raw_response.retrieve(
805run_id="",
806thread_id="thread_id",
807)
023a4e66Stainless Bot2 years ago808
baa9f07fRobert Craigie2 years ago809@parametrize
98d779fbStainless Bot2 years ago810async def test_method_update(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago811with pytest.warns(DeprecationWarning):
812run = await async_client.beta.threads.runs.update(
813run_id="run_id",
814thread_id="thread_id",
815)
816
baa9f07fRobert Craigie2 years ago817assert_matches_type(Run, run, path=["response"])
818
819@parametrize
98d779fbStainless Bot2 years ago820async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago821with pytest.warns(DeprecationWarning):
822run = await async_client.beta.threads.runs.update(
823run_id="run_id",
824thread_id="thread_id",
825metadata={"foo": "string"},
826)
827
baa9f07fRobert Craigie2 years ago828assert_matches_type(Run, run, path=["response"])
829
830@parametrize
98d779fbStainless Bot2 years ago831async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago832with pytest.warns(DeprecationWarning):
833response = await async_client.beta.threads.runs.with_raw_response.update(
834run_id="run_id",
835thread_id="thread_id",
836)
86379b44Stainless Bot2 years ago837
838assert response.is_closed is True
baa9f07fRobert Craigie2 years ago839assert response.http_request.headers.get("X-Stainless-Lang") == "python"
840run = response.parse()
841assert_matches_type(Run, run, path=["response"])
842
86379b44Stainless Bot2 years ago843@parametrize
98d779fbStainless Bot2 years ago844async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago845with pytest.warns(DeprecationWarning):
846async with async_client.beta.threads.runs.with_streaming_response.update(
847run_id="run_id",
848thread_id="thread_id",
849) as response:
850assert not response.is_closed
851assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago852
cca09707stainless-app[bot]1 years ago853run = await response.parse()
854assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago855
856assert cast(Any, response.is_closed) is True
857
023a4e66Stainless Bot2 years ago858@parametrize
98d779fbStainless Bot2 years ago859async def test_path_params_update(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago860with pytest.warns(DeprecationWarning):
861with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
862await async_client.beta.threads.runs.with_raw_response.update(
863run_id="run_id",
864thread_id="",
865)
023a4e66Stainless Bot2 years ago866
cca09707stainless-app[bot]1 years ago867with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
868await async_client.beta.threads.runs.with_raw_response.update(
869run_id="",
870thread_id="thread_id",
871)
023a4e66Stainless Bot2 years ago872
baa9f07fRobert Craigie2 years ago873@parametrize
98d779fbStainless Bot2 years ago874async def test_method_list(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago875with pytest.warns(DeprecationWarning):
876run = await async_client.beta.threads.runs.list(
877thread_id="thread_id",
878)
879
baa9f07fRobert Craigie2 years ago880assert_matches_type(AsyncCursorPage[Run], run, path=["response"])
881
882@parametrize
98d779fbStainless Bot2 years ago883async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago884with pytest.warns(DeprecationWarning):
885run = await async_client.beta.threads.runs.list(
886thread_id="thread_id",
887after="after",
888before="before",
889limit=0,
890order="asc",
891)
892
baa9f07fRobert Craigie2 years ago893assert_matches_type(AsyncCursorPage[Run], run, path=["response"])
894
895@parametrize
98d779fbStainless Bot2 years ago896async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago897with pytest.warns(DeprecationWarning):
898response = await async_client.beta.threads.runs.with_raw_response.list(
899thread_id="thread_id",
900)
86379b44Stainless Bot2 years ago901
902assert response.is_closed is True
baa9f07fRobert Craigie2 years ago903assert response.http_request.headers.get("X-Stainless-Lang") == "python"
904run = response.parse()
905assert_matches_type(AsyncCursorPage[Run], run, path=["response"])
906
86379b44Stainless Bot2 years ago907@parametrize
98d779fbStainless Bot2 years ago908async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago909with pytest.warns(DeprecationWarning):
910async with async_client.beta.threads.runs.with_streaming_response.list(
911thread_id="thread_id",
912) as response:
913assert not response.is_closed
914assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago915
cca09707stainless-app[bot]1 years ago916run = await response.parse()
917assert_matches_type(AsyncCursorPage[Run], run, path=["response"])
86379b44Stainless Bot2 years ago918
919assert cast(Any, response.is_closed) is True
920
023a4e66Stainless Bot2 years ago921@parametrize
98d779fbStainless Bot2 years ago922async def test_path_params_list(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago923with pytest.warns(DeprecationWarning):
924with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
925await async_client.beta.threads.runs.with_raw_response.list(
926thread_id="",
927)
023a4e66Stainless Bot2 years ago928
baa9f07fRobert Craigie2 years ago929@parametrize
98d779fbStainless Bot2 years ago930async def test_method_cancel(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago931with pytest.warns(DeprecationWarning):
932run = await async_client.beta.threads.runs.cancel(
933run_id="run_id",
934thread_id="thread_id",
935)
936
baa9f07fRobert Craigie2 years ago937assert_matches_type(Run, run, path=["response"])
938
939@parametrize
98d779fbStainless Bot2 years ago940async def test_raw_response_cancel(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago941with pytest.warns(DeprecationWarning):
942response = await async_client.beta.threads.runs.with_raw_response.cancel(
943run_id="run_id",
944thread_id="thread_id",
945)
86379b44Stainless Bot2 years ago946
947assert response.is_closed is True
baa9f07fRobert Craigie2 years ago948assert response.http_request.headers.get("X-Stainless-Lang") == "python"
949run = response.parse()
950assert_matches_type(Run, run, path=["response"])
951
86379b44Stainless Bot2 years ago952@parametrize
98d779fbStainless Bot2 years ago953async def test_streaming_response_cancel(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago954with pytest.warns(DeprecationWarning):
955async with async_client.beta.threads.runs.with_streaming_response.cancel(
956run_id="run_id",
957thread_id="thread_id",
958) as response:
959assert not response.is_closed
960assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago961
cca09707stainless-app[bot]1 years ago962run = await response.parse()
963assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago964
965assert cast(Any, response.is_closed) is True
966
023a4e66Stainless Bot2 years ago967@parametrize
98d779fbStainless Bot2 years ago968async def test_path_params_cancel(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago969with pytest.warns(DeprecationWarning):
970with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
971await async_client.beta.threads.runs.with_raw_response.cancel(
972run_id="run_id",
973thread_id="",
974)
023a4e66Stainless Bot2 years ago975
cca09707stainless-app[bot]1 years ago976with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
977await async_client.beta.threads.runs.with_raw_response.cancel(
978run_id="",
979thread_id="thread_id",
980)
023a4e66Stainless Bot2 years ago981
baa9f07fRobert Craigie2 years ago982@parametrize
5429f696Stainless Bot2 years ago983async def test_method_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago984with pytest.warns(DeprecationWarning):
985run = await async_client.beta.threads.runs.submit_tool_outputs(
986run_id="run_id",
987thread_id="thread_id",
988tool_outputs=[{}],
989)
990
baa9f07fRobert Craigie2 years ago991assert_matches_type(Run, run, path=["response"])
992
993@parametrize
5429f696Stainless Bot2 years ago994async def test_method_submit_tool_outputs_with_all_params_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago995with pytest.warns(DeprecationWarning):
996run = await async_client.beta.threads.runs.submit_tool_outputs(
997run_id="run_id",
998thread_id="thread_id",
999tool_outputs=[
1000{
1001"output": "output",
1002"tool_call_id": "tool_call_id",
1003}
1004],
1005stream=False,
1006)
1007
5429f696Stainless Bot2 years ago1008assert_matches_type(Run, run, path=["response"])
1009
1010@parametrize
1011async def test_raw_response_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago1012with pytest.warns(DeprecationWarning):
1013response = await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs(
1014run_id="run_id",
1015thread_id="thread_id",
1016tool_outputs=[{}],
1017)
86379b44Stainless Bot2 years ago1018
1019assert response.is_closed is True
baa9f07fRobert Craigie2 years ago1020assert response.http_request.headers.get("X-Stainless-Lang") == "python"
1021run = response.parse()
1022assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago1023
1024@parametrize
5429f696Stainless Bot2 years ago1025async def test_streaming_response_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago1026with pytest.warns(DeprecationWarning):
1027async with async_client.beta.threads.runs.with_streaming_response.submit_tool_outputs(
1028run_id="run_id",
1029thread_id="thread_id",
1030tool_outputs=[{}],
1031) as response:
1032assert not response.is_closed
1033assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86379b44Stainless Bot2 years ago1034
cca09707stainless-app[bot]1 years ago1035run = await response.parse()
1036assert_matches_type(Run, run, path=["response"])
86379b44Stainless Bot2 years ago1037
1038assert cast(Any, response.is_closed) is True
023a4e66Stainless Bot2 years ago1039
1040@parametrize
5429f696Stainless Bot2 years ago1041async def test_path_params_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago1042with pytest.warns(DeprecationWarning):
1043with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
1044await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs(
1045run_id="run_id",
1046thread_id="",
1047tool_outputs=[{}],
1048)
1049
1050with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
1051await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs(
1052run_id="",
1053thread_id="thread_id",
1054tool_outputs=[{}],
1055)
5429f696Stainless Bot2 years ago1056
cca09707stainless-app[bot]1 years ago1057@parametrize
1058async def test_method_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None:
1059with pytest.warns(DeprecationWarning):
1060run_stream = await async_client.beta.threads.runs.submit_tool_outputs(
1061run_id="run_id",
dd19d4f9Stainless Bot1 years ago1062thread_id="thread_id",
cca09707stainless-app[bot]1 years ago1063stream=True,
dd19d4f9Stainless Bot1 years ago1064tool_outputs=[{}],
5429f696Stainless Bot2 years ago1065)
1066
1067await run_stream.response.aclose()
1068
1069@parametrize
1070async def test_raw_response_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago1071with pytest.warns(DeprecationWarning):
1072response = await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs(
1073run_id="run_id",
1074thread_id="thread_id",
1075stream=True,
1076tool_outputs=[{}],
1077)
5429f696Stainless Bot2 years ago1078
1079assert response.http_request.headers.get("X-Stainless-Lang") == "python"
1080stream = response.parse()
1081await stream.close()
1082
1083@parametrize
1084async def test_streaming_response_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago1085with pytest.warns(DeprecationWarning):
1086async with async_client.beta.threads.runs.with_streaming_response.submit_tool_outputs(
1087run_id="run_id",
1088thread_id="thread_id",
1089stream=True,
1090tool_outputs=[{}],
1091) as response:
1092assert not response.is_closed
1093assert response.http_request.headers.get("X-Stainless-Lang") == "python"
1094
1095stream = await response.parse()
1096await stream.close()
5429f696Stainless Bot2 years ago1097
1098assert cast(Any, response.is_closed) is True
1099
1100@parametrize
1101async def test_path_params_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None:
cca09707stainless-app[bot]1 years ago1102with pytest.warns(DeprecationWarning):
1103with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"):
1104await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs(
1105run_id="run_id",
1106thread_id="",
1107stream=True,
1108tool_outputs=[{}],
1109)
1110
1111with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
1112await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs(
1113run_id="",
1114thread_id="thread_id",
1115stream=True,
1116tool_outputs=[{}],
1117)