From 8a35f112fb68692fa3b3fb24aebaabe74b7a09f6 Mon Sep 17 00:00:00 2001 From: Jonathan Lessinger Date: Sat, 23 Dec 2023 07:35:32 -0500 Subject: [PATCH] [issue #454][AIC-py] get default model if no prompt model Reproduced error Confirmed now this uses gpt-3.5-turbo: ``` "default_model": "gpt-3.5-turbo" { "name": "get_activities", "input": "Tell me 2 fun attractions to do in {{city}}.", "metadata": { "parameters": { "city": "New York City" } } } ``` --- python/src/aiconfig/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/aiconfig/schema.py b/python/src/aiconfig/schema.py index e6730d339..9ad44280e 100644 --- a/python/src/aiconfig/schema.py +++ b/python/src/aiconfig/schema.py @@ -225,7 +225,7 @@ def get_model_name(self, prompt: Union[str, Prompt]) -> str: if not prompt: raise Exception(f"Prompt '{prompt}' not found in config.") - if not prompt.metadata: + if not prompt.metadata or not prompt.metadata.model: # If the prompt doesn't have a model, use the default model default_model = self.metadata.default_model if not default_model: