namespace Dpz.Core.Service.Network.Models.XunFei;
public class XunFeiRequestPayload
{
public XunFeiRequestMessage? Message { get; set; }
}
public class XunFeiRequestMessage
{
public List<XunFeiRequestText> Text { get; set; } = [];
}
public class XunFeiRequestText
{
private string? _role;
/// <summary>
/// 取值为[system,user,assistant]
/// system用于设置对话背景,user表示是用户的问题,assistant表示AI的回复
/// </summary>
public required string Role
{
get => _role!;
set
{
if (value != "system" && value != "user" && value != "assistant")
{
throw new BusinessException($"{nameof(XunFeiRequestText.Role)} not is system,user,assistant");
}
_role = value;
}
}
/// <summary>
/// 用户和AI的对话内容
/// 所有content的累计tokens需控制8192以内
/// </summary>
public required string Content { get; set; }
}