cohere-python
cohere-python copied to clipboard
Old Document Issues
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)