Only one thing that's weird. Without EcoLogits being initialized, this piece of code
client = cohere.AsyncClient()
stream = await client.chat_stream(
message="Tell me a short story",
model="command-light",
max_tokens=50
)
async for event in stream:
if event.event_type == "text-generation":
print(event.text, end='')
throws the error TypeError: object async_generator can't be used in 'await' expression, but works without the await before client.chat_stream. I couldn't find any async stream example, and I'm not familiar with async in Python, so I left it without the await.
See https://github.com/dataforgoodfr/12_genai_impact/issues/27
Only one thing that's weird. Without EcoLogits being initialized, this piece of code
throws the error
TypeError: object async_generator can't be used in 'await' expression
, but works without theawait
beforeclient.chat_stream
. I couldn't find any async stream example, and I'm not familiar with async in Python, so I left it without theawait
.