Skip to content

feat: add prompt-caching examples and migrate active text tests to gpt-6-luna - #2781

Open
Rana Singh (ranadeepsingh) wants to merge 8 commits into
microsoft:masterfrom
ranadeepsingh:copilot/openai-luna-defaults
Open

Rana Singh (ranadeepsingh) wants to merge 8 commits into
microsoft:masterfrom
ranadeepsingh:copilot/openai-luna-defaults

Conversation

@ranadeepsingh

@ranadeepsingh Rana Singh (ranadeepsingh) commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Why this change

DataFrame workloads often resend the same instructions and reference material for every row. SynapseML currently lacks a dedicated prompt_cache_options parameter and rejects documented input-content cache breakpoints, preventing callers from expressing OpenAI's explicit caching requests.

This PR forwards those options and breakpoints without a client-side model, mode, or lifetime whitelist, and adds a complete notebook walkthrough. It also updates active text-generation examples and live-test selections to gpt-6-luna, while preserving caller-selected deployments, embedding models, and deliberate legacy compatibility coverage. Generic transformers do not acquire an automatic model default.

The existing Fabric model-availability preflight retains its failure behavior and adds conditional guidance about the OpenAI-as-a-Microsoft-Subprocessor setting.

What the notebook demonstrates

  • A stable, substantial developer-message prefix followed by changing questions.
  • Explicit request-level options and prompt_cache_breakpoint inside actual input content—not merely an options column.
  • Scalar options, row-bound options, and an implicit-caching OpenAIPrompt example.
  • Native OpenAI Python SDK and SynapseML requests, provider errors, and cached-token usage.

OpenAI documentation

Python SDK versus SynapseML

Run these snippets in order with a Spark session, a SynapseML build containing this change, and the OpenAI SDK installed. Set OPENAI_BASE_URL to your Azure OpenAI v1 URL ending in /openai/v1/, OPENAI_API_KEY to your key, and OPENAI_DEPLOYMENT to your chosen deployment. No deployment is created or changed.

Shared input and options

import os

endpoint = os.environ["OPENAI_BASE_URL"]
key = os.environ["OPENAI_API_KEY"]
deployment = os.environ["OPENAI_DEPLOYMENT"]
options = {"mode": "explicit", "ttl": "30m"}
prefix = "Answer using this product catalog.\n" + "\n".join(
    f"Product {n}: warranty {1 + n % 3} years; returns within 30 days with a receipt. "
    "Report shipping damage within seven days; repairs require a serial number."
    for n in range(1, 81)
)
messages = [
    {
        "role": "developer",
        "content": [{
            "type": "input_text",
            "text": prefix,
            "prompt_cache_breakpoint": {"mode": "explicit"},
        }],
    },
    {
        "role": "user",
        "content": [{"type": "input_text", "text": "What is Product 17's warranty?"}],
    },
]

OpenAI Python SDK

from openai import OpenAI

with OpenAI(api_key=key, base_url=endpoint) as client:
    response = client.responses.create(
        model=deployment,
        input=messages,
        prompt_cache_options=options,
        reasoning={"effort": "low"},
        text={"verbosity": "low"},
        store=False,
    )
print(response.output_text)
print(response.usage.input_tokens_details.cached_tokens)

SynapseML

from pyspark.sql import SparkSession
from synapse.ml.services.openai import OpenAIResponses

spark = SparkSession.builder.getOrCreate()
schema = (
    "messages array<struct<role:string,content:array<struct<type:string,text:string,"
    "prompt_cache_breakpoint:map<string,string>>>>>"
)
rows = spark.createDataFrame([(messages,)], schema)
transformer = (
    OpenAIResponses()
    .setUrl(endpoint)
    .setSubscriptionKey(key)
    .setDeploymentName(deployment)
    .setMessagesCol("messages")
    .setPromptCacheOptions(options)
    .setReasoningEffort("low")
    .setVerbosity("low")
    .setOutputCol("response")
    .setErrorCol("error")
)
transformer.transform(rows).select(
    "response.output", "response.usage.input_tokens_details.cached_tokens", "error"
).show(truncate=False)

Mapping and behavior

OpenAI field SynapseML surface
Top-level prompt_cache_options setPromptCacheOptions(dict) or setPromptCacheOptionsCol(column)
Responses input OpenAIResponses.setMessagesCol(column)
input[].content[].prompt_cache_breakpoint The same nested DataFrame field on existing input_text, input_image, or input_file content
Chat messages[].content[].prompt_cache_breakpoint The same field on supported Chat content; text uses type="text"
Responses cached tokens response.usage.input_tokens_details.cached_tokens
Chat cached tokens response.usage.prompt_tokens_details.cached_tokens
OpenAIPrompt normalized usage column usage.input_token_details["cached_tokens"] for either API; this is a map, unlike the raw response structs

An unset parameter or null options-column value omits the field, preserving service defaults. Selecting the column binding replaces the scalar binding. JSON values, including booleans, retain their types. Use a Spark struct column for mixed string/Boolean objects; string-valued maps are sufficient for mode and ttl. The inherited Foundry serialization path also forwards the option rather than silently dropping it.

Explicit mode needs input breakpoints; options alone do not enable explicit cache reads or writes. Top-level Responses instructions cannot hold a breakpoint, which is why the example uses developer-message content. Ordinary OpenAIPrompt templates do not insert markers; its notebook example therefore uses implicit mode.

Keep the reusable prefix stable and place variable input after it. The service decides eligibility and support; cache hits, latency improvements, and savings are not guaranteed. The examples do not assert positive cached-token counts.

The examples use 30m and a mode-only breakpoint. The guide documents additional Responses lifetime behavior, while some generated references and provider deployments differ. SynapseML forwards serializable values and exposes provider errors through the error column; it does not enforce a 30m-only rule. prompt_cache_options.ttl is not translated into the older prompt_cache_retention policy. Existing usage schemas expose cached_tokens, but neither the cache-write counters nor their TTL breakdown.

Validation

  • Affected Scala production/test compilation, all four Scala style scopes, and pinned Black checks passed.
  • 69 focused Scala tests passed, including real Spark HTTP serialization and provider-error propagation.
  • Freshly generated and isolated installed wrappers: 25 Python tests plus 12 subtests passed; all 251 installed Python members matched their wheels.
  • Repository-pinned OpenAI SDK 2.47.0: exact extracted notebook request, nested markers, omission, Chat mapping, and provider-error propagation verified with mocked transport.
  • Exact native notebook example passed against the existing deployment; a deliberately invalid lifetime returned the provider's HTTP 400 invalid_request_error. No cache-hit assertion.
  • All five executable cache tutorial cells passed with seven mocked requests and seven live requests. The mocked test compares native SDK and SynapseML scalar request bodies exactly and accepts zero cache hits.
  • Mixed-type struct columns were verified through both direct API transformers and both OpenAIPrompt routes: eight HTTP requests preserved string/Boolean values. The same four routes failed before the fix.
  • All three runnable snippets above executed successfully against a loopback service with real Spark; native SDK and SynapseML request bodies matched exactly.
  • Local runtime: JDK 11 and Spark 3.5.0. Python 3.12.3 differs from the target's 3.11.8; the local PySpark Scala library is 2.12.18 versus the build's 2.12.17.
  • Six independent full-patch precommit review lenses passed on the same frozen 29-path source.
  • SHA-pinned manual Azure build 242404552 finished failed: Black requires line wrapping in two new OpenAI.ipynb cells. The selected local Python Black checks did not cover notebook formatting. This correction remains outstanding.
  • Published CI results include 270 OpenAI passes plus two intentional custom-endpoint ignores, 167 cognitive Python passes, 43 CPU and 4 GPU notebook passes, and 111 website sample passes. The new cache serialization, provider-error and Python persistence tests passed.
  • All 54 coverage-publication tasks were skipped by the manual-run coverage condition. The Azure Pipelines app posted the failed aggregate on the verified synthetic merge commit, not the source-head check rollup. Neither coverage nor full CI is qualified.
  • Automated review identified one stale review-index entry. Its artifact-only correction links the current finding/resolution and complete precommit pass without changing source. The distinct final CI-qualified review remains pending.
  • Successful predecessor CI does not qualify this amendment; no package has been released.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 19:47
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown

Hey Rana Singh (@ranadeepsingh) 👋!
Thank you so much for contributing to our repository 🙌.
Someone from SynapseML Team will be reviewing this pull request soon.

We use semantic commit messages to streamline the release process.
Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix.
This helps us to create release messages and credit you for your hard work!

Examples of commit messages with semantic prefixes:

  • fix: Fix LightGBM crashes with empty partitions
  • feat: Make HTTP on Spark back-offs configurable
  • docs: Update Spark Serving usage
  • build: Add codecov support
  • perf: improve LightGBM memory usage
  • refactor: make python code generation rely on classes
  • style: Remove nulls from CNTKModel
  • test: Add test coverage for CNTKModel

To test your commit locally, please follow our guild on building from source.
Check out the developer guide for additional guidance on testing your change.

Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Oct 21, 2026
## Summary
Move the six qualifying pre-commit review artifacts into reviews/pr-2781
without changing their bytes, and add an old-to-new path/hash index.

## Prompting Intent
Publish the reviewed change with durable, public-safe evidence in the actual
numbered PR directory. Preserve historical feedback and privacy exclusions
without recursively reviewing review text.

## Linked Sources
- microsoft#2781
- reviews/pr-2781/index.md

## Rationale
The initial public commit retains the original artifact paths. The migration
index makes their provenance and unchanged bytes explicit, while recording
current validation and the still-pending remote CI/final review gates.
Only allocated review evidence changes; the reviewed product manifest is
unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Current-head service-backed CI, branch-pinned Python validation, and final CI-qualified review remain pending.

No open issues 🎉

What changed in this PR

Adds opt-in prompt-cache controls to SynapseML’s OpenAI transformers while preserving provider defaults and caller-selected deployments.

Changes:

  • Adds validated scalar/per-row cache options, serializer forwarding, and persistence coverage.
  • Updates current examples and test selections to gpt-6-luna.
  • Adds conditional Fabric administrator guidance and records validation evidence.
File Description
reviews/​pre-pr-luna-defaults-cache/​task-unknown-attempt-2-stage-attempt-1-review-6-gpt-6.1-sol.md Records hardening review and validation limitations.
reviews/​pre-pr-luna-defaults-cache/​task-unknown-attempt-2-stage-attempt-1-review-5-gpt-6.1-sol.md Records test-coverage review.
reviews/​pre-pr-luna-defaults-cache/​task-unknown-attempt-2-stage-attempt-1-review-4-gpt-6.1-sol.md Records correctness review.
reviews/​pre-pr-luna-defaults-cache/​task-unknown-attempt-2-stage-attempt-1-review-3-gpt-6.1-sol.md Records robustness review.
reviews/​pre-pr-luna-defaults-cache/​task-unknown-attempt-2-stage-attempt-1-review-2-gpt-6.1-sol.md Records architecture review.
reviews/​pre-pr-luna-defaults-cache/​task-unknown-attempt-2-stage-attempt-1-review-1-gpt-6.1-sol.md Records initial source review.
docs/​Explore Algorithms/​OpenAI/​Quickstart - Understand and Search Forms.ipynb Updates example deployment.
docs/​Explore Algorithms/​OpenAI/​Quickstart - Multimodal OpenAI Prompter with Responses API.ipynb Updates Responses example deployment.
docs/​Explore Algorithms/​OpenAI/​OpenAI.ipynb Documents caching and updates reasoning examples.
docs/​Explore Algorithms/​OpenAI/​Langchain.ipynb Updates LangChain example deployment.
core/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​fabric/​OpenAIFabricSettingSuite.scala Tests conditional guidance and existing status gates.
core/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​fabric/​OpenAIFabricSetting.scala Extends missing-model administrator guidance.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIV1EndpointSuite.scala Updates endpoint-test model fixtures.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIResponsesSuite.scala Updates Responses fixtures.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIResponsesMultimodalSuite.scala Updates multimodal Responses fixtures.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptSuite.scala Updates prompt model selections and assertions.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptResponsesSuite.scala Updates live Responses selection and reasoning settings.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptMultimodalRequestSuite.scala Tests Foundry cache forwarding; updates fixtures.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIPromptCacheSuite.scala Tests cache validation, omission, and serialization.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIEmbeddingsSuite.scala Updates non-embedding default fixture.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIChatCompletionSuite.scala Updates chat test selections and fixtures.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIChatCompletionMultimodalSuite.scala Updates multimodal chat fixtures.
cognitive/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIAPIKey.scala Updates shared live-test deployment.
cognitive/​src/​test/​python/​synapsemltest/​services/​test_ServiceParamPythonBridge.py Tests generated cache accessors, copying, and persistence.
cognitive/​src/​test/​python/​synapsemltest/​services/​openai/​test_StructuredOutput.py Updates structured-output deployment.
cognitive/​src/​test/​python/​synapsemltest/​services/​openai/​test_OpenAIResponsesMultimodal.py Updates Responses model fixture.
cognitive/​src/​test/​python/​synapsemltest/​services/​openai/​test_OpenAIMultimodalRequest.py Updates request and response fixtures.
cognitive/​src/​test/​python/​synapsemltest/​services/​openai/​test_OpenAIDefaults.py Updates defaults-test deployment.
cognitive/​src/​test/​python/​synapsemltest/​services/​openai/​test_OpenAIChatCompletionMultimodal.py Updates chat model fixture.
cognitive/​src/​test/​python/​synapsemltest/​services/​langchain/​test_LangchainTransform.py Updates LangChain model fixtures.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIResponses.scala Includes cache options in Responses payloads.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAIChatCompletion.scala Includes cache options in chat payloads.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​openai/​OpenAI.scala Defines cache parameters and shared validation.
cognitive/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​services/​aifoundry/​AIFoundryChatCompletion.scala Includes cache options in Foundry payloads.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 21, 2026 19:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Supplied evidence leaves current-head service-backed CI and branch-pinned Python validation pending for the cross-language API changes.

No open issues 🎉

Review effort: Balanced

Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Oct 21, 2026
## Summary
Ask for full-sentence favorite-color answers in three live-test fixtures.
Preserve the existing minimum-length assertions and all production behavior.
Include the complete fresh six-lens pre-commit evidence and integrate the
upstream website lockfile update without rewriting published history.

## Prompting Intent
Diagnose PR microsoft#2781's failed OpenAI tests, preserve completed E2E evidence,
fix the demonstrated cause without weakening tests, and require fresh
engineering validation before final CI-qualified review.

## Linked Sources
- PR and current checks: microsoft#2781
- Target update: microsoft#2780
- Review evidence: reviews/pr-2781/index.md
- Trusted workflow: .github/skills/synapseml-pr-loop/

## Rationale
Luna correctly returned "Red." to a question that permits a short answer.
The tests instead required more than ten characters. Requesting a full sentence
aligns the fixture with that assertion rather than weakening the assertion,
changing deployments, or modifying serializers. All 55 affected live tests
passed locally with one unchanged intentional ignore. The complete frozen
patch passed six sequential independent gpt-6.1-sol/max reviews.
Fresh PR-head CI and final CI-qualified review remain required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
Copilot AI balanced review requested due to automatic review settings October 21, 2026 21:50
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The supplied evidence leaves current-head CI, branch-pinned Python validation, and the final CI-qualified review outstanding for these cross-language, provider-facing changes.

No open issues 🎉

Review effort: Balanced

Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Oct 23, 2026
## Summary
Move the six qualifying pre-commit review artifacts into reviews/pr-2781
without changing their bytes, and add an old-to-new path/hash index.

## Prompting Intent
Publish the reviewed change with durable, public-safe evidence in the actual
numbered PR directory. Preserve historical feedback and privacy exclusions
without recursively reviewing review text.

## Linked Sources
- microsoft#2781
- reviews/pr-2781/index.md

## Rationale
The initial public commit retains the original artifact paths. The migration
index makes their provenance and unchanged bytes explicit, while recording
current validation and the still-pending remote CI/final review gates.
Only allocated review evidence changes; the reviewed product manifest is
unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Oct 23, 2026
## Summary
Ask for full-sentence favorite-color answers in three live-test fixtures.
Preserve the existing minimum-length assertions and all production behavior.
Include the complete fresh six-lens pre-commit evidence and integrate the
upstream website lockfile update without rewriting published history.

## Prompting Intent
Diagnose PR microsoft#2781's failed OpenAI tests, preserve completed E2E evidence,
fix the demonstrated cause without weakening tests, and require fresh
engineering validation before final CI-qualified review.

## Linked Sources
- PR and current checks: microsoft#2781
- Target update: microsoft#2780
- Review evidence: reviews/pr-2781/index.md
- Trusted workflow: .github/skills/synapseml-pr-loop/

## Rationale
Luna correctly returned "Red." to a question that permits a short answer.
The tests instead required more than ten characters. Requesting a full sentence
aligns the fixture with that assertion rather than weakening the assertion,
changing deployments, or modifying serializers. All 55 affected live tests
passed locally with one unchanged intentional ignore. The complete frozen
patch passed six sequential independent gpt-6.1-sol/max reviews.
Fresh PR-head CI and final CI-qualified review remain required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Oct 23, 2026
## Summary
Repair the review archive's commit references after rebasing onto current master
and distinguish successful historical tests from failed coverage publication.
All twelve original review files and the complete reviewed source patch remain
unchanged.

## Prompting Intent
The engineer requested rebasing the personal feature branch onto the latest
target and rerunning CI, while preserving review history, exact source evidence,
privacy boundaries, and the original remote-head lease.

## Linked Sources
- Pull request: microsoft#2781
- Target: microsoft@71346cf
- Review evidence and migration hashes: reviews/pr-2781/index.md
- Trusted loop and evidence retention: .github/skills/synapseml-pr-loop/references/loop-control.md

## Rationale
Keep the original feedback bytes and repaired reachable commit links instead of
rewriting reviews or treating stale CI as current. The historical R tests passed;
their coverage upload failed TLS certificate-name validation. Fresh configured CI
must validate the new head without bypassing coverage, TLS, tests, or review gates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
Copilot AI balanced review requested due to automatic review settings October 23, 2026 07:50
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Supplied evidence does not establish completed current-head CI and final qualification for the cross-service Scala/Python API changes.

No open issues 🎉

Review effort: Balanced

## Summary
Add optional prompt cache options to OpenAI Chat Completions, Responses and
OpenAIPrompt, including its Foundry delegate. Update active text-generation
examples and test selections to gpt-6-luna, and make the existing Fabric
missing-model error offer conditional administrator guidance.

## Prompting Intent
Expose strict optional mode/TTL controls through Scala and generated Python
map/column bindings. Preserve caller-selected deployments, embedding models,
historical documentation and deliberate offline compatibility tests. Do not
introduce a generic transformer model default or automatic cache breakpoints.

## Linked Sources
- User-requested cache controls, active Luna selections, and model-availability guidance.
- https://developers.openai.com/api/docs/guides/prompt-caching
- https://learn.microsoft.com/en-us/fabric/admin/service-admin-portal-copilot
- reviews/pre-pr-luna-defaults-cache/: six independent pre-commit review artifacts.

## Rationale
Reuse ServiceParam serialization and generated wrappers rather than adding a
parallel Python API. Validate both scalar and row-bound options before request
serialization. Preserve the existing Fabric availability gate and add only
conditional advice. A Foundry forwarding regression found during review is
covered by request-level and public-transform tests.

Local compilation/style checks, targeted Scala tests, notebook/Black checks,
and fresh generated-wrapper tests passed. Exact branch Python and current-head
remote CI remain pending. Public-safe review artifacts use the explicitly
authorized temporary pre-PR directory until the real PR number is assigned.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
## Summary
Move the six qualifying pre-commit review artifacts into reviews/pr-2781
without changing their bytes, and add an old-to-new path/hash index.

## Prompting Intent
Publish the reviewed change with durable, public-safe evidence in the actual
numbered PR directory. Preserve historical feedback and privacy exclusions
without recursively reviewing review text.

## Linked Sources
- microsoft#2781
- reviews/pr-2781/index.md

## Rationale
The initial public commit retains the original artifact paths. The migration
index makes their provenance and unchanged bytes explicit, while recording
current validation and the still-pending remote CI/final review gates.
Only allocated review evidence changes; the reviewed product manifest is
unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
## Summary
Ask for full-sentence favorite-color answers in three live-test fixtures.
Preserve the existing minimum-length assertions and all production behavior.
Include the complete fresh six-lens pre-commit evidence and integrate the
upstream website lockfile update without rewriting published history.

## Prompting Intent
Diagnose PR microsoft#2781's failed OpenAI tests, preserve completed E2E evidence,
fix the demonstrated cause without weakening tests, and require fresh
engineering validation before final CI-qualified review.

## Linked Sources
- PR and current checks: microsoft#2781
- Target update: microsoft#2780
- Review evidence: reviews/pr-2781/index.md
- Trusted workflow: .github/skills/synapseml-pr-loop/

## Rationale
Luna correctly returned "Red." to a question that permits a short answer.
The tests instead required more than ten characters. Requesting a full sentence
aligns the fixture with that assertion rather than weakening the assertion,
changing deployments, or modifying serializers. All 55 affected live tests
passed locally with one unchanged intentional ignore. The complete frozen
patch passed six sequential independent gpt-6.1-sol/max reviews.
Fresh PR-head CI and final CI-qualified review remain required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
## Summary
Repair the review archive's commit references after rebasing onto current master
and distinguish successful historical tests from failed coverage publication.
All twelve original review files and the complete reviewed source patch remain
unchanged.

## Prompting Intent
The engineer requested rebasing the personal feature branch onto the latest
target and rerunning CI, while preserving review history, exact source evidence,
privacy boundaries, and the original remote-head lease.

## Linked Sources
- Pull request: microsoft#2781
- Target: microsoft@71346cf
- Review evidence and migration hashes: reviews/pr-2781/index.md
- Trusted loop and evidence retention: .github/skills/synapseml-pr-loop/references/loop-control.md

## Rationale
Keep the original feedback bytes and repaired reachable commit links instead of
rewriting reviews or treating stale CI as current. The historical R tests passed;
their coverage upload failed TLS certificate-name validation. Fresh configured CI
must validate the new head without bypassing coverage, TLS, tests, or review gates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
## Summary
Keep the initial migration focused on explicit gpt-6-luna selections in current
examples and live test fixtures, necessary fixture compatibility, and conditional
Fabric model-availability advice. Restore the new cache-related production and
bridge changes to the target baseline, remove the added cache-only tests and
documentation, and retain all prior public review evidence.

## Prompting Intent
The engineer requested a lean initial Luna migration with all new prompt-cache
controls deferred to a later follow-up. Preserve existing caching behavior,
caller-selected deployments, embeddings, legacy compatibility cases, historical
documentation and generic transformer defaults. Preserve the exact deferred
implementation and prior artifacts; do not invent a release or alter policies,
deployments, tenant settings, approvals or merge state.

## Linked Sources
- Pull request: microsoft#2781
- Current source review: reviews/pr-2781/task-unknown-attempt-4-stage-attempt-1-review-6-gpt-6.1-sol.md
- Retained review history and migration accounting: reviews/pr-2781/index.md
- Public repository workflow: .github/skills/synapseml-pr-loop/SKILL.md

## Rationale
The model migration does not require a new caching API or dependency release.
Restoring the existing cognitive API preserves its established behavior and
avoids coupling initial migration delivery to the deferred feature. Prior
implementation bytes and candidate artifacts remain preserved separately, and
all earlier public reviewer responses remain intact.

## Validation
Four compilation scopes, four Scala style scopes, 60 offline Scala tests,
55 live Scala tests, 23 installed Python bridge tests plus six subtests,
Black on six changed Python files, four notebook structural checks and both
code-generation tasks passed. One existing Custom EndPoint test remains
intentionally ignored. Six sequential independent gpt-6.1-sol/max pre-commit
reviews are clean. Local Python3.12.3 and bundled Scala2.12.18 are not exact
matches for target Python3.11.8 and build Scala2.12.17.

The frozen23-path patch is independently byte-identical when applied to the
latest website-only target update. Branch integration, fresh current-head CI
and automated review, and the separate final CI-qualified review remain pending.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
## Summary
Repair archival review links after rebasing the model-only migration onto
latest master, and distinguish passed historical tests from failed coverage
publication and still-required fresh narrowed-head validation.

## Prompting Intent
Deliver only the Luna model migration and necessary compatibility guidance,
defer new prompt-cache controls, preserve review originals, integrate latest
master under the explicit ownership guard, and rerun current-head CI.

## Linked Sources
- Public PR: microsoft#2781
- Review evidence: reviews/pr-2781/index.md
- Trusted workflow: .github/skills/synapseml-pr-loop/SKILL.md
- Trusted retention and CI contracts: .github/skills/synapseml-pr-loop/references/loop-control.md and ci-evidence.md
- Historical pipeline: https://dev.azure.com/microsoft/SynapseML/_build/results?buildId=242356862

## Rationale
The latest target changes only website files. The full 23-path source patch,
canonical manifest, and every earlier review artifact are unchanged. Keep
content review evidence, but require fresh SHA-bound CI and the separate final
review. Preserve all history rather than squash or rewrite original feedback.
This documentation-only provenance update deliberately excludes private
tracking identifiers under the publication confidentiality requirement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
@ranadeepsingh Rana Singh (ranadeepsingh) changed the title feat: expose prompt cache controls and update OpenAI examples fix: migrate active OpenAI examples and tests to gpt-6-luna Oct 23, 2026
Copilot AI balanced review requested due to automatic review settings October 23, 2026 09:52
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Fresh CI for the narrowed current head and the separate final CI-qualified review remain outstanding.

No open issues 🎉

Review effort: Balanced

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

## Summary
Let DataFrame callers express OpenAI prompt caching through request-level
options and actual input-content breakpoints. Add executable native Python
SDK and SynapseML examples while preserving the existing Luna migration.

## Prompting Intent
Demonstrate explicit options, input breakpoints and row-bound configuration
in the existing notebook. Preserve serializable values, let the provider
validate cache policy, and explain defaults, usage and nonguaranteed hits.
Keep deployment choice, existing compatibility behavior and package pins.

## Linked Sources
- Pull request: microsoft#2781
- Caching guide: https://developers.openai.com/api/docs/guides/prompt-caching
- Responses API: https://developers.openai.com/api/reference/resources/responses/methods/create
- Chat API: https://developers.openai.com/api/reference/resources/chat
- Python SDK: https://developers.openai.com/api/docs/libraries
- Verified request types: https://github.com/openai/openai-python/blob/81792ff040a2ca2b70348163049d3d69d5ba95cf/src/openai/types/responses/response_create_params.py
- Review evidence and finding resolution: reviews/pr-2781/

## Rationale
Use the existing ServiceParam scalar/column abstraction rather than adding
a separate configuration hierarchy or a model/mode/TTL whitelist. Normalize
nested Spark structs only for cache options so mixed JSON types survive
without changing unrelated serializers. Retain focused before/after HTTP,
wrapper and persistence tests and all review evidence.

Local gates passed: 69 Scala tests, 25 Python tests plus 12 subtests, styles,
Black, generated artifacts and exact notebook mock/live examples. Six
independent precommit lenses are clean. Current-head CI and final review
remain required; no release or merge is performed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
@ranadeepsingh Rana Singh (ranadeepsingh) changed the title fix: migrate active OpenAI examples and tests to gpt-6-luna feat: add prompt-caching examples and migrate active text tests to gpt-6-luna Oct 23, 2026
Copilot AI balanced review requested due to automatic review settings October 23, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Current-head CI and final qualification remain pending for the cross-language serialization and live-deployment changes.

1 open issue

Review effort: Balanced

Comment thread reviews/pr-2781/index.md Outdated
## Summary
Correct the review index so readers see the cache-refined source, pass-5
finding and resolution, and the complete clean pass-6 evidence first.
Record the actual failed notebook-style gate and unqualified manual-run
coverage without implying that passing functional tests make CI green.

## Prompting Intent
Address the automated review's stale-index finding, retain earlier feedback,
and distinguish current evidence from historical model-only qualification.
Publish only allocated review metadata under the artifact-only exception.
Do not modify source, reset review budgets, waive checks, or claim readiness.

## Linked Sources
- PR: microsoft#2781
- Finding: microsoft#2781 (comment)
- Reviewed source: microsoft@51343aa
- Current review aggregate: reviews/pr-2781/task-unknown-attempt-6-stage-attempt-1-review-6-gpt-6.1-sol.md
- Finding resolution: reviews/pr-2781/task-unknown-attempt-5-stage-attempt-1-review-5-gpt-6.1-sol.md
- Artifact-only policy: .github/skills/synapseml-pr-loop/references/loop-control.md

## Rationale
Keep the historical sections intact but clearly subordinate to current
scope and evidence. The complete 29-path source manifest is unchanged.
Named CI test proof is separate from the failed style, skipped coverage,
required-check binding and final-review gates. The exhausted source-review
budget remains a blocker, not permission to silently extend the process.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4f9a58fc-ce1f-4a73-951d-4794857a150a
Copilot AI balanced review requested due to automatic review settings October 23, 2026 17:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The unresolved notebook-formatting failure blocks the required CI gate, and successful current-source qualification remains outstanding.

1 open issue
1 resolved since last review

Review effort: Balanced

" [\n",
" StructField(\"type\", StringType(), False),\n",
" StructField(\"text\", StringType(), True),\n",
" StructField(\"prompt_cache_breakpoint\", MapType(StringType(), StringType()), True),\n",

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants