Open
Description
Currently some settings sub-classes are not frozen
, and some arguments are dictionaries which are not hashable. For instance
class MCPServerConfig(BaseModel):
"""Configuration for a single MCP server."""
command: str
args: list[str] | None = None
env: dict[str, SecretStr] | None = None
class SettingsMCP(BaseModel):
"""Settings for the MCP."""
servers: dict[str, MCPServerConfig] | None = None
One should find a way to make these classes hashable. For instance @jankrepl 's idea is to do something like this:
class MCPEnv(BaseModel):
model_config = ConfigDict(frozen=True, extra="allow")
class MCPServerConfig(BaseModel):
"""Configuration for a single MCP server."""
command: str
args: tuple[str] | None = None
env: MCPEnv | None = None
model_config = ConfigDict(frozen=True)
There might be other ways to do it. To be investigated.
Metadata
Metadata
Assignees
Labels
No labels