-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from DHclly/main
优化代码结构和处理部分bug
- Loading branch information
Showing
131 changed files
with
3,010 additions
and
2,222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Thor.Abstractions.Audios; | ||
|
||
public interface IThorAudioService | ||
{ | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
src/Thor.Abstractions/Chats/Consts/ThorChatMessageRoleConst.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Thor.Abstractions.Chats.Consts | ||
{ | ||
/// <summary> | ||
/// 对话消息角色定义 | ||
/// </summary> | ||
public class ThorChatMessageRoleConst | ||
{ | ||
/// <summary> | ||
/// 系统角色 | ||
/// <para> | ||
/// 用于为聊天助手分配特定的行为或上下文,以影响对话的模型行为。 | ||
/// 例如,可以将系统角色设定为“您是足球专家”, | ||
/// 那么 ChatGPT 在对话中会表现出特定的个性或专业知识。 | ||
/// </para> | ||
/// </summary> | ||
public static string System => "system"; | ||
|
||
/// <summary> | ||
/// 用户角色 | ||
/// <para> | ||
/// 代表实际的最终用户,向 ChatGPT 发送提示或消息, | ||
/// 用于指示消息/提示来自最终用户或人类。 | ||
/// </para> | ||
/// </summary> | ||
public static string User => "user"; | ||
|
||
/// <summary> | ||
/// 助手角色 | ||
/// <para> | ||
/// 表示对最终用户提示的响应实体,用于保持对话的连贯性。 | ||
/// 它是由模型自动生成并回复的,用于设置模型的先前响应,以继续对话流程。 | ||
/// </para> | ||
/// </summary> | ||
public static string Assistant => "assistant"; | ||
|
||
/// <summary> | ||
/// 工具角色 | ||
/// <para> | ||
/// 表示对最终用户提示的响应实体,用于保持对话的连贯性。 | ||
/// 它是由模型自动生成并回复的,用于设置模型的先前响应,以继续对话流程。 | ||
/// </para> | ||
/// </summary> | ||
public static string Tool => "tool"; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Thor.Abstractions/Chats/Consts/ThorMessageContentTypeConst.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Thor.Abstractions.Chats.Consts | ||
{ | ||
/// <summary> | ||
/// 支持图片识别的消息体内容类型 | ||
/// </summary> | ||
internal class ThorMessageContentTypeConst | ||
{ | ||
/// <summary> | ||
/// 文本内容 | ||
/// </summary> | ||
public static string Text => "text"; | ||
|
||
/// <summary> | ||
/// 图片 Url 类型 | ||
/// </summary> | ||
public static string ImageUrl => "image_url"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/Thor.Abstractions/Chats/Dtos/ThorChatCompletionsResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Text.Json.Serialization; | ||
using Thor.Abstractions.ObjectModels.ObjectModels.ResponseModels; | ||
using Thor.Abstractions.ObjectModels.ObjectModels.SharedModels; | ||
|
||
namespace Thor.Abstractions.Chats.Dtos; | ||
|
||
/// <summary> | ||
/// 对话补全服务返回结果 | ||
/// </summary> | ||
public record ThorChatCompletionsResponse | ||
: BaseResponse | ||
{ | ||
[JsonPropertyName("model")] | ||
public string? Model { get; set; } | ||
|
||
[JsonPropertyName("choices")] | ||
public List<ChatChoiceResponse>? Choices { get; set; } | ||
|
||
[JsonPropertyName("usage")] | ||
public UsageResponse? Usage { get; set; } | ||
|
||
[JsonPropertyName("created")] | ||
public int CreatedAt { get; set; } | ||
|
||
[JsonPropertyName("id")] | ||
public string Id { get; set; } | ||
|
||
[JsonPropertyName("system_fingerprint")] | ||
public string SystemFingerPrint { get; set; } | ||
} |
Oops, something went wrong.