Skip to content

Commit

Permalink
Fixed error and updated default model
Browse files Browse the repository at this point in the history
  • Loading branch information
TE-YoshiyukiKobayashi committed Nov 5, 2024
1 parent 92b8012 commit 4ea38c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/_AISolutions/_ChatGPT/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def chatbot():
with open(os.path.join(log_path, user_message['id'] + '.json'), 'w') as f:
json.dump(user_message, f)

return jsonify({'success': True, 'message': response_text, 'usage': dict(response.usage)})
return jsonify({'success': True, 'message': response_text, 'usage': f'Usage : Input {response.usage.prompt_tokens}, Output {response.usage.completion_tokens}, Total {response.usage.total_tokens}'})
except Exception as e:
return jsonify({'success': False, 'message': str(e), 'usage': 'An error occurred while calling OpenAI API.'})

Expand Down
2 changes: 1 addition & 1 deletion plugins/_AISolutions/_ChatGPT/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ <h2>Chatbot using OpenAI Chat API</h2>
if (valueBak != '') {
modelDropdownList.value = valueBak;
}else {
modelDropdownList.value = 'gpt-3.5-turbo';
modelDropdownList.value = 'gpt-4o-mini';
}
}
}
Expand Down

0 comments on commit 4ea38c4

Please sign in to comment.