File size: 626 Bytes
a284b3d
 
a206339
a284b3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import requests
import os

api_key=os.environ.get("HYPERBOLIC_API_KEY")
url = "https://api.hyperbolic.xyz/v1/chat/completions"

def hyperbolic(prompt):
    
    headers = {
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api_key}"
    }
    data = {
        "messages": [
            {
                "role": "user",
                "content": f"{prompt}"
            }
        ],
        "model": "Qwen/Qwen2.5-72B-Instruct",
        "max_tokens": 32768,
        "temperature": 0.2,
        "top_p": 0.9
    }
  
response = requests.post(url, headers=headers, json=data)
print(response.json())