Merge pull request #321 from dhensen/fix-call-ai-function

🛠️ 🧰 Fix call_ai_function storing gpt-4 into kwarg model even when using gpt3only
This commit is contained in:
Toran Bruce Richards
2023-04-10 08:08:55 +01:00
committed by GitHub

View File

@@ -5,7 +5,9 @@ from llm_utils import create_chat_completion
# This is a magic function that can do anything with no-code. See
# https://github.com/Torantulino/AI-Functions for more info.
def call_ai_function(function, args, description, model=cfg.smart_llm_model):
def call_ai_function(function, args, description, model=None):
if model is None:
model = cfg.smart_llm_model
# For each arg, if any are None, convert to "None":
args = [str(arg) if arg is not None else "None" for arg in args]
# parse args to comma seperated string