| @@ -1,6 +1,5 @@ | |||
| import os | |||
| from collections.abc import Iterable | |||
| from time import sleep | |||
| from typing import Any, Literal, Union | |||
| import anthropic | |||
| @@ -64,7 +63,6 @@ class MockAnthropicClass: | |||
| index = 0 | |||
| for i in range(0, len(full_response_text)): | |||
| sleep(0.1) | |||
| yield ContentBlockDeltaEvent( | |||
| type='content_block_delta', | |||
| delta=TextDelta(text=full_response_text[i], type='text_delta'), | |||
| @@ -1,7 +1,7 @@ | |||
| import re | |||
| from collections.abc import Generator | |||
| from json import dumps, loads | |||
| from time import sleep, time | |||
| from time import time | |||
| # import monkeypatch | |||
| from typing import Any, Literal, Optional, Union | |||
| @@ -112,7 +112,6 @@ class MockChatClass: | |||
| if not function_call: | |||
| tool_calls = MockChatClass.generate_tool_calls(tools=tools) | |||
| sleep(1) | |||
| return _ChatCompletion( | |||
| id='cmpl-3QJQa5jXJ5Z5X', | |||
| choices=[ | |||
| @@ -151,7 +150,6 @@ class MockChatClass: | |||
| full_text = "Hello, world!\n\n```python\nprint('Hello, world!')\n```" | |||
| for i in range(0, len(full_text) + 1): | |||
| sleep(0.1) | |||
| if i == len(full_text): | |||
| yield ChatCompletionChunk( | |||
| id='cmpl-3QJQa5jXJ5Z5X', | |||
| @@ -1,6 +1,6 @@ | |||
| import re | |||
| from collections.abc import Generator | |||
| from time import sleep, time | |||
| from time import time | |||
| # import monkeypatch | |||
| from typing import Any, Literal, Optional, Union | |||
| @@ -20,7 +20,6 @@ class MockCompletionsClass: | |||
| def mocked_openai_completion_create_sync( | |||
| model: str | |||
| ) -> CompletionMessage: | |||
| sleep(1) | |||
| return CompletionMessage( | |||
| id="cmpl-3QJQa5jXJ5Z5X", | |||
| object="text_completion", | |||
| @@ -48,7 +47,6 @@ class MockCompletionsClass: | |||
| ) -> Generator[CompletionMessage, None, None]: | |||
| full_text = "Hello, world!\n\n```python\nprint('Hello, world!')\n```" | |||
| for i in range(0, len(full_text) + 1): | |||
| sleep(0.1) | |||
| if i == len(full_text): | |||
| yield CompletionMessage( | |||
| id="cmpl-3QJQa5jXJ5Z5X", | |||