Repository navigation
Commit 33200c2
feat: add unified AI prompting and native decision model support (#2811)
* feat: add unified AI prompting and native decision model support
Add AIPrompt on the existing OpenAIPrompt interface for explicit chat,
Responses, embeddings and native decision-model APIs. Preserve request
options, typed results, errors and raw responses through Scala and generated
Python, copy, persistence and pipelines. Add the AIPrompt notebook and guide.
Keep the contribution focused on AIPrompt and small native specializations.
Separate independent legacy defects and optional Delta recovery into their
own issues and PRs. Exercise supported notebook examples on packaged
artifacts, but leave OpenAIDecisions examples commented because Azure
OpenAI/Foundry does not support that API.
- Native inference proposal: #2759
- Deferred recovery: #2800
- Deferred live Decisions qualification: #2760
- Global parameter prerequisite: #2806
- Attachment cancellation prerequisite: #2807
- Response cleanup prerequisite: #2808
- Assigned-session prerequisite: #2809
- Python stub prerequisite: #2810
- Existing tutorial: docs/Explore Algorithms/OpenAI/OpenAI.ipynb
Reuse existing authentication and HTTP infrastructure rather than add a
second inference transport. Keep public behavior in Scala and generate
Python conveniences without changing legacy public JVM signatures or
serialized parameter shapes. Explicit API selection and lossless JSON avoid
silent option loss; bounded cancellation handles interrupted Spark work.
Keep ordinary inference lazy and replayable, without Delta, an automatic
tool loop, response-size configuration or an exactly-once claim.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
* style: format AIPrompt Python regression tests
Summary
- Apply the pinned Black formatter to the AIPrompt regression suite and its
Fabric validation helper.
Prompting Intent
- Keep the focused AIPrompt pull request limited to required feature work
and repairs to its own validation gates.
Linked Sources
- #2811
- https://github.com/microsoft/SynapseML/actions/runs/42014432464
Rationale
- The Python style gate identified formatting in two new test files.
- The changes preserve both files' Python ASTs, and the repository's
tracked Python files pass Black 22.3.0.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
* fix: align AIPrompt coverage count and notebook formatting
## Summary
Account for the additional AI test lane in Codecov's expected upload count
and apply the pinned notebook formatter to the new AIPrompt tutorial.
## Prompting Intent
Repair the deterministic checks introduced by the focused AIPrompt change
without changing dependency pins, workflows, release tooling or unrelated
notebooks, and preserve the already-executed tutorial behavior.
## Linked Sources
- #2759
- #2811
## Rationale
The authorized AI matrix lane raises expected uploads from 54 to 55.
Keep the existing coverage-count assertion unchanged and fix its configuration.
Black 22.3.0 with Jupyter support changes formatting only: all 18 code-cell
ASTs, metadata and markdown remain identical, outputs stay cleared and
OpenAIDecisions remains commented. The full CI Black command and the targeted
coverage-upload selection test pass locally.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
* fix: harden AIPrompt cancellation and compatibility boundaries
Integrate reviewed session-persistence, codegen and attachment fixes; retain
task kill reasons, transport cancellation, value-codec regressions and the
32 supported notebook examples.
Freeze scope, finish running reviews, address blockers, publish and run
current-head CI instead of starting additional full review matrices.
- #2811
- #2818
- #2819
- #2820
Ensure the integrated public AIPrompt path preserves the same cancellation,
persistence and generated-wrapper contracts as the prerequisite fixes.
Keep unsupported Decisions examples commented out and existing limitations
visible. Do not expand scope to unrelated codegen or connector behavior.
Source-scoped qualification covers 511 cognitive and 189 core cases with zero
skips, six notebook cases and 33 installed Python cases. Compile, style,
codegen, packaging and exact installed artifact provenance are retained.
The latest test-only changes passed targeted regressions without altering
the qualified runtime artifacts. Existing reviews and dispositions are
retained; no additional full matrix is claimed. Fresh CI is still required.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
* docs: explain AIPrompt API contracts with a diagram
## Summary
Add a shared API-routing diagram to the AIPrompt getting-started notebook
and usage guide. Clarify supported parameter mappings, intentional legacy
differences, native results and provider availability without changing code.
## Prompting Intent
Explain whether AIPrompt supports all five API types and preserves the
semantics and parameters of OpenAIPrompt and the native decision stages.
Generate an understandable diagram and include it in the PR description
and the getting-started notebook.
## Linked Sources
- #2811
- #2759
- #2760
- docs/Explore Algorithms/OpenAI/Unified AI prompting.md
- cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/ai/AIRequestAdapter.scala
- cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/ai/AIPrompt.scala
- https://github.com/user-attachments/assets/bfcb52f9-b019-455b-9e23-598a44fae229
## Rationale
Use one GitHub-hosted diagram in the PR, notebook and guide, following
the tutorials' hosted-image convention. Combine a generated background
with deterministic labels and connectors for precise technical content.
Keep the existing runnable examples unchanged and explicitly distinguish
Foundry SystemOne from the unsupported Azure OpenAI/Foundry Decisions path.
Describe per-API support instead of claiming universal legacy parity.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
* fix: route AIPrompt API versions without a version allowlist
Summary:
- Select the v1 Chat Completions and Responses route with apiVersion.
- Forward other version strings in api-version, including for Decisions.
- Default OpenAIDecisions to v1 while preserving complete URL overrides.
- Cover scalar, per-row and persisted versions and document migration.
Prompting Intent:
Let callers use v1, preview, dated and future API versions through the
existing parameter without library-maintained version restrictions.
Linked Sources:
- User request to select the v1 URI and forward all other version strings.
- #2759
- #2811
Rationale:
API version selection belongs to the provider. Reuse the existing
ServiceParam and preserve public signatures, legacy stages and URL
override behavior instead of introducing a separate routing parameter.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
* fix: default AIPrompt chat and responses to v1
Summary:
- Default Chat Completions and Responses requests to the v1 route.
- Preserve explicit and configured version overrides and embedding defaults.
- Cover default routing through copy, save/load and clearing an override.
- Update the usage guide and notebook migration notes.
Prompting Intent:
Keep v1 as the default API version for Chat Completions and Responses,
alongside the existing OpenAIDecisions v1 default.
Linked Sources:
- User request: keep v1 as the default for Chat Completions and Responses.
- #2811
- #2759
Rationale:
Use the v1 route without requiring a redundant setter. Change only the
generative fallback so configured scalar and per-row versions, complete
URL overrides, embeddings and legacy OpenAI stages retain their behavior.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
* fix: support Foundry Decisions inference
Foundry exposes Decisions for supported gpt-6-luna deployments, but the
new stages rejected Azure hosts before HTTP and selected bearer-key
authentication for every Decisions endpoint.
Route Azure resource roots through /openai/v1/decisions, retain api-key
authentication for Azure keys, and preserve Entra, proxy, version and
complete-URL behavior. Replace obsolete rejection tests with routing and
authentication regressions. Add opt-in Chat and Responses live tests,
enable the notebook's Foundry Decisions examples, and correct the guide
and shared diagram.
User intent: correct Foundry support and live-test all four inference APIs.
Sources: #2759, #2760,
https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/decisions
Validation: 215 Scala cases, 33 installed-package Python cases, six
notebook tests and four real service tests passed with zero skips.
The live tests exercised Chat, Responses, Decisions and SystemOne using
six valid stage invocations on existing Sweden Central deployments.
Compilation, Scala style, Python formatting, codegen and packaging passed.
Loaded JARs and generated Python sources matched the validated build.
No new deployments or dependency changes; no full notebook rerun or
current-head remote CI pass is claimed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e67331 parent 80191a6 commit 33200c2
95 files changed
Lines changed: 18887 additions & 377 deletions
File tree
- cognitive/src
- main/scala/com/microsoft/azure/synapse/ml/services
- ai
- openai
- test
- java/synapsemltest/ai
- python/synapsemltest/services
- scala/com/microsoft/azure/synapse/ml/services
- ai
- openai
- core/src
- main
- python/synapse/ml/core/schema
- scala
- com/microsoft/azure/synapse/ml
- codegen
- io/http
- org/apache/spark
- injections
- ml
- sql/internal
- test/scala
- com/microsoft/azure/synapse/ml
- core/serialize
- io/split1
- nbtest
- org/apache/spark
- docs/Explore Algorithms/OpenAI
- reviews/pr-2811
- tools/ci/tests
- website
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
333 | 335 | | |
334 | 336 | | |
335 | 337 | | |
| |||
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
394 | 391 | | |
395 | 392 | | |
396 | 393 | | |
| |||
421 | 418 | | |
422 | 419 | | |
423 | 420 | | |
424 | | - | |
| 421 | + | |
| 422 | + | |
425 | 423 | | |
426 | 424 | | |
427 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
0 commit comments