From 7b4b1839d33e6f7d52da8c702b7d4418201cd0c0 Mon Sep 17 00:00:00 2001 From: Pedro Rico Pinazo Date: Mon, 20 May 2024 22:49:58 +0100 Subject: [PATCH] fix type error --- src/comai/cli.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/comai/cli.py b/src/comai/cli.py index 8415c70..5ec73e2 100755 --- a/src/comai/cli.py +++ b/src/comai/cli.py @@ -3,7 +3,7 @@ import typer import click import itertools -from typing import List, Optional, Iterator +from typing import List, Optional, Iterator, Literal from typing_extensions import Annotated from langchain_community.llms.ollama import OllamaEndpointNotFoundError from urllib3.exceptions import NewConnectionError @@ -76,10 +76,8 @@ def settings_callback(value: bool): else: raise Exception("No models available for the selected provider") model = prompt_options("Which model do you want to use?", models, default_model) - - settings.provider = provider - settings.model = model - write_settings(settings) + updated_settings = Settings.parse_obj({"provider": provider, "model": model}) + write_settings(updated_settings) raise typer.Exit()