Skip to content

Commit

Permalink
Merge pull request #21 from Senparc/Developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
JeffreySu authored May 7, 2023
2 parents bd9a120 + 1d23c9b commit 43640a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ Senparc 全家桶的 AI 扩展包,目前主要集中于 LLM(大语言模型
},
//Senparc.AI 设置
"SenparcAiSetting": {
"IsDebug": true,
"AiPlatform": "AzureOpenAI",
"IsDebug": true,
"AiPlatform": "NeuCharOpenAI",
"NeuCharOpenAIKeys": {
"ApiKey": "YourNeuCharApiKey",
"NeuCharEndpoint": "https://www.neuchar.com/<DeveloperId>/"
},
"AzureOpenAIKeys": {
"ApiKey": "YourAzureApiKey",
"AzureEndpoint": "https://xxxx.openai.azure.com/",
"AzureOpenAIApiVersion": "2022-12-01"
"AzureOpenAIApiVersion": "2022-12-01"
},
"OpenAIKeys": {
"ApiKey": "YourOpenAIKey",
Expand All @@ -37,12 +41,15 @@ Senparc 全家桶的 AI 扩展包,目前主要集中于 LLM(大语言模型
```

其中:`AiPlatform` 目前可选值为 `OpenAI``AzureOpenAI`,分别对应 openai.com 官方接口(OpenAI),以及基于微软 Azure 的 Azure OpenAI 接口(AOAI),系统会根据配置自动实现切换,无需在逻辑代码中进行判断。
其中:`AiPlatform` 目前可选值为 `OpenAI``NeuCharOpenAI``AzureOpenAI`,分别对应 openai.com 官方接口(OpenAI),以及 https://www.neuchar.com 由 Senparc 提供的中转接口,及基于微软 Azure 的 Azure OpenAI 接口(AOAI),系统会根据配置自动实现切换,无需在逻辑代码中进行判断。

仅当 `AiPlatform` 设置为 `OpenAI` 时,才需要设置 `OpenAIKeys` 及以下参数。

仅当 `AiPlatform` 设置为 `NeuCharOpenAI` 时,才需要设置 `NeuCharOpenAIKeys` 及以下参数。

仅当 `AiPlatform` 设置为 `AzureOpenAI` 时,才需要设置 `AzureOpenAIKeys` 及以下参数。


> 提示:AzureOpenAI 调用限制请参考:https://learn.microsoft.com/en-us/azure/cognitive-services/openai/quotas-limits<br>
> OpenAI 调用限制请参考 OpenAI 后台:https://platform.openai.com/docs/guides/rate-limits
Expand Down
3 changes: 3 additions & 0 deletions Samples/Senparc.AI.Samples.Consoles/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
.UseSenparcAI(senparcAiSetting);


Console.WriteLine("启动完毕,当前接口:" + Senparc.AI.Config.SenparcAiSetting.AiPlatform);
Console.WriteLine("=======================");
Console.WriteLine();
Console.WriteLine("请输入序号,开始对应功能测试:");
Console.WriteLine("[1] GPT对话机器人");
Console.WriteLine("[2] 训练 Embedding 任务");
Expand Down

0 comments on commit 43640a2

Please sign in to comment.