Skip to content

Commit

Permalink
[issue #454][AIC-py] get default model if no prompt model (#600)
Browse files Browse the repository at this point in the history
[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"
     }
   }
}
```

---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with
[ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/600).
* __->__ #600
* #599
  • Loading branch information
jonathanlastmileai authored Dec 23, 2023
2 parents 52a6b86 + 8a35f11 commit 9b6768f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/src/aiconfig/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9b6768f

Please sign in to comment.