ora.sh load model ( to use gpt-4 )
This commit is contained in:
@@ -26,10 +26,10 @@ class Completion:
|
||||
'chatbotId': model.id,
|
||||
'input' : prompt,
|
||||
'userId' : model.createdBy,
|
||||
'model' : 'gpt-3.5-turbo',
|
||||
'model' : model.modelName,
|
||||
'provider' : 'OPEN_AI',
|
||||
'includeHistory': includeHistory}).json()
|
||||
|
||||
|
||||
return OraResponse({
|
||||
'id' : response['conversationId'],
|
||||
'object' : 'text_completion',
|
||||
|
||||
16
ora/model.py
16
ora/model.py
@@ -8,6 +8,7 @@ class CompletionModel:
|
||||
createdAt = None
|
||||
slug = None
|
||||
id = None
|
||||
model = 'gpt-3.5-turbo'
|
||||
|
||||
def create(
|
||||
system_prompt: str = 'You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible',
|
||||
@@ -18,6 +19,7 @@ class CompletionModel:
|
||||
CompletionModel.description = description
|
||||
CompletionModel.slug = name
|
||||
|
||||
|
||||
response = post('https://ora.sh/api/assistant', json = {
|
||||
'prompt' : system_prompt,
|
||||
'userId' : f'auto:{uuid4()}',
|
||||
@@ -29,4 +31,16 @@ class CompletionModel:
|
||||
CompletionModel.createdAt = response.json()['createdAt']
|
||||
|
||||
return CompletionModel
|
||||
|
||||
|
||||
def load(chatbotId: str, modelName: str = 'gpt-3.5-turbo', userId: str = None):
|
||||
if userId is None: userId = f'{uuid4()}'
|
||||
|
||||
CompletionModel.system_prompt = None
|
||||
CompletionModel.description = None
|
||||
CompletionModel.slug = None
|
||||
CompletionModel.id = chatbotId
|
||||
CompletionModel.createdBy = userId
|
||||
CompletionModel.createdAt = None
|
||||
CompletionModel.modelName = modelName
|
||||
|
||||
return CompletionModel
|
||||
Reference in New Issue
Block a user