Skip to content

Use schema-first chat prompts in the .NET 0.3 preview - #341

Open
robgruen wants to merge 1 commit into
mainfrom
feat/schema-first-dotnet-03
Open

robgruen wants to merge 1 commit into
mainfrom
feat/schema-first-dotnet-03

Conversation

@robgruen

Copy link
Copy Markdown
Collaborator

This maintainer-sponsored draft implements the .NET side of the one-time behavior proposed in microsoft/TypeChat#539. It leaves review, release timing, patch numbers, and NuGet publishing with this project. Please hold merge pending the policy decision and normal .NET review. The separate language candidates are microsoft/TypeChat#241 (Python) and microsoft/TypeChat#540 (TypeScript).

A fresh chat translation sends application-owned schema and instructions as system, then the request once as user. Caller history retains its roles. JsonTranslatorPrompts.Legacy preserves the old wrapped request. Text-only Semantic Kernel no longer silently flattens role-bearing prompts; legacy flattening is explicit. Math, calendar, health-data and shared example code are updated. Existing package identities remain unchanged, and the candidate remains a preview (0.3.0-pre).

Verified offline: Release solution and examples built with zero warnings or errors; 235 unit tests passed, including 15 new recorder cases. A separately installed NuGet consumer passed the same message check as the Python wheel and npm tarball: fresh request, follow-up with history, parseable schema-invalid output, raw assistant reply followed by a user-role repair diagnostic, and validated final result. No live model calls or registry publication.

For coordination: microsoft/typechat.net#334 and microsoft/typechat.net#336 overlap in prompt helpers/adapters or tests. This PR is based on main; it neither depends on nor supersedes either contribution.

Keep the native full-request builders as an explicit legacy choice. Preserve sections and repair behavior; route program grammar, API definitions and sample instructions separately from requests and history. Exercise the layout with offline native recorders.

Independent .NET alignment with the conversation layout discussed in microsoft/TypeChat#241.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

1 participant