Skip to content

Commit 1d9f73b

Browse files
committed
fix: functions must use AsyncGenerator type or no type
1 parent 5cf4ba0 commit 1d9f73b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

.github/workflows/publish.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
paths:
66
- '**.py'
7-
- '!**/tests/**'
87
workflow_dispatch: ~
98

109
permissions:

tests/example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import openai
44
import asyncio
55
from openai_streaming import process_response
6-
from typing import Generator, AsyncGenerator
6+
from typing import AsyncGenerator
77
from openai_streaming import openai_streaming_function
88

99
# Initialize API key

tests/test_with_functions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import openai
66
from unittest.mock import patch
77
from openai_streaming import process_response, openai_streaming_function
8-
from typing import Generator, AsyncGenerator
8+
from typing import AsyncGenerator
99

1010

11-
async def content_handler(content: Generator[str, None, None]):
11+
async def content_handler(content: AsyncGenerator[str, None]):
1212
async for token in content:
1313
print(token, end="")
1414

0 commit comments

Comments
 (0)