Spaces:
Runtime error

File size: 453 Bytes
1faec4c
58df5de
5f7afc8
58df5de
 
 
1faec4c
5f7afc8
58df5de
 
 
 
 
1fd97e3
 
58df5de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://router.huggingface.co/v1",
    api_key=os.environ.get("HF_TOKEN") # Must have "Make calls to Inference Providers" permission
)

response = client.chat.completions.create(
    model="Qwen/Qwen2.5-Coder-32B-Instruct",
    messages=[
        {"role": "user", "content": "Write a quick PHP function to sanitize database inputs."}
    ]
)

print(response.choices[0].message.content)