Skip to content

Commit

Permalink
fix: functions must use AsyncGenerator type or no type
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmogBaku committed Sep 27, 2023
1 parent 5cf4ba0 commit 1d9f73b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
paths:
- '**.py'
- '!**/tests/**'
workflow_dispatch: ~

permissions:
Expand Down
2 changes: 1 addition & 1 deletion tests/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import openai
import asyncio
from openai_streaming import process_response
from typing import Generator, AsyncGenerator
from typing import AsyncGenerator
from openai_streaming import openai_streaming_function

# Initialize API key
Expand Down
4 changes: 2 additions & 2 deletions tests/test_with_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import openai
from unittest.mock import patch
from openai_streaming import process_response, openai_streaming_function
from typing import Generator, AsyncGenerator
from typing import AsyncGenerator


async def content_handler(content: Generator[str, None, None]):
async def content_handler(content: AsyncGenerator[str, None]):
async for token in content:
print(token, end="")

Expand Down

0 comments on commit 1d9f73b

Please sign in to comment.