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

# Set Attribute • Rust AI Agent SDK

> set_attribute: Set attribute on current span.

# set\_attribute

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**TraceContext**](../classes/TraceContext) class in the [**trace**](../modules/trace) module.

Set attribute on current span.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def set_attribute(&mut self, key: impl Into<String>, value: impl Serialize) -> ()
```

## Parameters

<ParamField query="key" type="impl Into<String>" required={true}>
  No description available.
</ParamField>

<ParamField query="value" type="impl Serialize" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="()">
  The result of the operation.
</ResponseField>
