| name | senparc-add-ai-platform |
| description | Upgrade or add AI provider support in Senparc.AI and Senparc.AI.AgentKernel with provider-specific parameter modeling, platform mapping, adapter integration, and unit tests. Use when a new model platform (domestic or international) must be onboarded, or when an existing provider needs parameter/schema corrections based on official docs. |
Senparc Add AI Platform
Goal
Add or correct provider support with a stable, repeatable path:
- Use official docs to define true minimum parameters.
- Model provider-specific keys in
Senparc.AI.
- Bind provider mapping in
AgentKernel Chat/Embedding configuration.
- Add unit tests that validate mapping and platform behavior.
- Update provider support documentation with source links.
Workflow
1. Classify provider protocol first
Choose one path before coding:
- Native official SDK/provider exists and is suitable:
Use official provider package directly.
- Provider is OpenAI-compatible:
Reuse OpenAI-compatible adapter path; do not duplicate a full provider package.
- Provider is custom protocol/auth (signature, special websocket/http schema):
Create a dedicated provider package under
src/Senparc.AI.AgentKernel.Providers.<ProviderName>/.
2. Add provider data model in Senparc.AI
Do all of the following:
- Add
AiPlatform.<Provider> enum value in src/Senparc.AI/Enums.cs.
- Add
<Provider>Keys in src/Senparc.AI/Entities/Keys/.
- Update
src/Senparc.AI/Interfaces/ISenparcAiSetting.cs:
Add key property, endpoint property, and Endpoint switch mapping.
- Update
src/Senparc.AI/Entities/SenparcAiSettingBase.cs:
Add Use<Provider> flag, key property, endpoint property, ApiKey switch mapping, ModelName switch mapping, Set<Provider>() helper.
- Update schema if needed:
src/Senparc.AI/appsettings.schema.json.
3. Add runtime wiring in AgentKernel
Update provider routing in:
src/Senparc.AI.AgentKernel/Helpers/AgentKernelHelper.Config.Chat.cs
src/Senparc.AI.AgentKernel/Helpers/AgentKernelHelper.Config.Embedding.cs
src/Senparc.AI.AgentKernel/Kernels/KernelBuilderExtensions/KernelBuilderExtension.Chat.cs
src/Senparc.AI.AgentKernel/Kernels/KernelBuilderExtensions/KernelBuilderExtension.Embedding.cs (if embedding supported)
Rule:
- If official provider lacks embedding, throw explicit
SenparcAiException.
- If provider is OpenAI-compatible, call shared OpenAI-compatible helper.
4. Add tests
Minimum required tests:
- Setting mapping test:
src/Senparc.AI.AgentKernel.Tests/Helpers/SenparcAiSettingAdditionalPlatformTests.cs
- Chat/Embedding support routing test:
src/Senparc.AI.AgentKernel.Tests/Helpers/AgentKernelHelper.PlatformSupportTests.cs
- Provider-factory test only if a new dedicated provider package is created:
src/Senparc.AI.AgentKernel.Tests/Helpers/ProviderFactoriesTests.cs
5. Update docs with official sources
Update:
documents/AgentKernel-Provider-Support-Matrix.md
- Add provider minimum params, integration path, unsupported capability notes.
- Add official source URLs for every provider-specific parameter claim.
Review Checklist
- Provider parameters are not forced into a generic 3-field shape.
OrganizationId is only used by providers that actually need it.
AiPlatform mapping is complete for Endpoint, ApiKey, ModelName.
- Chat/Embedding behavior matches official capability boundaries.
- Unit tests pass for newly added provider branches.
- Documentation has source links and a clear compatibility explanation.
References
Read references/provider-update-checklist.md for the execution checklist template.