8000 openai - move client attribute definition · strands-agents/sdk-python@8b61d5b · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b61d5b

Browse files
committed
openai - move client attribute definition
1 parent 11cda87 commit 8b61d5b

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/strands/models/openai.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
import logging
7-
from typing import Any, Iterable, Optional, TypedDict, cast
7+
from typing import Any, Iterable, Optional, Protocol, TypedDict, cast
88

99
import openai
1010
from typing_extensions import Unpack, override
@@ -14,9 +14,17 @@
1414
logger = logging.getLogger(__name__)
1515

1616

17+
class Client(Protocol):
18+
"""Protocol defining the OpenAI-compatible interface for the underlying provider client."""
19+
20+
chat: Any
21+
22+
1723
class OpenAIModel(SAOpenAIModel):
1824
"""OpenAI model provider implementation."""
1925

26+
client: Client
27+
2028
class OpenAIConfig(TypedDict, total=False):
2129
"""Configuration options for OpenAI models.
2230

src/strands/types/models/openai.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import json
1111
import logging
1212
import mimetypes
13-
from typing import Any, Optional, Protocol
13+
from typing import Any, Optional
1414

1515
from typing_extensions import override
1616

@@ -22,19 +22,12 @@
2222
logger = logging.getLogger(__name__)
2323

2424

25-
class Client(Protocol):
26-
"""Protocol defining the OpenAI-compatible interface for the underlying provider client."""
27-
28-
chat: Any
29-
30-
3125
class OpenAIModel(Model, abc.ABC):
3226
"""Base OpenAI model provider implementation.
3327
3428
Implements shared logic for formatting requests and responses to and from the OpenAI specification.
3529
"""
3630

37-
client: Client
3831
config: dict[str, Any]
3932

4033
@staticmethod

0 commit comments

Comments
 (0)
0