mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-11-23 10:50:21 +00:00
Refactored ParseApiParameters to use params for improved parameter handling
This commit is contained in:
parent
f0ba5b3671
commit
4f82b42ff1
@ -28,7 +28,7 @@ public sealed class ProviderAnthropic() : BaseProvider("https://api.anthropic.co
|
|||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
// Parse the API parameters:
|
// Parse the API parameters:
|
||||||
var apiParameters = this.ParseApiParameters(this.AdditionalJsonApiParameters, ["system"]);
|
var apiParameters = this.ParseApiParameters(this.AdditionalJsonApiParameters, "system");
|
||||||
|
|
||||||
// Prepare the Anthropic HTTP chat request:
|
// Prepare the Anthropic HTTP chat request:
|
||||||
var chatRequest = JsonSerializer.Serialize(new ChatRequest
|
var chatRequest = JsonSerializer.Serialize(new ChatRequest
|
||||||
|
|||||||
@ -526,7 +526,7 @@ public abstract class BaseProvider : IProvider, ISecretId
|
|||||||
/// <param name="keysToRemove">Optional list of keys to remove from the final dictionary (case-insensitive). stream, model and messages are removed by default.</param>
|
/// <param name="keysToRemove">Optional list of keys to remove from the final dictionary (case-insensitive). stream, model and messages are removed by default.</param>
|
||||||
protected IDictionary<string, object> ParseApiParameters(
|
protected IDictionary<string, object> ParseApiParameters(
|
||||||
string additionalUserProvidedParameters,
|
string additionalUserProvidedParameters,
|
||||||
IEnumerable<string>? keysToRemove = null)
|
params IEnumerable<string> keysToRemove)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@ -87,7 +87,7 @@ public sealed class ProviderOpenAI() : BaseProvider("https://api.openai.com/v1/"
|
|||||||
|
|
||||||
|
|
||||||
// Parse the API parameters:
|
// Parse the API parameters:
|
||||||
var apiParameters = this.ParseApiParameters(this.AdditionalJsonApiParameters, ["input", "store", "tools"]);
|
var apiParameters = this.ParseApiParameters(this.AdditionalJsonApiParameters, "input", "store", "tools");
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create the request: either for the Responses API or the Chat Completion API
|
// Create the request: either for the Responses API or the Chat Completion API
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user