Skip to content

Commit 06b416c

Browse files
mergify[bot]github-actions[bot]
authored andcommitted
[Mega-Linter] Apply linters fixes
1 parent 8fb1f17 commit 06b416c

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

tests/mlmodel_openai/conftest.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import pytest
1616
from openai.util import convert_to_openai_object
17-
1817
from testing_support.fixtures import ( # noqa: F401, pylint: disable=W0611
1918
collector_agent_registration_fixture,
2019
collector_available_fixture,
@@ -42,21 +41,14 @@ def openai_chat_completion_dict():
4241
{
4342
"finish_reason": "stop",
4443
"index": 0,
45-
"message": {
46-
"content": "212 degrees Fahrenheit is 100 degrees Celsius.",
47-
"role": "assistant"
48-
}
44+
"message": {"content": "212 degrees Fahrenheit is 100 degrees Celsius.", "role": "assistant"},
4945
}
5046
],
5147
"created": 1676917710,
5248
"id": "some-test-id-123456789",
5349
"model": "gpt-3.5-turbo-0613",
5450
"object": "chat.completion",
55-
"usage": {
56-
"completion_tokens": 7,
57-
"prompt_tokens": 3,
58-
"total_tokens": 10
59-
},
51+
"usage": {"completion_tokens": 7, "prompt_tokens": 3, "total_tokens": 10},
6052
}
6153

6254

@@ -70,15 +62,12 @@ def openai_embedding_dict():
7062
-0.005336422007530928,
7163
],
7264
"index": 0,
73-
"object": "embedding"
65+
"object": "embedding",
7466
}
7567
],
7668
"model": "text-embedding-ada-002",
7769
"object": "list",
78-
"usage": {
79-
"prompt_tokens": 5,
80-
"total_tokens": 5
81-
}
70+
"usage": {"prompt_tokens": 5, "total_tokens": 5},
8271
}
8372

8473

tests/mlmodel_openai/test_chat_completion.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def run_openai_chat_completion_sync():
2525
{"role": "user", "content": "What is the boiling point of water?"},
2626
{"role": "assistant", "content": "The boiling point of water is 212 degrees Fahrenheit."},
2727
{"role": "user", "content": "What is 212 degrees Fahrenheit converted to Celsius?"},
28-
]
28+
],
2929
)
3030

3131

@@ -36,8 +36,11 @@ def run_openai_chat_completion_async():
3636
messages=[
3737
{"role": "system", "content": "You are a scientist."},
3838
{"role": "user", "content": "What is the boiling point of water?"},
39-
{"role": "assistant", "content": "The boiling point of water is 212 degrees Fahrenheit or 100 degrees Celsius."},
40-
]
39+
{
40+
"role": "assistant",
41+
"content": "The boiling point of water is 212 degrees Fahrenheit or 100 degrees Celsius.",
42+
},
43+
],
4144
)
4245

4346

0 commit comments

Comments
 (0)