-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/async #85
Feat/async #85
Conversation
except httpx.HTTPStatusError as err: # 4xx and 5xx errors | ||
# If the response is streamed then we need to explicitly read the response | ||
# to completion before attempting to access the response text. | ||
err.response.read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might have to be changed to its async version
await err.response.aread()
other wise it raises an exception when the API responds with an error code
tests/test_async_complete.py
Outdated
class TestChatCompletions: | ||
client = AsyncPortkey | ||
parametrize = pytest.mark.parametrize("client", [client], ids=["strict"]) | ||
models = read_json_file("./models.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be ./tests/models.json
Closes #33 |
Title: Async Support
Description:
To use instead of importing Portkey, we will have to import AsyncPortkey
This matches the convention of OpenAI, instead of OpenAI, we import AsyncOpenAI to async calls of the SDK
Motivation:
Allows the users to make Async calls for chat, complete and embedding
Related Issues:
#33