Sent strict tool schemas only to providers that enforce them

This commit is contained in:
Thorsten Sommer committed 2026-09-24 11:34:59 +02:00
1 parent 40ac215359
commit 429be39702
6 files changed
+239 -13

No files matched your search

@@ -8,6 +8,14 @@ public sealed class ToolFunctionDefinition
public string DescriptionForLLM { get; init; } = string.Empty;
/// <summary>
/// Whether this tool may be offered in strict mode.
/// </summary>
/// <remarks>
/// The host has a say as well: a tool goes strict only where the host binds the model's calls
/// to the schema, see ProviderToolAdapters. Setting this to false keeps a tool out of strict
/// mode everywhere, for a schema which strict mode cannot express.
/// </remarks>
public bool Strict { get; init; } = true;
public JsonElement Parameters { get; init; }