|
3 | 3 | import os |
4 | 4 | from collections.abc import Generator |
5 | 5 | from pathlib import Path |
6 | | -from typing import Any |
| 6 | +from typing import Any, Optional |
7 | 7 |
|
8 | 8 | import pytest |
9 | 9 | from fastapi import Request, Response |
|
48 | 48 | def create_mock_llm_response( # pylint: disable=too-many-arguments,too-many-positional-arguments |
49 | 49 | mocker: MockerFixture, |
50 | 50 | content: str = "This is a test response about Ansible.", |
51 | | - tool_calls: list[Any] | None = None, |
52 | | - refusal: str | None = None, |
| 51 | + tool_calls: Optional[list[Any]] = None, |
| 52 | + refusal: Optional[str] = None, |
53 | 53 | input_tokens: int = 10, |
54 | 54 | output_tokens: int = 5, |
55 | 55 | ) -> Any: |
@@ -98,7 +98,7 @@ def create_mock_llm_response( # pylint: disable=too-many-arguments,too-many-pos |
98 | 98 |
|
99 | 99 | def create_mock_vector_store_response( |
100 | 100 | mocker: MockerFixture, |
101 | | - chunks: list[dict[str, Any]] | None = None, |
| 101 | + chunks: Optional[list[dict[str, Any]]] = None, |
102 | 102 | ) -> Any: |
103 | 103 | """Create a mock vector store response. |
104 | 104 |
|
@@ -130,7 +130,7 @@ def create_mock_vector_store_response( |
130 | 130 | def create_mock_tool_call( |
131 | 131 | mocker: MockerFixture, |
132 | 132 | tool_name: str = "test_tool", |
133 | | - arguments: dict[str, Any] | None = None, |
| 133 | + arguments: Optional[dict[str, Any]] = None, |
134 | 134 | call_id: str = "call-123", |
135 | 135 | ) -> Any: |
136 | 136 | """Create a mock tool call. |
|
0 commit comments