Skip to content

Commit 1b29839

Browse files
committed
Import type in TYPE_CHECKING gate
1 parent 4440a04 commit 1b29839

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sentry_sdk/integrations/openai.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
from sentry_sdk.utils import logger, capture_internal_exceptions
1313

1414
try:
15-
from openai.types.chat import ChatCompletionChunk
1615
from openai.resources.chat.completions import Completions
1716
from openai.resources import Embeddings
1817

1918
if TYPE_CHECKING:
20-
from openai.types.chat import ChatCompletionMessageParam
19+
from openai.types.chat import ChatCompletionMessageParam, ChatCompletionChunk
2120
except ImportError:
2221
raise DidNotEnable("OpenAI not installed")
2322

@@ -129,7 +128,7 @@ def new_chat_completion(*args, **kwargs):
129128
kwargs["messages"] = list(kwargs["messages"])
130129
messages = kwargs["messages"]
131130
model = kwargs.get("model")
132-
streaming = kwargs.get("stream") # TODO handle streaming
131+
streaming = kwargs.get("stream")
133132

134133
span = hub.start_span(op="openai", description="Chat Completion")
135134
span.__enter__()

0 commit comments

Comments
 (0)