ant-design/x/x-chat-provider
Claude Code and agent skill by ant-design/x
- community
Checking that the SKILL.md file is still in the repository.
Focus on implementing custom Chat Provider, helping to adapt any streaming interface to Ant Design X standard format
Install
npx vskill@latest install ant-design/x/x-chat-providerSKILL.md
The same SKILL.md was published earlier as ant-design/x/x-chat-provider.
🎯 Skill Positioning
This skill focuses on solving one problem: How to quickly adapt your streaming interface to Ant Design X's Chat Provider.
Not involved: useXChat usage tutorial (that's another skill).
Table of Contents
- 📦 Technology Stack Overview
- 🚀 Quick Start
- Built-in Provider
- When to Use Custom Provider
- 📋 Four Steps to Implement Custom Provider
- 🔑 Core Types and Exports
- ⚙️ XRequest Advanced Configuration
- callbacks
- retryInterval Retry
- transformStream Custom Stream
- 🔧 Common Scenario Adaptation
- ⚠️ Important Reminders
- ⚡ Quick Checklist
- 🚨 Development Rules
- 🔗 Reference Resources
📦 Technology Stack Overview
| Layer | Package Name | Core Purpose | |
|---|---|---|---|
| UI Layer | @ant-design/x | React UI component library | |
| Logic Layer | @ant-design/x-sdk | Development toolkit | |
| Render Layer | @ant-design/x-markdown | Markdown renderer |
🚀 Quick Start
🎯 Provider Selection Decision Tree
🏭 Built-in Provider Overview
| Provider Type | Applicable Scenario | Import | |
|---|---|---|---|
| OpenAIChatProvider | Standard OpenAI API format | import { OpenAIChatProvider } from '@ant-design/x-sdk' | |
| DeepSeekChatProvider | Standard DeepSeek API format | import { DeepSeekChatProvider } from '@ant-design/x-sdk' | |
| DefaultChatProvider | Pass-through raw response, no format conversion | import { DefaultChatProvider } from '@ant-design/x-sdk' |
⚠️ Export names areOpenAIChatProvider/DeepSeekChatProvider/DefaultChatProvider, watch spelling
DefaultChatProvider Use Case
DefaultChatProvider passes through raw response data without any conversion. Suitable for:
- The interface response format is already what you want to display
- You want full control over
Bubble.List'scontentRenderto render messages
⚠️ When usingDefaultChatProvider,ChatMessageis typically yourOutputtype or a union type; rendering requirescontentRender
📋 Four Steps to Implement Custom Provider
Step 1: Analyze Interface Format ⏱️ 2 minutes
| Information Type | Example Value | |
|---|---|---|
| Interface URL | https://your-api.com/chat | |
| Request Method | JSON, POST | |
| Response Format | Server-Sent Events | |
| Auth Method | Bearer Token |
Step 2: Create Provider Class ⏱️ 5 minutes
Step 3: Verify ⏱️ 1 minute
| Check Item | Description | |
|---|---|---|
| Only 3 methods | transformParams, transformLocalMessage, transformMessage | |
| transformParams signature | Must include second parameter options: XRequestOptions<...> | |
| No status in return | transformMessage return value has no status field | |
| No request method | Confirm no request method implemented | |
| Type check passes | tsc --noEmit no errors |
Step 4: Use Provider ⏱️ 1 minute
🔑 Core Types and Exports
Key types exported from @ant-design/x-sdk:
XModelMessage Structure (OpenAI message format)
SSEOutput and SSEFields
⚙️ XRequest Advanced Configuration
callbacks
callbacks allows monitoring request events at the Provider level. The third parameter in callbacks is the MessageInfo processed by transformMessage:
⚠️callbacksanduseXChat'srequestFallbackdo not conflict — both execute.callbacksis better for logging/reporting;requestFallbackcontrols UI display.
retryInterval Retry
transformStream Custom Stream
Use when the server returns a non-standard SSE stream format:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/x-skill/skills/x-chat-provider/SKILL.md
Popularity
- Repository stars
- 4,706
- Repository forks
- 1,142
- 7-day trend score
- 42
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ant-design/x/x-chat-provider)