# AiMessage class

Namespace: [Grasshopper2.Components.Descriptive](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.components.descriptive.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class AiMessage
```

A single message in an AI conversation. The shape varies by role: system/user/assistant text messages carry only [AiMessage.Text](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/text.md); assistant tool-call messages carry only [AiMessage.ToolCall](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/toolcall.md); tool result messages carry [AiMessage.ToolName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/toolname.md) plus the result in [AiMessage.Text](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/text.md). Construct via the static factory methods.

## Properties

- [ReasoningContent](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/reasoningcontent.md): Chain-of-thought returned by reasoning-mode models (DeepSeek thinking models require this to be round-tripped back to the API on subsequent turns or the request is rejected). Null when the provider didn't return one. Only meaningful on assistant messages.
- [Role](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/role.md)
- [Text](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/text.md): Text content for system/user/assistant text messages, or the result body for tool messages. Null for assistant tool-call messages.
- [ToolCall](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/toolcall.md): Populated only for assistant messages that are tool calls; null otherwise.
- [ToolName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/toolname.md): Populated only for tool result messages; identifies which tool the result is for.
- [ToolUseId](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/tooluseid.md): Populated only for tool result messages; the provider-assigned id of the call this result responds to.

## Methods

- [Assistant](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/assistant.md): (static)
- [AssistantToolCall](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/assistanttoolcall.md): (static)
- [System](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/system.md): (static)
- [ToolResult](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/toolresult.md): (static)
- [User](https://developer.rhino3d.com/api/gh2/type/grasshopper2.components.descriptive.aimessage/user.md): (static)
