File size: 426 Bytes
8b15eea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import requests
from os import getenv


API_URL = getenv('API_URL')
BEARER = getenv('BEARER')


headers = {
	"Authorization": f"Bearer {BEARER}",
	"Content-Type": "application/json"
}

def call_jais(payload):
	response = requests.post(API_URL, headers=headers, json=payload)
	return response.json()

def generate(prompt: str):
    payload = {'inputs': '', 'prompt':prompt}
    response = call_jais(payload)
    return response