Skip to content

Commit 57870ae

Browse files
committed
Bump Azure.AI.OpenAI to 1.0.0-beta.9
1 parent 8378af8 commit 57870ae

File tree

8 files changed

+27
-37
lines changed

8 files changed

+27
-37
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<LangVersion>10.0</LangVersion>
44
<OutputPath>..\..\..\packages</OutputPath>
5-
<BotSharpVersion>0.18.0</BotSharpVersion>
5+
<BotSharpVersion>0.19.0</BotSharpVersion>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
</PropertyGroup>
88
</Project>

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# The Open Source LLM Application Framework
2-
## Connect LLMs to your existing application
1+
# The Open Source AI Agent Application Framework
2+
## Connect LLMs to your existing application focused on your business
33

44
[![Discord](https://img.shields.io/discord/1106946823282761851?label=Discord)](https://discord.gg/qRVm82fKTS)
55
[![QQ群聊](https://img.shields.io/static/v1?label=QQ&message=群聊&color=brightgreen)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=sN9VVMwbWjs5L0ATpizKKxOcZdEPMrp8&authKey=RLDw41bLTrEyEgZZi%2FzT4pYk%2BwmEFgFcrhs8ZbkiVY7a4JFckzJefaYNW6Lk4yPX&noverify=0&group_code=985366726)
@@ -52,6 +52,7 @@ BotSharp uses component design, the kernel is kept to a minimum, and business fu
5252
- BotSharp.Plugin.MetaAI
5353
- BotSharp.Plugin.HuggingFace
5454
- BotSharp.Plugin.LLamaSharp
55+
- BotSharp.Plugin.SemanticKernel
5556

5657
#### Messaging / Channel
5758
- BotSharp.OpenAPI

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
# built documents.
6565
#
6666
# The short X.Y version.
67-
version = '0.18'
67+
version = '0.19'
6868
# The full version, including alpha/beta/rc tags.
69-
release = '0.18.0'
69+
release = '0.19.0'
7070

7171
# The language for content autogenerated by Sphinx. Refer to documentation
7272
# for a list of supported languages.

src/Plugins/BotSharp.Plugin.AzureOpenAI/BotSharp.Plugin.AzureOpenAI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.8" />
13+
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.9" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/ChatCompletionProvider.cs

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public RoleDialogModel GetChatCompletions(Agent agent, List<RoleDialogModel> con
4747

4848
var client = ProviderHelper.GetClient(_model, _settings);
4949
var (prompt, chatCompletionsOptions) = PrepareOptions(agent, conversations);
50-
51-
var response = client.GetChatCompletions(_model, chatCompletionsOptions);
50+
chatCompletionsOptions.DeploymentName = _model;
51+
var response = client.GetChatCompletions(chatCompletionsOptions);
5252
var choice = response.Value.Choices[0];
5353
var message = choice.Message;
5454

@@ -110,7 +110,8 @@ public async Task<bool> GetChatCompletionsAsync(Agent agent,
110110
var client = ProviderHelper.GetClient(_model, _settings);
111111
var (prompt, chatCompletionsOptions) = PrepareOptions(agent, conversations);
112112

113-
var response = await client.GetChatCompletionsAsync(_model, chatCompletionsOptions);
113+
chatCompletionsOptions.DeploymentName = _model;
114+
var response = await client.GetChatCompletionsAsync(chatCompletionsOptions);
114115
var choice = response.Value.Choices[0];
115116
var message = choice.Message;
116117

@@ -162,39 +163,27 @@ public async Task<bool> GetChatCompletionsStreamingAsync(Agent agent, List<RoleD
162163
{
163164
var client = ProviderHelper.GetClient(_model, _settings);
164165
var (prompt, chatCompletionsOptions) = PrepareOptions(agent, conversations);
165-
166-
var response = await client.GetChatCompletionsStreamingAsync(_model, chatCompletionsOptions);
167-
using StreamingChatCompletions streaming = response.Value;
166+
chatCompletionsOptions.DeploymentName = _model;
167+
var response = await client.GetChatCompletionsStreamingAsync(chatCompletionsOptions);
168168

169169
string output = "";
170-
await foreach (var choice in streaming.GetChoicesStreaming())
170+
await foreach (var choice in response)
171171
{
172172
if (choice.FinishReason == CompletionsFinishReason.FunctionCall)
173173
{
174-
var args = "";
175-
await foreach (var message in choice.GetMessageStreaming())
176-
{
177-
if (message.FunctionCall == null || message.FunctionCall.Arguments == null)
178-
continue;
179-
Console.Write(message.FunctionCall.Arguments);
180-
args += message.FunctionCall.Arguments;
174+
Console.Write(choice.FunctionArgumentsUpdate);
181175

182-
}
183-
await onMessageReceived(new RoleDialogModel(ChatRole.Assistant.ToString(), args));
176+
await onMessageReceived(new RoleDialogModel(ChatRole.Assistant.ToString(), choice.FunctionArgumentsUpdate));
184177
continue;
185178
}
186179

187-
await foreach (var message in choice.GetMessageStreaming())
188-
{
189-
if (message.Content == null)
190-
continue;
191-
Console.Write(message.Content);
192-
output += message.Content;
180+
if (choice.ContentUpdate == null)
181+
continue;
182+
Console.Write(choice.ContentUpdate);
193183

194-
_logger.LogInformation(message.Content);
184+
_logger.LogInformation(choice.ContentUpdate);
195185

196-
await onMessageReceived(new RoleDialogModel(message.Role.ToString(), message.Content));
197-
}
186+
await onMessageReceived(new RoleDialogModel(choice.Role.ToString(), choice.ContentUpdate));
198187

199188
output = "";
200189
}

src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/TextCompletionProvider.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ public async Task<string> GetCompletion(string text, string agentId, string mess
7777
var samplingFactor = float.Parse(state.GetState("sampling_factor", "0.5"));
7878
completionsOptions.Temperature = temperature;
7979
completionsOptions.NucleusSamplingFactor = samplingFactor;
80-
81-
var response = await client.GetCompletionsAsync(
82-
deploymentOrModelName: _model,
83-
completionsOptions);
80+
completionsOptions.DeploymentName = _model;
81+
var response = await client.GetCompletionsAsync(completionsOptions);
8482

8583
// OpenAI
8684
var completion = "";

src/WebStarter/WebStarter.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@
5959
<ProjectReference Include="..\Plugins\BotSharp.Plugin.Qdrant\BotSharp.Plugin.Qdrant.csproj" />
6060
<ProjectReference Include="..\Plugins\BotSharp.Plugin.RoutingSpeeder\BotSharp.Plugin.RoutingSpeeder.csproj" />
6161
<ProjectReference Include="..\Plugins\BotSharp.Plugin.WeChat\BotSharp.Plugin.WeChat.csproj" />
62+
<ProjectReference Include="..\Plugins\BotSharp.Plugin.SemanticKernel\BotSharp.Plugin.SemanticKernel.csproj" />
63+
<ProjectReference Include="..\Plugins\BotSharp.Plugin.Twilio\BotSharp.Plugin.Twilio.csproj" />
6264
</ItemGroup>
6365

6466
<ItemGroup>
6567
<ProjectReference Include="..\..\tests\BotSharp.Plugin.PizzaBot\BotSharp.Plugin.PizzaBot.csproj" />
66-
<ProjectReference Include="..\Plugins\BotSharp.Plugin.Twilio\BotSharp.Plugin.Twilio.csproj" />
6768
</ItemGroup>
6869

6970
</Project>

src/WebStarter/appsettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
// "BotSharp.Plugin.Twilio",
143143
"BotSharp.Plugin.HuggingFace",
144144
"BotSharp.Plugin.LLamaSharp",
145+
// "BotSharp.Plugin.SemanticKernel",
145146
"BotSharp.Plugin.KnowledgeBase",
146147
"BotSharp.Plugin.Qdrant",
147148
"BotSharp.Plugin.PaddleSharp",

0 commit comments

Comments
 (0)