# ai-chat



<!-- Auto Generated Below -->


## Properties

| Property           | Attribute           | Description | Type                         | Default     |
| ------------------ | ------------------- | ----------- | ---------------------------- | ----------- |
| `aiAvatar`         | `ai-avatar`         | AI头像URL     | `string`                     | `''`        |
| `customRenderers`  | --                  | 自定义渲染器映射    | `{ [key: string]: string; }` | `{}`        |
| `inputDisabled`    | `input-disabled`    | 是否禁用输入      | `boolean`                    | `false`     |
| `inputPlaceholder` | `input-placeholder` | 输入框占位符      | `string`                     | `'输入消息...'` |
| `maxInputLength`   | `max-input-length`  | 最大输入长度      | `number`                     | `1000`      |
| `messages`         | --                  | 聊天消息列表      | `ChatMessage[]`              | `[]`        |
| `multilineInput`   | `multiline-input`   | 是否支持多行输入    | `boolean`                    | `true`      |
| `showAiAvatar`     | `show-ai-avatar`    | 是否显示AI头像    | `boolean`                    | `true`      |
| `showInput`        | `show-input`        | 是否显示输入框     | `boolean`                    | `true`      |
| `showTimestamp`    | `show-timestamp`    | 是否显示时间戳     | `boolean`                    | `true`      |
| `showUserAvatar`   | `show-user-avatar`  | 是否显示用户头像    | `boolean`                    | `true`      |
| `userAvatar`       | `user-avatar`       | 用户头像URL     | `string`                     | `''`        |


## Events

| Event              | Description | Type                                                   |
| ------------------ | ----------- | ------------------------------------------------------ |
| `messageClick`     | 消息点击事件      | `CustomEvent<ChatMessage>`                             |
| `messageLongPress` | 消息长按事件      | `CustomEvent<ChatMessage>`                             |
| `messageSend`      | 消息发送事件      | `CustomEvent<{ content: string; timestamp: number; }>` |


## Dependencies

### Depends on

- [internal-text-renderer](renderers)
- [internal-markdown-renderer](renderers)
- [internal-echarts-renderer](renderers)
- [internal-message-input](renderers)

### Graph
```mermaid
graph TD;
  ai-chat --> internal-text-renderer
  ai-chat --> internal-markdown-renderer
  ai-chat --> internal-echarts-renderer
  ai-chat --> internal-message-input
  style ai-chat fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
