from together import Together
client = Together()
stream = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3.1",
messages=[
{
"role": "user",
"content": "What are some fun things to do in New York?",
}
],
reasoning={"enabled": True},
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta
# Show reasoning tokens if present
if hasattr(delta, "reasoning") and delta.reasoning:
print(delta.reasoning, end="", flush=True)
# Show content tokens if present
if hasattr(delta, "content") and delta.content:
print(delta.content, end="", flush=True)