-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor code. change project structure.
- Loading branch information
1 parent
fbd4da6
commit fc1b27d
Showing
24 changed files
with
241 additions
and
275 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
2 changes: 1 addition & 1 deletion
2
src/LLMService.Baidu.ErnieVilg/Extensions/ErnieVilgDependencyInjection.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
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
2 changes: 1 addition & 1 deletion
2
...rvice.Shared/Models/PaintApplyResponse.cs → ...du.ErnieVilg/Models/PaintApplyResponse.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
2 changes: 1 addition & 1 deletion
2
...vice.Shared/Models/PaintResultResponse.cs → ...u.ErnieVilg/Models/PaintResultResponse.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
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
5 changes: 3 additions & 2 deletions
5
...vice.Shared/Models/BaiduApiChatRequest.cs → ...xinworkshop/Models/BaiduApiChatRequest.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
54 changes: 54 additions & 0 deletions
54
src/LLMService.Baidu.Wenxinworkshop/Models/BaiduChatApiResponse.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,54 @@ | ||
using LLMService.Shared.Models; | ||
using System.Text.Json.Serialization; | ||
using static LLMService.Shared.Models.LLMApiDefaults; | ||
|
||
namespace LLMService.Baidu.Wenxinworkshop.Models | ||
{ | ||
/// <summary> | ||
/// baidu API response wrapper | ||
/// </summary> | ||
/// <seealso cref="BaiduWenxinChatResponse" /> | ||
public class BaiduChatApiResponse : IChatResponse<BaiduWenxinChatResponse> | ||
{ | ||
/// <summary> | ||
/// Gets or sets the conversation identifier. | ||
/// </summary> | ||
/// <value> | ||
/// The conversation identifier. | ||
/// </value> | ||
[JsonPropertyName("conversation_id")] | ||
public string ConversationId { get; set; } = ""; | ||
/// <summary> | ||
/// 大模型 | ||
/// <para>可选项:ERNIE-Bot-turbo(default)|ERNIE-Bot-4|ERNIE-Bot</para> | ||
/// </summary> | ||
/// <example>2</example> | ||
[JsonPropertyName("model")] | ||
public LLM_ModelType ModelSchema { get; set; } = LLM_ModelType.ERNIE_BOT_TURBO; | ||
/// <summary> | ||
/// Gets or sets the result. | ||
/// </summary> | ||
/// <value> | ||
/// The result. | ||
/// </value> | ||
[JsonPropertyName("llm_response_data")] | ||
public BaiduWenxinChatResponse LLMResponseData { get; set; } | ||
/// <summary> | ||
/// Gets a value indicating whether [need clear history]. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if [need clear history]; otherwise, <c>false</c>. | ||
/// </value> | ||
[JsonPropertyName("need_clear_history")] | ||
public bool NeedClearHistory => LLMResponseData?.NeedClearHistory ?? false; | ||
|
||
/// <summary> | ||
/// latest aigc message. | ||
/// </summary> | ||
/// <value> | ||
/// The aigc message. | ||
/// </value> | ||
[JsonPropertyName("aigc_message")] | ||
public string AIGCMessage => LLMResponseData?.Result; | ||
} | ||
} |
93 changes: 93 additions & 0 deletions
93
src/LLMService.Baidu.Wenxinworkshop/Models/BaiduWenxinChatResponse.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,93 @@ | ||
using LLMService.Shared.Models; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace LLMService.Baidu.Wenxinworkshop.Models | ||
{ | ||
/// <summary> | ||
/// baidu API response model | ||
/// </summary> | ||
public class BaiduWenxinChatResponse /*: IServerSentEventData*/ | ||
{ | ||
/// <summary> | ||
/// Gets or sets the identifier. | ||
/// </summary> | ||
/// <value> | ||
/// The identifier. | ||
/// </value> | ||
[JsonPropertyName("id")] | ||
public string Id { get; set; } | ||
/// <summary> | ||
/// Gets or sets the type of the object. | ||
/// </summary> | ||
/// <value> | ||
/// The type of the object. | ||
/// </value> | ||
[JsonPropertyName("object")] | ||
public string ObjectType { get; set; } | ||
/// <summary> | ||
/// Gets or sets the created. | ||
/// </summary> | ||
/// <value> | ||
/// The created. | ||
/// </value> | ||
[JsonPropertyName("created")] | ||
public long Created { get; set; } | ||
/// <summary> | ||
/// Gets or sets the sentence identifier. | ||
/// </summary> | ||
/// <value> | ||
/// The sentence identifier. | ||
/// </value> | ||
[JsonPropertyName("sentence_id")] | ||
public int SentenceId { get; set; } | ||
/// <summary> | ||
/// Gets or sets a value indicating whether this instance is end. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if this instance is end; otherwise, <c>false</c>. | ||
/// </value> | ||
[JsonPropertyName("is_end")] | ||
public bool IsEnd { get; set; } | ||
/// <summary> | ||
/// Gets or sets a value indicating whether this instance is truncated. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if this instance is truncated; otherwise, <c>false</c>. | ||
/// </value> | ||
[JsonPropertyName("is_truncated")] | ||
public bool IsTruncated { get; set; } | ||
/// <summary> | ||
/// Gets or sets the result. | ||
/// </summary> | ||
/// <value> | ||
/// The result. | ||
/// </value> | ||
[JsonPropertyName("result")] | ||
public string Result { get; set; } | ||
/// <summary> | ||
/// Gets or sets a value indicating whether [need clear history]. | ||
/// </summary> | ||
/// <value> | ||
/// <c>true</c> if [need clear history]; otherwise, <c>false</c>. | ||
/// </value> | ||
[JsonPropertyName("need_clear_history")] | ||
public bool NeedClearHistory { get; set; } | ||
/// <summary> | ||
/// Gets or sets the ban round. | ||
/// </summary> | ||
/// <value> | ||
/// The ban round. | ||
/// </value> | ||
[JsonPropertyName("ban_round")] | ||
public int BanRound { get; set; } | ||
/// <summary> | ||
/// Gets or sets the usage. | ||
/// </summary> | ||
/// <value> | ||
/// The usage. | ||
/// </value> | ||
[JsonPropertyName("usage")] | ||
public ChatApiTokenUsage Usage { get; set; } | ||
} | ||
|
||
} |
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
Oops, something went wrong.