mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-11 20:52:11 +00:00
Prevented OS credentials from reaching public hosts or cross-origin redirects. Preserved Responses API reasoning items across tool rounds. Fixed nullable tool-call handling and omitted unsupported null request properties. Propagated cancellation correctly. Removed tool argument values from logs and tool results from persisted traces. Added settings validation, clearable optional enums, managed-confidence validation, and safe fallback behavior. Added tool-definition schema and duplicate validation. Fixed documentation JSON, changelog regressions, typos, trailing whitespace, and unused Anthropic code.
25 lines
875 B
C#
25 lines
875 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace AIStudio.Provider.Anthropic;
|
|
|
|
/// <summary>
|
|
/// The Anthropic chat request model.
|
|
/// </summary>
|
|
/// <param name="Model">Which model to use for chat completion.</param>
|
|
/// <param name="Messages">The chat messages.</param>
|
|
/// <param name="MaxTokens">The maximum number of tokens to generate.</param>
|
|
/// <param name="Stream">Whether to stream the chat completion.</param>
|
|
/// <param name="System">The system prompt for the chat completion.</param>
|
|
public readonly record struct ChatRequest(
|
|
string Model,
|
|
IList<IMessageBase> Messages,
|
|
int MaxTokens,
|
|
bool Stream,
|
|
string System
|
|
)
|
|
{
|
|
// Attention: The "required" modifier is not supported for [JsonExtensionData].
|
|
[JsonExtensionData]
|
|
public IDictionary<string, object> AdditionalApiParameters { get; init; } = new Dictionary<string, object>();
|
|
}
|