> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Function: createOpenUiChatLibrary()

> **createOpenUiChatLibrary**(): [`Library`](/next/zh/api/genui/openui/core/type-aliases/Library.md)

创建以 Card 为根的 OpenUI Chat 响应组件库。
只创建一次，并在后续渲染中向 OpenUiRenderer 传入同一实例。

## Returns

[`Library`](/next/zh/api/genui/openui/core/type-aliases/Library.md)

## Remarks

此工厂注册整套 Chat 组件并引入其样式。
若只需引入所选组件及其样式，请从 `@lynx-js/genui/openui/chat/<Component>`
逐个导入组件，再使用 `@lynx-js/genui/openui/explicit` 中的
`createOpenUiLibrary` 组装组件库。

## Example

```tsx
const library = createOpenUiChatLibrary();
<OpenUiRenderer library={library} response={'root = Card([TextContent("Hello")])'} />;
```
