Skip to content

Commit 144ea92

Browse files
committed
Fix mypy tests
1 parent 09dc9ce commit 144ea92

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/assistants/test_assistants.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# pylint: disable=protected-access
22
from __future__ import annotations
33

4+
from typing import Any
5+
46
import pytest
57

68
from yandex_cloud_ml_sdk import AsyncYCloudML
@@ -34,6 +36,8 @@ async def test_assistant_common(async_sdk: AsyncYCloudML, tool):
3436
assistant = await async_sdk.assistants.create('yandexgpt')
3537
assistants = [assistant]
3638

39+
value: Any
40+
3741
for field, value in (
3842
('name', 'name'),
3943
('description', 'description'),
@@ -44,7 +48,7 @@ async def test_assistant_common(async_sdk: AsyncYCloudML, tool):
4448
assert getattr(assistant, field) is None
4549

4650
new_assistant = await assistant.update(
47-
**{field: value}
51+
**{field: value} # type: ignore[arg-type]
4852
)
4953
assert new_assistant is assistant
5054

@@ -93,7 +97,7 @@ async def test_assistant_common(async_sdk: AsyncYCloudML, tool):
9397
assert assistant.model.config.max_tokens is None
9498

9599
await assistant.update(max_tokens=50)
96-
assert assistant.model.config.temperature == 0.5
100+
assert assistant.model.config.temperature == 1.5
97101
assert assistant.model.config.max_tokens == 50
98102

99103
model = model.configure(max_tokens=100, temperature=1)

tests/assistants/test_run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ async def test_custom_run_options(async_sdk: AsyncYCloudML):
139139
assert run.custom_temperature == 0.0
140140
assert run.custom_max_tokens == 100
141141
assert run.custom_max_prompt_tokens == 200
142+
assert run.custom_prompt_truncation_options
142143
assert run.custom_prompt_truncation_options.strategy == AutoPromptTruncationStrategy()
143144

144145
result = await run
@@ -152,6 +153,7 @@ async def test_custom_run_options(async_sdk: AsyncYCloudML):
152153
assert run.custom_temperature == 0.0
153154
assert run.custom_max_tokens is None
154155
assert run.custom_max_prompt_tokens is None
156+
assert run.custom_prompt_truncation_options
155157
assert run.custom_prompt_truncation_options.strategy == LastMessagesPromptTruncationStrategy(num_messages=10)
156158

157159
result = await run

0 commit comments

Comments
 (0)