nova-api/api/providers/ails.py

26 lines
570 B
Python
Raw Permalink Normal View History

2023-10-09 19:09:01 +02:00
from .helpers import utils
ORGANIC = False
MODELS = [
2023-10-14 01:15:59 +02:00
'gpt-3.5-turbo',
2023-10-15 22:35:18 +02:00
'gpt-3.5-turbo-0613',
'gpt-4',
'gpt-3.5-turbo-16k',
'gpt-4-0613'
2023-10-09 19:09:01 +02:00
]
async def chat_completion(**kwargs):
payload = kwargs
2023-10-14 01:15:59 +02:00
key = await utils.random_secret_for('ai.ls')
2023-10-09 19:09:01 +02:00
return {
'method': 'POST',
2023-10-14 01:15:59 +02:00
'url': 'https://api.caipacity.com/v1/chat/completions',
2023-10-09 19:09:01 +02:00
'payload': payload,
'headers': {
'Content-Type': 'application/json',
'Authorization': f'Bearer {key}'
},
2023-10-14 01:15:59 +02:00
'provider_auth': f'ai.ls>{key}'
2023-10-09 19:09:01 +02:00
}