--- name: genai-hub-orchestration description: > Configure and use the SAP AI Core Orchestration service: build prompt templates, add content filtering, set up document grounding (RAG) pipelines, and call models via the Harmonized API. WHEN: user asks about the orchestration service, Harmonized API, prompt templating with variables, content filtering, grounding, RAG pipeline, document grounding, or building a pipeline that wraps an LLM. DO NOT USE FOR: creating an orchestration deployment — use `aicore-lifecycle-management` for that; credential setup — use `aicore-admin-resources`; browsing or deploying foundation models directly without a pipeline — use `genai-hub-foundation-models`; direct LLM inference without a pipeline — use `aicore-sdk-java` or `aicore-sdk-js` compatibility: Requires Python 3.11+, uv, and sap-ai-sdk-gen. allowed-tools: Bash, Read --- ## Rules 1. Orchestration always requires a **running orchestration deployment** as a prerequisite — invoke `aicore-lifecycle-management` first if one does not exist. 2. The orchestration endpoint is `POST {DEPLOYMENT_URL}/v2/completion` — not `/v1/chat/completions`. 3. Orchestration `scenario_id` and `executable_id` are always `"orchestration"` — these are fixed. 4. The Harmonized API normalizes all models to OpenAI message format — the same client code works for GPT, Gemini, and Bedrock. 5. If credentials are not configured, invoke `aicore-admin-resources` first. 6. `generative-ai-hub-sdk` is deprecated — always use `sap-ai-sdk-gen`. Import namespace `gen_ai_hub` is shared by both. 7. **If the user's request does not explicitly specify an approach, use `AskUserQuestion` to ask whether they prefer the REST API (curl) or the Python SDK before writing or running any code.** --- ## Deployment Prerequisite Before using the orchestration service, a deployment must be running: ```bash # Check for an existing orchestration deployment: uv run skills/aicore-lifecycle-management/scripts/get_deployments.py --scenario orchestration # If none exists, create a configuration first (reuse if "orchestration" config already exists): uv run skills/aicore-lifecycle-management/scripts/get_configurations.py --scenario-id orchestration --json | jq '.[] | select(.name == "orchestration")' uv run skills/aicore-lifecycle-management/scripts/create_configuration.py \ --name orchestration \ --scenario-id orchestration \ --executable-id orchestration # Then deploy (takes up to 10 minutes): uv run skills/aicore-lifecycle-management/scripts/create_deployment.py --configuration-id --wait --timeout 600 ``` --- ## Workflow | Step | Action | Key Gate | | ---- | ----------------------------------------------------------------------------------- | --------------------------------------------- | | 1 | Verify orchestration deployment is RUNNING | `get_deployments.py --scenario orchestration` | | 2 | **If approach not stated: ask curl (REST API) or Python SDK** via `AskUserQuestion` | User preference | | 3 | Choose pipeline features (templating only / + filtering / + grounding) | User intent | | 4 | Select template from `assets/` or build from scratch | See asset map below | | 5 | Run and verify output | `uv run assets/