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

Old Document Issues #567

Open
minomizuha opened this issue Aug 30, 2024 · 1 comment
Open

Old Document Issues #567

minomizuha opened this issue Aug 30, 2024 · 1 comment

Comments

@minomizuha
Copy link

minomizuha commented Aug 30, 2024

for event in stream:
    if event.event_type == "text-generation":
        print(event.text, end='')

Then, apparently, I will throw up an error.
It worked when I made it look like the following, but is the document still old...?
You don't have to reply, but please confirm when you have time.

if stream and hasattr(response, 'text'):
     generated_text = response.text
else:
     generated_text = "Error: The expected response was not returned. "

By any chance, if was the problem...?
Is it probably like this?

if stream and hasattr(response, 'text'):
     generated_text = response.text
else:
     generated_text = "Error: The expected response was not returned. "
print(generated_text)
@mkozakov
Copy link
Collaborator

hey @minomizuha sorry for the delay. i'm having trouble understanding your question, can you please share a complete code snippet and the error message that you're seeing? events of type text-generation will always have text in them, i'm not sure why you were seeing an error

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

No branches or pull requests

2 participants