Merge remote-tracking branch 'upstream/master' into more_azure

This commit is contained in:
Peter Edwards
2023-04-13 08:35:13 +02:00
7 changed files with 60 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ cfg = Config()
openai.api_key = cfg.openai_api_key
# Overly simple abstraction until we create something better
def create_chat_completion(messages, model=None, temperature=None, max_tokens=None)->str:
def create_chat_completion(messages, model=None, temperature=cfg.temperature, max_tokens=None)->str:
"""Create a chat completion using the OpenAI API"""
if cfg.use_azure:
response = openai.ChatCompletion.create(