mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Update to M.E.AI 10.3.0 (#3822)
Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
a427af91a9
commit
b52136952f
@@ -283,8 +283,13 @@ public static partial class AzureAIProjectChatClientExtensions
|
||||
TextOptions = new() { TextFormat = ToOpenAIResponseTextFormat(options.ChatOptions?.ResponseFormat, options.ChatOptions) }
|
||||
};
|
||||
|
||||
// Attempt to capture breaking glass options from the raw representation factory that match the agent definition.
|
||||
if (options.ChatOptions?.RawRepresentationFactory?.Invoke(new NoOpChatClient()) is CreateResponseOptions respCreationOptions)
|
||||
// Map reasoning options from the abstraction-level ChatOptions.Reasoning,
|
||||
// falling back to extracting from the raw representation factory for breaking glass scenarios.
|
||||
if (options.ChatOptions?.Reasoning is { } reasoning)
|
||||
{
|
||||
agentDefinition.ReasoningOptions = ToResponseReasoningOptions(reasoning);
|
||||
}
|
||||
else if (options.ChatOptions?.RawRepresentationFactory?.Invoke(new NoOpChatClient()) is CreateResponseOptions respCreationOptions)
|
||||
{
|
||||
agentDefinition.ReasoningOptions = respCreationOptions.ReasoningOptions;
|
||||
}
|
||||
@@ -770,6 +775,36 @@ public static partial class AzureAIProjectChatClientExtensions
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
private static ResponseReasoningOptions? ToResponseReasoningOptions(ReasoningOptions reasoning)
|
||||
{
|
||||
ResponseReasoningEffortLevel? effortLevel = reasoning.Effort switch
|
||||
{
|
||||
ReasoningEffort.Low => ResponseReasoningEffortLevel.Low,
|
||||
ReasoningEffort.Medium => ResponseReasoningEffortLevel.Medium,
|
||||
ReasoningEffort.High => ResponseReasoningEffortLevel.High,
|
||||
ReasoningEffort.ExtraHigh => ResponseReasoningEffortLevel.High,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
ResponseReasoningSummaryVerbosity? summary = reasoning.Output switch
|
||||
{
|
||||
ReasoningOutput.Summary => ResponseReasoningSummaryVerbosity.Concise,
|
||||
ReasoningOutput.Full => ResponseReasoningSummaryVerbosity.Detailed,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
if (effortLevel is null && summary is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ResponseReasoningOptions
|
||||
{
|
||||
ReasoningEffortLevel = effortLevel,
|
||||
ReasoningSummaryVerbosity = summary,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[JsonSerializable(typeof(JsonElement))]
|
||||
|
||||
Reference in New Issue
Block a user