cohere-python icon indicating copy to clipboard operation
cohere-python copied to clipboard

Old Document Issues

Open sisiruirui-sisi opened this issue 6 months ago • 0 comments

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)

sisiruirui-sisi avatar Aug 30 '24 21:08 sisiruirui-sisi