Skip to content

Commit 2b83eee

Browse files
committed
fix type error
1 parent c76f858 commit 2b83eee

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/agents/extensions/models/any_llm_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import importlib
34
import inspect
45
import json
56
import time
@@ -48,7 +49,7 @@
4849
from ...util._json import _to_dump_compatible
4950

5051
try:
51-
from any_llm import AnyLLM # type: ignore[import-not-found]
52+
AnyLLM = importlib.import_module("any_llm").AnyLLM
5253
except ImportError as _e:
5354
raise ImportError(
5455
"`any-llm-sdk` is required to use the AnyLLMModel. Install it via the optional "
@@ -1087,12 +1088,11 @@ async def _call_any_llm_responses(
10871088
@staticmethod
10881089
def _make_any_llm_responses_params(payload: dict[str, Any]) -> Any:
10891090
try:
1090-
from any_llm.types.responses import ( # type: ignore[import-not-found]
1091-
ResponsesParams as AnyLLMResponsesParams,
1092-
)
1091+
any_llm_responses = importlib.import_module("any_llm.types.responses")
10931092
except ImportError:
10941093
return _AnyLLMResponsesParamsShim(**payload)
10951094

1095+
AnyLLMResponsesParams = any_llm_responses.ResponsesParams
10961096
return AnyLLMResponsesParams(**payload)
10971097

10981098
def _remove_openai_responses_api_incompatible_fields(self, list_input: list[Any]) -> list[Any]:

0 commit comments

Comments
 (0)