Cleanup after merge of restructurings #8
#10
@ -59,6 +59,12 @@ class AI(Protocol):
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def print_models(self) -> None:
|
||||
"""
|
||||
Print all models supported by this AI.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def tokens(self, data: Union[Message, Chat]) -> int:
|
||||
"""
|
||||
Computes the nr. of AI language tokens for the given message
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
from ..configuration import Config
|
||||
from ..ai import AI
|
||||
from ..ai_factory import create_ai
|
||||
|
||||
|
||||
def config_cmd(args: argparse.Namespace) -> None:
|
||||
@ -9,3 +11,10 @@ def config_cmd(args: argparse.Namespace) -> None:
|
||||
"""
|
||||
if args.create:
|
||||
Config.create_default(Path(args.create))
|
||||
elif args.list_models or args.print_model:
|
||||
config: Config = Config.from_file(args.config)
|
||||
ai: AI = create_ai(args, config)
|
||||
if args.list_models:
|
||||
ai.print_models()
|
||||
else:
|
||||
print(ai.config.model)
|
||||
|
||||
@ -39,6 +39,7 @@ class AIConfig:
|
||||
name: ClassVar[str]
|
||||
# a user-defined ID for an AI configuration entry
|
||||
ID: str
|
||||
model: str = 'n/a'
|
||||
|
||||
# the name must not be changed
|
||||
def __setattr__(self, name: str, value: Any) -> None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user