Humanoids / tests /test_keys.py
MuhammedSuhaib's picture
Upload folder using huggingface_hub
f5b0cd7 verified
Raw
History Blame Contribute Delete
511 Bytes
from dotenv import load_dotenv
from openai import AsyncOpenAI
import os
import asyncio
load_dotenv()
client = AsyncOpenAI(
api_key=os.getenv("QWEN_API_KEY"),
base_url="https://portal.qwen.ai/v1"
)
async def test():
try:
r = await client.chat.completions.create(
model="qwen3-coder-plus",
messages=[{"role": "user", "content": "ping"}]
)
print(r.choices[0].message.content)
except Exception as e:
print("ERROR:", e)
asyncio.run(test())