@UAPSTARBUG.Ai

#1
by SAKSRI - opened

๐Ÿ˜ƒ: What were the main causes of World War I?import os
from openai import OpenAI

client = OpenAI(
base_url="https://router.huggingface.co/v1",
api_key=os.environ["HF_TOKEN"],
)

stream = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[
{
"role": "user",
"content": "What is the capital of France?"
}
],
stream=True,
)

for chunk in stream:
print(chunk.choices[0].delta.content, end="")

Sign up or log in to comment