Skip to content

chore(examples): minor formatting changes #1644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/api_resources/beta/test_assistants.py
Original file line number Diff line number Diff line change
@@ -44,8 +44,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
@@ -276,8 +276,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
56 changes: 28 additions & 28 deletions tests/api_resources/beta/test_threads.py
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
thread = client.beta.threads.create(
messages=[
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -62,8 +62,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -93,8 +93,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -131,8 +131,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
@@ -310,8 +310,8 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI)
thread={
"messages": [
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -341,8 +341,8 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI)
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -372,8 +372,8 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI)
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -403,20 +403,20 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI)
"metadata": {},
},
],
"metadata": {},
"tool_resources": {
"code_interpreter": {"file_ids": ["string", "string", "string"]},
"file_search": {
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
},
},
"metadata": {},
},
tool_choice="none",
tool_resources={
@@ -480,8 +480,8 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI)
thread={
"messages": [
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -511,8 +511,8 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI)
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -542,8 +542,8 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI)
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -573,20 +573,20 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI)
"metadata": {},
},
],
"metadata": {},
"tool_resources": {
"code_interpreter": {"file_ids": ["string", "string", "string"]},
"file_search": {
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
},
},
"metadata": {},
},
tool_choice="none",
tool_resources={
@@ -641,8 +641,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
thread = await async_client.beta.threads.create(
messages=[
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -672,8 +672,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -703,8 +703,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -741,8 +741,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
@@ -920,8 +920,8 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie
thread={
"messages": [
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -951,8 +951,8 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -982,8 +982,8 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -1013,20 +1013,20 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie
"metadata": {},
},
],
"metadata": {},
"tool_resources": {
"code_interpreter": {"file_ids": ["string", "string", "string"]},
"file_search": {
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
},
},
"metadata": {},
},
tool_choice="none",
tool_resources={
@@ -1090,8 +1090,8 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie
thread={
"messages": [
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -1121,8 +1121,8 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -1152,8 +1152,8 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -1183,20 +1183,20 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie
"metadata": {},
},
],
"metadata": {},
"tool_resources": {
"code_interpreter": {"file_ids": ["string", "string", "string"]},
"file_search": {
"vector_store_ids": ["string"],
"vector_stores": [
{
"file_ids": ["string", "string", "string"],
"chunking_strategy": {"type": "auto"},
"file_ids": ["string", "string", "string"],
"metadata": {},
}
],
},
},
"metadata": {},
},
tool_choice="none",
tool_resources={
36 changes: 18 additions & 18 deletions tests/api_resources/beta/threads/test_runs.py
Original file line number Diff line number Diff line change
@@ -36,8 +36,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None:
additional_instructions="additional_instructions",
additional_messages=[
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -67,8 +67,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None:
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -98,8 +98,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None:
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -200,8 +200,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None:
additional_instructions="additional_instructions",
additional_messages=[
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -231,8 +231,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None:
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -262,8 +262,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None:
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -565,16 +565,16 @@ def test_method_submit_tool_outputs_with_all_params_overload_1(self, client: Ope
thread_id="thread_id",
tool_outputs=[
{
"tool_call_id": "tool_call_id",
"output": "output",
"tool_call_id": "tool_call_id",
},
{
"tool_call_id": "tool_call_id",
"output": "output",
"tool_call_id": "tool_call_id",
},
{
"tool_call_id": "tool_call_id",
"output": "output",
"tool_call_id": "tool_call_id",
},
],
stream=False,
@@ -702,8 +702,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
additional_instructions="additional_instructions",
additional_messages=[
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -733,8 +733,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -764,8 +764,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -866,8 +866,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
additional_instructions="additional_instructions",
additional_messages=[
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -897,8 +897,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -928,8 +928,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
"metadata": {},
},
{
"role": "user",
"content": "string",
"role": "user",
"attachments": [
{
"file_id": "file_id",
@@ -1231,16 +1231,16 @@ async def test_method_submit_tool_outputs_with_all_params_overload_1(self, async
thread_id="thread_id",
tool_outputs=[
{
"tool_call_id": "tool_call_id",
"output": "output",
"tool_call_id": "tool_call_id",
},
{
"tool_call_id": "tool_call_id",
"output": "output",
"tool_call_id": "tool_call_id",
},
{
"tool_call_id": "tool_call_id",
"output": "output",
"tool_call_id": "tool_call_id",
},
],
stream=False,
56 changes: 28 additions & 28 deletions tests/api_resources/chat/test_completions.py
Original file line number Diff line number Diff line change
@@ -47,8 +47,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None:
function_call="none",
functions=[
{
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
}
],
@@ -68,31 +68,31 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None:
tool_choice="none",
tools=[
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
],
top_logprobs=0,
@@ -167,8 +167,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None:
function_call="none",
functions=[
{
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
}
],
@@ -187,31 +187,31 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None:
tool_choice="none",
tools=[
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
],
top_logprobs=0,
@@ -289,8 +289,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
function_call="none",
functions=[
{
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
}
],
@@ -310,31 +310,31 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
tool_choice="none",
tools=[
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
],
top_logprobs=0,
@@ -409,8 +409,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
function_call="none",
functions=[
{
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
}
],
@@ -429,31 +429,31 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
tool_choice="none",
tools=[
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
{
"type": "function",
"function": {
"description": "description",
"name": "name",
"description": "description",
"parameters": {"foo": "bar"},
"strict": True,
},
"type": "function",
},
],
top_logprobs=0,
12 changes: 6 additions & 6 deletions tests/api_resources/fine_tuning/test_jobs.py
Original file line number Diff line number Diff line change
@@ -44,26 +44,26 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
"type": "wandb",
"wandb": {
"project": "my-wandb-project",
"name": "name",
"entity": "entity",
"name": "name",
"tags": ["custom-tag", "custom-tag", "custom-tag"],
},
},
{
"type": "wandb",
"wandb": {
"project": "my-wandb-project",
"name": "name",
"entity": "entity",
"name": "name",
"tags": ["custom-tag", "custom-tag", "custom-tag"],
},
},
{
"type": "wandb",
"wandb": {
"project": "my-wandb-project",
"name": "name",
"entity": "entity",
"name": "name",
"tags": ["custom-tag", "custom-tag", "custom-tag"],
},
},
@@ -283,26 +283,26 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
"type": "wandb",
"wandb": {
"project": "my-wandb-project",
"name": "name",
"entity": "entity",
"name": "name",
"tags": ["custom-tag", "custom-tag", "custom-tag"],
},
},
{
"type": "wandb",
"wandb": {
"project": "my-wandb-project",
"name": "name",
"entity": "entity",
"name": "name",
"tags": ["custom-tag", "custom-tag", "custom-tag"],
},
},
{
"type": "wandb",
"wandb": {
"project": "my-wandb-project",
"name": "name",
"entity": "entity",
"name": "name",
"tags": ["custom-tag", "custom-tag", "custom-tag"],
},
},
12 changes: 6 additions & 6 deletions tests/api_resources/test_images.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ def test_method_create_variation_with_all_params(self, client: OpenAI) -> None:
model="dall-e-2",
n=1,
response_format="url",
size="1024x1024",
size="256x256",
user="user-1234",
)
assert_matches_type(ImagesResponse, image, path=["response"])
@@ -77,7 +77,7 @@ def test_method_edit_with_all_params(self, client: OpenAI) -> None:
model="dall-e-2",
n=1,
response_format="url",
size="1024x1024",
size="256x256",
user="user-1234",
)
assert_matches_type(ImagesResponse, image, path=["response"])
@@ -123,7 +123,7 @@ def test_method_generate_with_all_params(self, client: OpenAI) -> None:
n=1,
quality="standard",
response_format="url",
size="1024x1024",
size="256x256",
style="vivid",
user="user-1234",
)
@@ -171,7 +171,7 @@ async def test_method_create_variation_with_all_params(self, async_client: Async
model="dall-e-2",
n=1,
response_format="url",
size="1024x1024",
size="256x256",
user="user-1234",
)
assert_matches_type(ImagesResponse, image, path=["response"])
@@ -217,7 +217,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncOpenAI) -> N
model="dall-e-2",
n=1,
response_format="url",
size="1024x1024",
size="256x256",
user="user-1234",
)
assert_matches_type(ImagesResponse, image, path=["response"])
@@ -263,7 +263,7 @@ async def test_method_generate_with_all_params(self, async_client: AsyncOpenAI)
n=1,
quality="standard",
response_format="url",
size="1024x1024",
size="256x256",
style="vivid",
user="user-1234",
)