You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add preamble section and preserve action to SDKs (#1713)
* Add preamble section and preserve action to SDKs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add E2E test for replaced preamble section across SDKs
Adds a 'should_use_replaced_preamble_section_in_response' E2E test to all
six SDKs (Node, Go, Python, .NET, Java, Rust) exercising the new 'preamble'
section ID end-to-end, with a shared replay snapshot. Updates the Java
SystemMessageSections constant-count assertion from 11 to 12.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Align getting-started unknown-section docs with SDK READMEs
Remove the unsupported 'a warning is emitted' claim from the system
message customization section so it matches the silent-fallback behavior
documented in the language READMEs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix Ruff E501 line-length in preamble E2E test docstring
The new preamble test docstring exceeded the 100-char limit, failing
'ruff check' in the Python SDK Tests CI job across all platforms.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add SectionPreamble to go/README SystemMessage keys list
The SystemMessage parameter-reference table's inline section-constant
list still started at SectionIdentity. Add SectionPreamble so it matches
the dedicated 'Available section constants' list and the other SDKs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Each override supports four actions: `replace`, `remove`, `append`, and `prepend`. Unknown section IDs are handled gracefully—content is appended to additional instructions and a warning is emitted; `remove` on unknown sections is silently ignored.
1916
+
`identity` and `tool_instructions` are section *groups*: they target a collection of related sub-sections as a unit. Use `preamble` to target just the identity preamble without affecting its sibling sub-sections.
1917
+
1918
+
Each override supports five actions: `replace`, `remove`, `append`, `prepend`, and `preserve`. The `preserve` action is a no-op that opts an individually-addressable section out of a group-level `remove` (for example, keep `tone` when removing the `identity` group). Unknown section IDs are handled gracefully: content from `replace`/`append`/`prepend` overrides is appended to additional instructions, and `remove` overrides are silently ignored.
1917
1919
1918
1920
See the language-specific SDK READMEs for examples in [TypeScript](../nodejs/README.md), [Python](../python/README.md), [Go](../go/README.md), [Rust](../rust/README.md), [Java](../java/README.md), and [C#](../dotnet/README.md).
Copy file name to clipboardExpand all lines: dotnet/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -677,9 +677,9 @@ var session = await client.CreateSessionAsync(new SessionConfig
677
677
});
678
678
```
679
679
680
-
Available section IDs are defined as static properties on the `SystemMessageSection` struct: `Identity`, `Tone`, `ToolEfficiency`, `EnvironmentContext`, `CodeChangeRules`, `Guidelines`, `Safety`, `ToolInstructions`, `CustomInstructions`, `RuntimeInstructions`, `LastInstructions`.
680
+
Available section IDs are defined as static properties on the `SystemMessageSection` struct: `Preamble`, `Identity`, `Tone`, `ToolEfficiency`, `EnvironmentContext`, `CodeChangeRules`, `Guidelines`, `Safety`, `ToolInstructions`, `CustomInstructions`, `RuntimeInstructions`, `LastInstructions`. `Identity` and `ToolInstructions` are section groups that target a collection of related sub-sections as a unit; use `Preamble` to target just the identity preamble.
681
681
682
-
Each section override supports four actions: `Replace`, `Remove`, `Append`, and `Prepend`. Unknown section IDs are handled gracefully: content is appended to additional instructions, and `Remove` overrides are silently ignored.
682
+
Each section override supports five actions: `Replace`, `Remove`, `Append`, `Prepend`, and `Preserve` (a no-op that opts an individually-addressable section out of a group-level `Remove`). Unknown section IDs are handled gracefully: content is appended to additional instructions, and `Remove` overrides are silently ignored.
`SectionIdentity` and `SectionToolInstructions` are section _groups_ that target a collection of related sub-sections as a unit. Use `SectionPreamble` to target just the identity preamble without affecting its sibling sub-sections.
244
+
245
+
Each section override supports five actions:
244
246
245
247
-**`replace`** — Replace the section content entirely
246
248
-**`remove`** — Remove the section from the prompt
247
249
-**`append`** — Add content after the existing section
248
250
-**`prepend`** — Add content before the existing section
251
+
-**`preserve`** — No-op that opts an individually-addressable section out of a group-level `remove`
249
252
250
253
Unknown section IDs are handled gracefully: content from `replace`/`append`/`prepend` overrides is appended to additional instructions, and `remove` overrides are silently ignored.
0 commit comments