Spaces:
Runtime error
Runtime error
| import os | |
| from openai import OpenAI | |
| client = OpenAI( | |
| base_url="https://router.huggingface.co/v1", | |
| api_key=os.environ["hf_secret"], | |
| ) | |
| completion = client.chat.completions.create( | |
| model="dphn/dolphin-2.9.1-llama-3-8b:featherless-ai", | |
| messages=[ | |
| { | |
| "role": "user", | |
| "content": "What is the capital of algeria?" | |
| } | |
| ], | |
| ) | |
| print(completion.choices[0].message) |