-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of private:sdcb/chats into dev
- Loading branch information
Showing
20 changed files
with
59 additions
and
133 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 |
---|---|---|
|
@@ -13,4 +13,6 @@ public enum DBModelProvider | |
Sparkdesk = 8, | ||
ZhiPuAI = 9, | ||
DeepSeek = 10, | ||
xAI = 11, | ||
GithubModels = 12, | ||
} |
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
18 changes: 0 additions & 18 deletions
18
src/BE/Services/ChatServices/Implementations/Azure/JsonAzureConfig.cs
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/BE/Services/ChatServices/Implementations/Azure/JsonAzureModelConfig.cs
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/BE/Services/ChatServices/Implementations/GLM/JsonGLMModelConfig.cs
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/BE/Services/ChatServices/Implementations/Hunyuan/JsonHunyuanModelConfig.cs
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/BE/Services/ChatServices/Implementations/Kimi/JsonKimiModelConfig.cs
This file was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
...Implementations/Azure/AzureChatService.cs → ...mplementations/OpenAI/AzureChatService.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
3 changes: 1 addition & 2 deletions
3
...entations/DeepSeek/DeepSeekChatService.cs → ...ementations/OpenAI/DeepSeekChatService.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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
using Chats.BE.DB; | ||
using Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
namespace Chats.BE.Services.ChatServices.Implementations.DeepSeek; | ||
namespace Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
public class DeepSeekChatService(Model model) : OpenAIChatService(model, new Uri("https://api.deepseek.com/v1")); |
3 changes: 1 addition & 2 deletions
3
...ces/Implementations/GLM/GLMChatService.cs → .../Implementations/OpenAI/GLMChatService.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
5 changes: 5 additions & 0 deletions
5
src/BE/Services/ChatServices/Implementations/OpenAI/GithubModelsChatService.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,5 @@ | ||
using Chats.BE.DB; | ||
|
||
namespace Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
public class GithubModelsChatService(Model model) : OpenAIChatService(model, new Uri("https://models.inference.ai.azure.com")); |
15 changes: 0 additions & 15 deletions
15
src/BE/Services/ChatServices/Implementations/OpenAI/JsonOpenAIModelConfig.cs
This file was deleted.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
...s/Implementations/Kimi/KimiChatService.cs → ...Implementations/OpenAI/KimiChatService.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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
using Chats.BE.DB; | ||
using Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
namespace Chats.BE.Services.ChatServices.Implementations.Kimi; | ||
namespace Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
public class KimiChatService(Model model) : OpenAIChatService(model, new Uri("https://api.moonshot.cn/v1")); |
3 changes: 1 addition & 2 deletions
3
...plementations/LingYi/LingYiChatService.cs → ...plementations/OpenAI/LingYiChatService.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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
using Chats.BE.DB; | ||
using Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
namespace Chats.BE.Services.ChatServices.Implementations.LingYi; | ||
namespace Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
public class LingYiChatService(Model model) : OpenAIChatService(model, new Uri("https://api.lingyiwanwu.com/v1")); |
18 changes: 18 additions & 0 deletions
18
src/BE/Services/ChatServices/Implementations/OpenAI/SparkDeskChatService.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,18 @@ | ||
using Chats.BE.DB; | ||
using OpenAI.Chat; | ||
|
||
namespace Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
public class SparkDeskChatService(Model model) : OpenAIChatService(model, new Uri("https://spark-api-open.xf-yun.com/v1")) | ||
{ | ||
protected override ChatMessage[] FEPreprocess(IReadOnlyList<ChatMessage> messages, ChatCompletionOptions options) | ||
{ | ||
ChatMessage[] toReturn = base.FEPreprocess(messages, options); | ||
// spark desk enable search is set via tool https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html#_3-%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E | ||
// however unfortunately the tool is not available in OpenAI SDK | ||
// otherwise, the code should be: | ||
// bool enableSearch = options.IsSearchEnabled(); | ||
// options.Tools.Add(MakeSparkDeskSearchTool(enableSearch)); | ||
return toReturn; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/BE/Services/ChatServices/Implementations/OpenAI/XAIChatService.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,5 @@ | ||
using Chats.BE.DB; | ||
|
||
namespace Chats.BE.Services.ChatServices.Implementations.OpenAI; | ||
|
||
public class XAIChatService(Model model) : OpenAIChatService(model, new Uri("https://api.x.ai/v1")); |
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