mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-16 14:12:40 +00:00
fix(otel): instrumentation providers do not need a config
This commit is contained in:
parent
8fe3a25158
commit
deedb3fb46
5 changed files with 59 additions and 36 deletions
|
|
@ -542,8 +542,8 @@ If not specified, a default SQLite store will be used.""",
|
|||
|
||||
cfg_cls = instantiate_class_type(entry.config_class)
|
||||
prv_cls = instantiate_class_type(entry.provider_class)
|
||||
cfg_data = v.get("config") or {}
|
||||
cfg = TypeAdapter(cfg_cls).validate_python(cfg_data)
|
||||
cfg_data = v.get("config")
|
||||
cfg = TypeAdapter(cfg_cls).validate_python(cfg_data) if cfg_data is not None else None
|
||||
return prv_cls(provider=provider_type, config=cfg)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class InstrumentationProvider(BaseModel):
|
|||
"""
|
||||
|
||||
provider: str = Field(description="Provider identifier for discriminated unions")
|
||||
config: BaseModel
|
||||
config: BaseModel | None = Field(default=None, description="Optional configuration for the instrumentation provider. Most support configuration via environment variables.")
|
||||
|
||||
@abstractmethod
|
||||
def fastapi_middleware(self, app: FastAPI) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue