Skip to content
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

fix openai get token method #373

Merged
merged 2 commits into from
Aug 24, 2023
Merged

fix openai get token method #373

merged 2 commits into from
Aug 24, 2023

Conversation

Kian1354
Copy link
Collaborator

No description provided.

@@ -74,6 +74,8 @@ async def collate_response_async(
async def openai_get_tokens(gen) -> AsyncGenerator[Union[str, FunctionFragment], None]:
async for event in gen:
choices = event.get("choices", [])
if event.get("prompt_annotations", []):
continue
if len(choices) == 0:
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just continue here

@ajar98 ajar98 merged commit 456140c into main Aug 24, 2023
4 checks passed
m5a0r7 pushed a commit to m5a0r7/vocode-python that referenced this pull request Oct 19, 2023
* fix openai get token method

* use continue and update tests

---------

Co-authored-by: Ajay Raj <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants