lock variable fix (#28)

Refactor the lock variable in AppConfig to use ClassVar for pydantic error.
This commit was merged in pull request #28.
This commit is contained in:
Giacomo Bertolazzi
2025-10-12 23:47:56 +02:00
committed by GitHub
parent 862525cc62
commit 45a17d4570

View File

@@ -4,7 +4,7 @@ import ollama
import yaml import yaml
import logging.config import logging.config
import agno.utils.log # type: ignore import agno.utils.log # type: ignore
from typing import Any from typing import Any, ClassVar
from pydantic import BaseModel from pydantic import BaseModel
from agno.agent import Agent from agno.agent import Agent
from agno.tools import Toolkit from agno.tools import Toolkit
@@ -88,7 +88,7 @@ class AppConfig(BaseModel):
models: ModelsConfig = ModelsConfig() models: ModelsConfig = ModelsConfig()
agents: AgentsConfigs = AgentsConfigs() agents: AgentsConfigs = AgentsConfigs()
__lock = threading.Lock() __lock: ClassVar[threading.Lock] = threading.Lock()
@classmethod @classmethod
def load(cls, file_path: str = "configs.yaml") -> 'AppConfig': def load(cls, file_path: str = "configs.yaml") -> 'AppConfig':