You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.5 KiB
C#
96 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OllamaStudy.UseHttpClient.OllamaResponse
|
|
{
|
|
public class ChatResponse
|
|
{
|
|
[JsonPropertyName("model")]
|
|
public required string Model { get; set; }
|
|
|
|
[JsonPropertyName("created_at")]
|
|
public DateTime CreatedAt { get; set; }
|
|
|
|
[JsonPropertyName("done")]
|
|
public bool Done { get; set; }
|
|
|
|
[JsonPropertyName("message")]
|
|
public ChatResponseMessage? Message { get; set; }
|
|
|
|
/// <summary>
|
|
/// 完成原因
|
|
/// </summary>
|
|
[JsonPropertyName("done_reason")]
|
|
public string? done_reason { get; set; }
|
|
|
|
/// <summary>
|
|
/// 总耗时
|
|
/// </summary>
|
|
[JsonPropertyName("total_duration")]
|
|
public long? total_duration { get; set; }
|
|
|
|
/// <summary>
|
|
/// 加载耗时
|
|
/// </summary>
|
|
[JsonPropertyName("load_duration")]
|
|
public long? load_duration { get; set; }
|
|
|
|
/// <summary>
|
|
/// 提示词验证数量
|
|
/// </summary>
|
|
[JsonPropertyName("prompt_eval_count")]
|
|
public long? prompt_eval_count { get; set; }
|
|
|
|
/// <summary>
|
|
/// 提示词验证耗时
|
|
/// </summary>
|
|
[JsonPropertyName("prompt_eval_duration")]
|
|
public long? prompt_eval_duration { get; set; }
|
|
|
|
/// <summary>
|
|
/// 验证次数
|
|
/// </summary>
|
|
[JsonPropertyName("eval_count")]
|
|
public long? eval_count { get; set; }
|
|
|
|
/// <summary>
|
|
/// 验证耗时
|
|
/// </summary>
|
|
[JsonPropertyName("eval_duration")]
|
|
public long? eval_duration { get; set; }
|
|
}
|
|
|
|
public class ChatResponseMessage
|
|
{
|
|
[JsonPropertyName("role")]
|
|
public required string Role { get; set; }
|
|
|
|
[JsonPropertyName("content")]
|
|
public string? Content { get; set; }
|
|
|
|
[JsonPropertyName("images")]
|
|
public string? Images { get; set; }
|
|
|
|
[JsonPropertyName("tool_calls")]
|
|
public List<ToolCalls>? ToolCalls { get; set; }
|
|
}
|
|
|
|
public class ToolCalls
|
|
{
|
|
[JsonPropertyName("function")]
|
|
public Function? Function { get; set; }
|
|
}
|
|
|
|
public class Function
|
|
{
|
|
[JsonPropertyName("name")]
|
|
public required string Name { get; set; }
|
|
|
|
[JsonPropertyName("arguments")]
|
|
public Dictionary<string, string>? Arguments { get; set; }
|
|
}
|
|
}
|