openai: more pseudo-implementation (brakes old tests)
This commit is contained in:
@@ -26,6 +26,7 @@ class OpenAIConfig(AIConfig):
|
||||
top_p: float
|
||||
frequency_penalty: float
|
||||
presence_penalty: float
|
||||
system: str
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[OpenAIConfigInst], source: dict[str, Any]) -> OpenAIConfigInst:
|
||||
@@ -40,7 +41,8 @@ class OpenAIConfig(AIConfig):
|
||||
temperature=float(source['temperature']),
|
||||
top_p=float(source['top_p']),
|
||||
frequency_penalty=float(source['frequency_penalty']),
|
||||
presence_penalty=float(source['presence_penalty'])
|
||||
presence_penalty=float(source['presence_penalty']),
|
||||
system=str(source['system'])
|
||||
)
|
||||
|
||||
|
||||
@@ -56,12 +58,13 @@ 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']),
|
||||
db=str(source['db']),
|
||||
openai=OpenAIConfig.from_dict(source['openai'])
|
||||
# FIXME: move the 'system' parameter into the OpenAI section
|
||||
openai=OpenAIConfig.from_dict(source['openai'].update({'system': source['system']}))
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user