Spaces:
Runtime error
Runtime error
File size: 702 Bytes
c9727ad a38d269 c9727ad a38d269 c9727ad |
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 28 29 30 31 32 33 |
# Edit this One AI API call using our studio at https://studio.oneai.com/?pipeline=j2Yiyk
import os
import requests
api_key = os.environ['api_key']
url = "https://api.oneai.com/api/v0/pipeline"
def oneai_pipeline(text):
headers = {
"api-key": api_key,
"content-type": "application/json"
}
payload = {
"input": text,
"input_type": "article",
"steps": [
{
"skill": "summarize",
"params": {
"auto_length": True,
"max_length": 100,
"min_length": 5
}
},
]
}
r = requests.post(url, json=payload, headers=headers)
data = r.json()
return data['output'][0]['text'] |