# `Jido.AI.Request.Handle`
[🔗](https://github.com/agentjido/jido_ai/blob/v2.2.0/lib/jido_ai/request.ex#L77)

Represents a tracked request handle with correlation ID.

Similar to `%Task{}`, this struct holds the information needed to
await a specific request's completion.

# `server`

```elixir
@type server() :: pid() | atom() | {:via, module(), term()}
```

# `status`

```elixir
@type status() :: :pending | :completed | :failed | :timeout
```

# `t`

```elixir
@type t() :: %Jido.AI.Request.Handle{
  completed_at: nil | nil | integer(),
  error: nil | nil | any(),
  id: binary(),
  inserted_at: nil | nil | integer(),
  query: binary() | [any()],
  result: nil | nil | any(),
  server: any(),
  status: :pending | :completed | :failed | :timeout
}
```

# `complete`

```elixir
@spec complete(t(), any()) :: t()
```

Marks request as completed with a result.

# `fail`

```elixir
@spec fail(t(), any()) :: t()
```

Marks request as failed with an error.

# `new`

```elixir
@spec new(String.t(), server(), Jido.AI.Query.t()) :: t()
```

Creates a new Handle struct.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
