feat: Add SAP AI Core provider support (#5023)

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
This commit is contained in:
Jérôme Benoit 2025-12-04 21:07:23 +01:00 committed by GitHub
commit b9c1f10016
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 67 additions and 1 deletions

View file

@ -285,6 +285,17 @@ export namespace Provider {
},
}
},
"sap-ai-core": async () => {
const auth = await Auth.get("sap-ai-core")
const serviceKey = Env.get("SAP_AI_SERVICE_KEY") || (auth?.type === "api" ? auth.key : undefined)
const deploymentId = Env.get("SAP_AI_DEPLOYMENT_ID") || "d65d81e7c077e583"
const resourceGroup = Env.get("SAP_AI_RESOURCE_GROUP") || "default"
return {
autoload: !!serviceKey,
options: serviceKey ? { serviceKey, deploymentId, resourceGroup } : {},
}
},
zenmux: async () => {
return {
autoload: false,
@ -776,7 +787,7 @@ export namespace Provider {
const mod = await import(installedPath)
const fn = mod[Object.keys(mod).find((key) => key.startsWith("create"))!]
const loaded = fn({
const loaded = await fn({
name: model.providerID,
...options,
})