> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# set_span_attributes

> Set custom attributes on a Model or AgentTool that can be accessed by logging hooks.

Set custom attributes on a Model or AgentTool that can be accessed by logging hooks.

This function stores key-value pairs as attributes on the object, making
them accessible to hooks during model invocation events. Attributes are
automatically scoped to async or sync contexts.

## Parameters

<ParamField path="obj" type="Model | AgentTool" required={true}>
  The object to set the attribute on (Model or AgentTool instance)
</ParamField>

<ParamField path="**kwargs" type="str | int | float | bool" required={false}>
  Key-value pairs of attributes to set (str, int, float, or bool values)
</ParamField>

## Example

```python theme={null}
from strands.models.openai import OpenAIModel
from fiddler_strandsagents import set_span_attributes

model = OpenAIModel(api_key="...", model_id="gpt-4")
set_span_attributes(model, model_id="gpt-4", temperature=0.7)
```
