视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
sap-business-ai-joule【文档与办公】SAP Business AI and Joule copilot development skill. Use when integrating SAP AI Core, building GenAI Hub scenarios (GPT-4/Claude/Llama), extending Joule, using HANA Cloud vector engine for RAG, or working with Document Information Extraction. If the user mentions Joule, SAP AI Core, GenAI Hub, AI Foundation, or RAG with SAP data, use this skill.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
sap-hana-cloud — Vector engine for embeddings, HANA Cloud as knowledge storesap-rap-comprehensive — RAP-based data access for grounding AI with SAP datasap-cap-advanced — CAP MCP plugin for AI-assisted developmentsap-build-apps — AI-powered low-code app generationsap-integration-suite-advanced — AI-assisted mapping in Integration AdvisorChoose your AI scenario:
| Scenario | Service | Entry Point |
|---|---|---|
| Custom ML model training/serving | AI Core | AI Launchpad → ML Operations |
| LLM orchestration (chat, completion) | Generative AI Hub | AI Core API / orchestration |
| Embed AI in SAP standard apps | Joule | Extension Center / Joule Studio |
| RAG with SAP data | GenAI Hub + HANA Vector | Orchestration service |
| Document extraction | Document Information Extraction | BTP service instance |
Minimal GenAI Hub call (Python):
from gen_ai_hub.proxy.core.proxy_clients import get_proxy_client
from gen_ai_hub.proxy.langchain import ChatOpenAI
proxy_client = get_proxy_client('gen-ai-hub')
llm = ChatOpenAI(
proxy_model_name='gpt-4o',
proxy_client=proxy_client,
temperature=0.0
)
response = llm.invoke("Summarize SAP S/4HANA extensibility options")
print(response.content)
REAL_VECTOR data type (up to 5000 dimensions)COSINE_SIMILARITY, L2DISTANCE, INNER_PRODUCTfrom gen_ai_hub.orchestration.models.message import SystemMessage, UserMessage
from gen_ai_hub.orchestration.models.template import Template, TemplateValue
from gen_ai_hub.orchestration.models.llm import LLM
from gen_ai_hub.orchestration import OrchestrationClient
llm = LLM(name="gpt-4o", version="latest", parameters={"max_tokens": 1000, "temperature": 0.2})
template = Template(
messages=[
SystemMessage("You are an SAP expert assistant. Answer based on the provided context only."),
UserMessage("Context: {{?context}}\n\nQuestion: {{?question}}")
],
defaults=[TemplateValue(name="context", value="No context provided")]
)
client = OrchestrationClient(llm=llm, template=template)
response = client.run(
template_values=[
TemplateValue(name="context", value="S/4HANA supports tier-1 (key user) and tier-2 (developer) extensibility..."),
TemplateValue(name="question", value="What extensibility tiers does S/4HANA support?")
]
)
print(response.content)
from gen_ai_hub.proxy.core.proxy_clients import get_proxy_client
from gen_ai_hub.proxy.langchain import OpenAIEmbeddings, ChatOpenAI
from hdbcli import dbapi
proxy_client = get_proxy_client('gen-ai-hub')
embeddings = OpenAIEmbeddings(proxy_model_name='text-embedding-ada-002', proxy_client=proxy_client)
# 1. Embed the query
query = "How do I create a custom CDS view extension?"
query_vector = embeddings.embed_query(query)
# 2. Search HANA Cloud vector store
conn = dbapi.connect(address='<host>', port=443, user='<user>', password='<pwd>', encrypt=True)
cursor = conn.cursor()
cursor.execute("""
SELECT TOP 5 "CONTENT",
COSINE_SIMILARITY("EMBEDDING", TO_REAL_VECTOR(?)) AS score
FROM "KNOWLEDGE_BASE"
ORDER BY score DESC
""", [str(query_vector)])
chunks = [row[0] for row in cursor.fetchall()]
# 3. Generate answer with context
llm = ChatOpenAI(proxy_model_name='gpt-4o', proxy_client=proxy_client, temperature=0.0)
context = "\n---\n".join(chunks)
response = llm.invoke(f"Context:\n{context}\n\nQuestion: {query}\n\nAnswer based on context only:")
print(response.content)
from gen_ai_hub.orchestration.models.content_filter import ContentFilter, AzureFilterThreshold
input_filter = ContentFilter(
provider="azure",
hate=AzureFilterThreshold.ALLOW_SAFE,
self_harm=AzureFilterThreshold.ALLOW_SAFE,
sexual=AzureFilterThreshold.ALLOW_SAFE,
violence=AzureFilterThreshold.ALLOW_SAFE
)
output_filter = ContentFilter(
provider="azure",
hate=AzureFilterThreshold.ALLOW_SAFE,
self_harm=AzureFilterThreshold.ALLOW_SAFE,
sexual=AzureFilterThreshold.ALLOW_SAFE,
violence=AzureFilterThreshold.ALLOW_SAFE_LOW
)
client = OrchestrationClient(
llm=llm,
template=template,
input_filter=input_filter,
output_filter=output_filter
)
// package.json — add cap-llm-plugin
// "dependencies": { "@cap-js/hana": "^1", "cap-llm-plugin": "^1" }
// srv/ai-service.js
const cds = require('@sap/cds');
module.exports = class AIService extends cds.ApplicationService {
async init() {
this.on('askQuestion', async (req) => {
const { question } = req.data;
const vectorPlugin = await cds.connect.to('cap-llm-plugin');
// RAG: retrieve + generate
const response = await vectorPlugin.getRagResponse(
question,
'KNOWLEDGE_BASE', // HANA table with embeddings
'EMBEDDING', // vector column
'CONTENT', // text column
'text-embedding-ada-002',
'gpt-4o',
5 // top-k
);
return { answer: response };
});
await super.init();
}
};
{
"name": "lookup-material",
"description": "Look up material master data by material number or description",
"parameters": {
"type": "object",
"properties": {
"materialNumber": {
"type": "string",
"description": "SAP material number (e.g., MAT-001)"
},
"searchTerm": {
"type": "string",
"description": "Free text search term for material description"
}
}
},
"endpoint": {
"url": "https://<app>.cfapps.<region>.hana.ondemand.com/api/materials/search",
"method": "POST",
"authentication": "OAuth2ClientCredentials"
}
}
| Error | Message | Root Cause | Fix |
|---|---|---|---|
401 Unauthorized | JWT token validation failed | AI Core service key expired or wrong | Regenerate service key in BTP Cockpit |
429 Too Many Requests | Rate limit exceeded | Too many LLM calls per minute | Implement retry with exponential backoff; check quota |
404 Deployment not found | No running deployment | Model not deployed or deployment scaled to 0 | Check AI Launchpad → Deployments; redeploy |
VECTOR_DIM_MISMATCH | Dimension mismatch | Query vector dimensions ≠ stored vector dimensions | Ensure same embedding model for indexing and querying |
Content filtered | Output blocked by content filter | Response triggered moderation | Adjust filter thresholds or rephrase prompt |
RESOURCE_EXHAUSTED | Resource group quota exceeded | Too many concurrent deployments | Delete unused deployments; request quota increase |
REAL_VECTOR column; never re-embed unchanged contentCREATE HNSW VECTOR INDEX ON "TABLE"("COL")max_tokens in deployment config