mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 19:52:36 +00:00
explicit span management using with
This commit is contained in:
parent
6411007024
commit
b3021ea2da
3 changed files with 114 additions and 96 deletions
|
|
@ -29,6 +29,11 @@ class Span(BaseModel):
|
|||
end_time: Optional[datetime] = None
|
||||
attributes: Optional[Dict[str, Any]] = Field(default_factory=dict)
|
||||
|
||||
def set_attribute(self, key: str, value: Any):
|
||||
if self.attributes is None:
|
||||
self.attributes = {}
|
||||
self.attributes[key] = value
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class Trace(BaseModel):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue