ChatMasterMind Application Refactor and Enhancement #8

Merged
juk0de merged 122 commits from restructurings into main 2023-09-12 07:36:07 +02:00
Showing only changes of commit d93598a74f - Show all commits

View File

@ -7,7 +7,15 @@ OpenAIConfigInst = TypeVar('OpenAIConfigInst', bound='OpenAIConfig')
@dataclass
class OpenAIConfig():
class AIConfig:
"""
The base class of all AI configurations.
"""
name: str
@dataclass
class OpenAIConfig(AIConfig):
"""
The OpenAI section of the configuration file.
"""
@ -25,6 +33,7 @@ class OpenAIConfig():
Create OpenAIConfig from a dict.
"""
return cls(
name='OpenAI',
api_key=str(source['api_key']),
model=str(source['model']),
max_tokens=int(source['max_tokens']),
@ -36,7 +45,7 @@ class OpenAIConfig():
@dataclass
class Config():
class Config:
"""
The configuration file structure.
"""
@ -47,7 +56,7 @@ class Config():
@classmethod
def from_dict(cls: Type[ConfigInst], source: dict[str, Any]) -> ConfigInst:
"""
Create OpenAIConfig from a dict.
Create Config from a dict.
"""
return cls(
system=str(source['system']),