AI Secondary Development
Less than 1 minute
AI Secondary Development
1. Scope
AI secondary development usually includes adding model providers, extending model parameters, changing knowledge parsing, integrating protocol adaptation, or connecting business pages to AI assistants.
2. Development Map
3. Extension Points
| Area | Focus |
|---|---|
| Provider | Endpoint, API key, authentication, timeout, and error handling. |
| Model | Model type, parameter validation, context length, and availability. |
| Knowledge | File parsing, chunking, embedding, versioning, and publishing. |
| Protocol adaptation | Prompt, protocol field extraction, thing-model mapping, and test cases. |
| NL2SQL | Semantic fields, data permission, SQL safety, and query result formatting. |
| Frontend | Chat UI, provider management, knowledge operations, and result display. |
4. Safety Rules
- Never expose model keys in frontend code.
- Validate and log model errors without leaking secrets.
- Restrict NL2SQL by user permission and table whitelist.
- Review AI-generated protocol or SQL output before execution.
- Keep knowledge-base version rollback available.
5. Verification
| Item | Expected Result |
|---|---|
| Provider test | Correct key succeeds and wrong key fails clearly. |
| Chat | Simple prompts return stable answers. |
| Knowledge | Search hits expected document chunks. |
| Protocol adaptation | Output can be verified by real device messages. |
| NL2SQL | Unauthorized fields or tables cannot be queried. |
