2025-12-11 17:16:21 +08:00
|
|
|
|
using System.Text.Json;
|
|
|
|
|
|
using Yi.Framework.AiHub.Domain.Shared.Dtos;
|
2025-12-11 01:17:31 +08:00
|
|
|
|
using Yi.Framework.AiHub.Domain.Shared.Dtos.OpenAi.Responses;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.AiHub.Domain.AiGateWay;
|
|
|
|
|
|
|
|
|
|
|
|
public interface IOpenAiResponseService
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 响应-流式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="aiModelDescribe"></param>
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2025-12-11 17:16:21 +08:00
|
|
|
|
public IAsyncEnumerable<(string, JsonElement?)> ResponsesStreamAsync(AiModelDescribe aiModelDescribe,
|
2025-12-11 01:17:31 +08:00
|
|
|
|
OpenAiResponsesInput input,
|
|
|
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 响应-非流式
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="aiModelDescribe"></param>
|
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public Task<OpenAiResponsesOutput> ResponsesAsync(AiModelDescribe aiModelDescribe,
|
|
|
|
|
|
OpenAiResponsesInput input,
|
|
|
|
|
|
CancellationToken cancellationToken);
|
|
|
|
|
|
}
|