# UseAgentRunResult
Source: https://docs.maelstrom-ai.co/dev/reference/react/type-aliases/useagentrunresult/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **UseAgentRunResult** = [`AgentRunsSnapshot`](https://docs.maelstrom-ai.co/dev/reference/react/type-aliases/agentrunssnapshot/) &amp; `object`

Defined in: [packages/react/src/lib/use-agent-run.ts:16](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/react/src/lib/use-agent-run.ts#L16)

What `useAgentRun()` returns: the Agent Run snapshot plus a way to send input.

The agent loop is experimental in 0.3 and may change in any minor release.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

## Type Declaration

### sendMessage

> `readonly` **sendMessage**: (`text`, `options?`) => [`AgentMessageSubmission`](https://docs.maelstrom-ai.co/dev/reference/react/type-aliases/agentmessagesubmission/)

Sends text to the agent through `Orchestrator.sendMessage` and returns the input id and a `result` promise at once. The input appears in the snapshot as `pending` before the frame is sent. `result` settles once with the run state at that moment and never rejects, and a message that never left the client settles `not_submitted`. A `lost` result may have reached the agent, so do not resend it automatically. Keeps its identity for the life of the Provider’s Orchestrator.

#### Parameters

##### text

`string`

##### options?

[`SendMessageOptions`](https://docs.maelstrom-ai.co/dev/reference/react/type-aliases/sendmessageoptions/)

#### Returns

[`AgentMessageSubmission`](https://docs.maelstrom-ai.co/dev/reference/react/type-aliases/agentmessagesubmission/)
