default api_key from env must be a SecretStr

This commit is contained in:
Matthew Farrellee 2025-06-30 20:39:45 -04:00
parent b333a3c03a
commit e819d07149

View file

@ -40,7 +40,7 @@ class NVIDIAConfig(BaseModel):
description="A base url for accessing the NVIDIA NIM",
)
api_key: SecretStr | None = Field(
default_factory=lambda: os.getenv("NVIDIA_API_KEY"),
default_factory=lambda: SecretStr(os.getenv("NVIDIA_API_KEY")),
description="The NVIDIA API key, only needed of using the hosted service",
)
timeout: int = Field(