feat: 支持codex
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Yi.Framework.AiHub.Domain.Shared.Dtos.OpenAi.Responses;
|
||||
|
||||
public class OpenAiResponsesInput
|
||||
{
|
||||
[JsonPropertyName("stream")] public bool? Stream { get; set; }
|
||||
|
||||
[JsonPropertyName("model")] public string Model { get; set; }
|
||||
[JsonPropertyName("input")] public dynamic Input { get; set; }
|
||||
|
||||
[JsonPropertyName("max_output_tokens")]
|
||||
public int? MaxOutputTokens { get; set; }
|
||||
|
||||
[JsonPropertyName("max_tool_calls")] public dynamic? MaxToolCalls { get; set; }
|
||||
[JsonPropertyName("instructions")] public string? Instructions { get; set; }
|
||||
[JsonPropertyName("metadata")] public dynamic? Metadata { get; set; }
|
||||
|
||||
[JsonPropertyName("parallel_tool_calls")]
|
||||
public bool? ParallelToolCalls { get; set; }
|
||||
|
||||
[JsonPropertyName("previous_response_id")]
|
||||
public string? PreviousResponseId { get; set; }
|
||||
|
||||
[JsonPropertyName("prompt")] public dynamic? Prompt { get; set; }
|
||||
[JsonPropertyName("prompt_cache_key")] public string? PromptCacheKey { get; set; }
|
||||
|
||||
[JsonPropertyName("prompt_cache_retention")]
|
||||
public string? PromptCacheRetention { get; set; }
|
||||
|
||||
[JsonPropertyName("reasoning")] public dynamic? Reasoning { get; set; }
|
||||
|
||||
[JsonPropertyName("safety_identifier")]
|
||||
public string? SafetyIdentifier { get; set; }
|
||||
|
||||
[JsonPropertyName("service_tier")] public string? ServiceTier { get; set; }
|
||||
[JsonPropertyName("store")] public bool? Store { get; set; }
|
||||
[JsonPropertyName("stream_options")] public dynamic? StreamOptions { get; set; }
|
||||
[JsonPropertyName("temperature")] public decimal? Temperature { get; set; }
|
||||
[JsonPropertyName("text")] public dynamic? Text { get; set; }
|
||||
[JsonPropertyName("tool_choice")] public dynamic? ToolChoice { get; set; }
|
||||
[JsonPropertyName("tools")] public dynamic? Tools { get; set; }
|
||||
[JsonPropertyName("top_logprobs")] public int? TopLogprobs { get; set; }
|
||||
[JsonPropertyName("top_p")] public decimal? TopP { get; set; }
|
||||
[JsonPropertyName("truncation")] public string? Truncation { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Yi.Framework.AiHub.Domain.Shared.Dtos.OpenAi.Responses;
|
||||
|
||||
public class OpenAiResponsesOutput
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
[JsonPropertyName("object")]
|
||||
public string? Object { get; set; }
|
||||
[JsonPropertyName("created_at")]
|
||||
public long CreatedAt { get; set; }
|
||||
[JsonPropertyName("status")]
|
||||
public string? Status { get; set; }
|
||||
[JsonPropertyName("error")]
|
||||
public dynamic? Error { get; set; }
|
||||
[JsonPropertyName("incomplete_details")]
|
||||
public dynamic? IncompleteDetails { get; set; }
|
||||
[JsonPropertyName("instructions")]
|
||||
public dynamic? Instructions { get; set; }
|
||||
[JsonPropertyName("max_output_tokens")]
|
||||
public dynamic? MaxOutputTokens { get; set; }
|
||||
[JsonPropertyName("model")]
|
||||
public string? Model { get; set; }
|
||||
// output 是复杂对象
|
||||
[JsonPropertyName("output")]
|
||||
public List<dynamic>? Output { get; set; }
|
||||
[JsonPropertyName("parallel_tool_calls")]
|
||||
public bool ParallelToolCalls { get; set; }
|
||||
[JsonPropertyName("previous_response_id")]
|
||||
public dynamic? PreviousResponseId { get; set; }
|
||||
[JsonPropertyName("reasoning")]
|
||||
public dynamic? Reasoning { get; set; }
|
||||
[JsonPropertyName("store")]
|
||||
public bool Store { get; set; }
|
||||
[JsonPropertyName("temperature")]
|
||||
public double Temperature { get; set; }
|
||||
[JsonPropertyName("text")]
|
||||
public dynamic? Text { get; set; }
|
||||
[JsonPropertyName("tool_choice")]
|
||||
public string? ToolChoice { get; set; }
|
||||
[JsonPropertyName("tools")]
|
||||
public List<dynamic>? Tools { get; set; }
|
||||
[JsonPropertyName("top_p")]
|
||||
public double TopP { get; set; }
|
||||
[JsonPropertyName("truncation")]
|
||||
public string? Truncation { get; set; }
|
||||
// usage 为唯一强类型
|
||||
[JsonPropertyName("usage")]
|
||||
public OpenAiResponsesUsageOutput? Usage { get; set; }
|
||||
[JsonPropertyName("user")]
|
||||
public dynamic? User { get; set; }
|
||||
[JsonPropertyName("metadata")]
|
||||
public dynamic? Metadata { get; set; }
|
||||
}
|
||||
|
||||
public class OpenAiResponsesUsageOutput
|
||||
{
|
||||
[JsonPropertyName("input_tokens")]
|
||||
public int InputTokens { get; set; }
|
||||
[JsonPropertyName("input_tokens_details")]
|
||||
public OpenAiResponsesInputTokensDetails? InputTokensDetails { get; set; }
|
||||
[JsonPropertyName("output_tokens")]
|
||||
public int OutputTokens { get; set; }
|
||||
[JsonPropertyName("output_tokens_details")]
|
||||
public OpenAiResponsesOutputTokensDetails? OutputTokensDetails { get; set; }
|
||||
[JsonPropertyName("total_tokens")]
|
||||
public int TotalTokens { get; set; }
|
||||
}
|
||||
public class OpenAiResponsesInputTokensDetails
|
||||
{
|
||||
[JsonPropertyName("cached_tokens")]
|
||||
public int CachedTokens { get; set; }
|
||||
}
|
||||
public class OpenAiResponsesOutputTokensDetails
|
||||
{
|
||||
[JsonPropertyName("reasoning_tokens")]
|
||||
public int ReasoningTokens { get; set; }
|
||||
}
|
||||
@@ -8,5 +8,8 @@ public enum ModelApiTypeEnum
|
||||
OpenAi,
|
||||
|
||||
[Description("Claude")]
|
||||
Claude
|
||||
Claude,
|
||||
|
||||
[Description("Response")]
|
||||
Response
|
||||
}
|
||||
Reference in New Issue
Block a user