fix: Allow None for episode_id_prefix and convert to empty string
- Change episode_id_prefix type to str | None to accept None from YAML - Add model_post_init to convert None to empty string for backward compatibility
This commit is contained in:
parent
5f0685cd72
commit
8bab5db837
1 changed files with 6 additions and 1 deletions
|
|
@ -216,10 +216,15 @@ class GraphitiAppConfig(BaseModel):
|
|||
"""Graphiti-specific configuration."""
|
||||
|
||||
group_id: str = Field(default='main', description='Group ID')
|
||||
episode_id_prefix: str = Field(default='', description='Episode ID prefix')
|
||||
episode_id_prefix: str | None = Field(default='', description='Episode ID prefix')
|
||||
user_id: str = Field(default='mcp_user', description='User ID')
|
||||
entity_types: list[EntityTypeConfig] = Field(default_factory=list)
|
||||
|
||||
def model_post_init(self, __context) -> None:
|
||||
"""Convert None to empty string for episode_id_prefix."""
|
||||
if self.episode_id_prefix is None:
|
||||
self.episode_id_prefix = ''
|
||||
|
||||
|
||||
class GraphitiConfig(BaseSettings):
|
||||
"""Graphiti configuration with YAML and environment support."""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue