# useAI

**Kind:** Function

**Source:** [`atloria-monorepo/apps/web/src/components/AI/useAI.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/web/src/components/AI/useAI.ts#L50)

Custom hook for AI operations with SSE streaming support

Handles:
- Multiple AI providers (Azure Claude, Azure OpenAI)
- Streaming responses via Server-Sent Events
- Document enhancement, outline generation, text improvement, summarization
- Error handling and loading states
- Provider selection

## Signature

```ts
function useAI(options: UseAIOptions): UseAIReturn
```

## Parameters

| Name | Type |
|---|---|
| `options` | `UseAIOptions` |

**Returns:** `UseAIReturn`
