Spaces:
Running
Running
File size: 348 Bytes
6ff1f88 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import cohere
co = cohere.ClientV2(api_key='NYEQhh6CwVF3dCo57n25032m4s0FurCYI73IYWb5')
response = co.chat_stream(
model="command-r-plus-08-2024",
messages=[{"role": "user", "content": "write a story about a drogon"}],
)
for event in response:
if event.type == "content-delta":
print(event.delta.message.content.text, end="")
|