Skip to content

Commit addea43

Browse files
authored
Update to SK 1.0 beta 8 (#638)
### Motivation and Context Keeping up with the latest and greatest ### Description Update NuGets ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [Contribution Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
1 parent 6403cc6 commit addea43

21 files changed

+76
-80
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ By default, Chat Copilot runs locally without authentication, using a guest user
280280

281281
2. **_Issue:_**: Challenges using text completion models, such as `text-davinci-003`
282282

283-
_Solution_: For OpenAI, see [model endpoint compatibility](https://platform.openai.com/docs/models/) for
283+
_Solution_: For OpenAI, see [model endpoint compatibility](https://platform.openai.com/docs/models/model-endpoint-compatibility) for
284284
the complete list of current models supporting chat completions. For Azure OpenAI, see [model summary table and region availability](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability).
285285

286286
3. **_Issue:_** Localhost SSL certificate errors / CORS errors

integration-tests/ChatCopilotIntegrationTests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
1616
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
1717
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
18-
<PackageReference Include="xunit" Version="2.6.1" />
19-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
18+
<PackageReference Include="xunit" Version="2.6.2" />
19+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
<PrivateAssets>all</PrivateAssets>
2222
</PackageReference>

memorypipeline/CopilotChatMemoryPipeline.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
18-
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.10.231116.1-preview" />
19-
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta7" />
18+
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.10.231117.1-preview" />
19+
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta8" />
2020
</ItemGroup>
2121

2222
</Project>

plugins/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Read more about plugin authentication here: [Plugin authentication](https://plat
2828
### Prerequisites
2929

3030
1. The name of your plugin. This should be identical to the `NameForHuman` in your plugin manifest.
31-
> Please refer to OpenAI for the [manifest requirements](https://platform.openai.com/docs/plugins/getting-started/).
31+
> Please refer to OpenAI for the [manifest requirements](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest).
3232
2. Url of your plugin.
3333
> This should be the root url to your API. Not the manifest url nor the OpenAPI spec url.
3434
3. (Optional) Key of the plugin if it requires one.

plugins/shared/PluginManifest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Plugins.PluginShared;
66

77
/// <summary>
88
/// This class represents the OpenAI plugin manifest:
9-
/// https://platform.openai.com/docs/plugins/getting-started
9+
/// https://platform.openai.com/docs/plugins/getting-started/plugin-manifest
1010
/// </summary>
1111
public class PluginManifest
1212
{

shared/CopilotChatShared.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.10.231116.1-preview" />
12+
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.10.231117.1-preview" />
1313
<PackageReference Include="Tesseract" Version="5.2.0" />
1414
</ItemGroup>
1515

webapi/Controllers/ChatArchiveController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private async Task<List<Citation>> GetMemoryRecordsAndAppendToEmbeddingsAsync(
174174
/// </summary>
175175
/// <param name="chatId">The chat id</param>
176176
/// <returns>The list of chat messages in descending order of the timestamp</returns>
177-
private async Task<List<ChatMessage>> GetAllChatMessagesAsync(string chatId)
177+
private async Task<List<CopilotChatMessage>> GetAllChatMessagesAsync(string chatId)
178178
{
179179
return (await this._chatMessageRepository.FindByChatIdAsync(chatId))
180180
.OrderByDescending(m => m.Timestamp).ToList();

webapi/Controllers/ChatHistoryController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public async Task<IActionResult> CreateChatSessionAsync(
9898
await this._sessionRepository.CreateAsync(newChat);
9999

100100
// Create initial bot message
101-
var chatMessage = ChatMessage.CreateBotResponseMessage(
101+
var chatMessage = CopilotChatMessage.CreateBotResponseMessage(
102102
newChat.Id,
103103
this._promptOptions.InitialBotMessage,
104104
string.Empty, // The initial bot message doesn't need a prompt.

webapi/Controllers/DocumentController.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,11 @@ private async Task<bool> TryStoreMemoryAsync(MemorySource memorySource)
440440
/// <param name="chatId">The target chat-id</param>
441441
/// <param name="documentMessageContent">The document message content</param>
442442
/// <returns>A ChatMessage object if successful, null otherwise</returns>
443-
private async Task<ChatMessage?> TryCreateDocumentUploadMessage(
443+
private async Task<CopilotChatMessage?> TryCreateDocumentUploadMessage(
444444
Guid chatId,
445445
DocumentMessageContent documentMessageContent)
446446
{
447-
var chatMessage = ChatMessage.CreateDocumentMessage(
447+
var chatMessage = CopilotChatMessage.CreateDocumentMessage(
448448
this._authInfo.UserId,
449449
this._authInfo.Name, // User name
450450
chatId.ToString(),

webapi/CopilotChatWebApi.csproj

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
2222
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.36.0" />
2323
<PackageReference Include="Microsoft.Identity.Web" Version="2.15.3" />
24-
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.10.231116.1-preview" />
25-
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta7" />
26-
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.0.0-beta7" />
27-
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AI.OpenAI" Version="1.0.0-beta7" />
28-
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch" Version="1.0.0-beta7" />
29-
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.Qdrant" Version="1.0.0-beta7" />
30-
<PackageReference Include="Microsoft.SemanticKernel.Functions.OpenAPI" Version="1.0.0-beta7" />
31-
<PackageReference Include="Microsoft.SemanticKernel.Planners.Core" Version="1.0.0-beta7" />
32-
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Core" Version="1.0.0-beta7" />
33-
<PackageReference Include="Microsoft.SemanticKernel.Plugins.MsGraph" Version="1.0.0-beta7" />
34-
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Web" Version="1.0.0-beta7" />
35-
<PackageReference Include="Microsoft.SemanticKernel.TemplateEngine.Basic" Version="1.0.0-beta7" />
24+
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.10.231117.1-preview" />
25+
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta8" />
26+
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="1.0.0-beta8" />
27+
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AI.OpenAI" Version="1.0.0-beta8" />
28+
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch" Version="1.0.0-beta8" />
29+
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.Qdrant" Version="1.0.0-beta8" />
30+
<PackageReference Include="Microsoft.SemanticKernel.Functions.OpenAPI" Version="1.0.0-beta8" />
31+
<PackageReference Include="Microsoft.SemanticKernel.Planners.Core" Version="1.0.0-beta8" />
32+
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Core" Version="1.0.0-beta8" />
33+
<PackageReference Include="Microsoft.SemanticKernel.Plugins.MsGraph" Version="1.0.0-beta8" />
34+
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Web" Version="1.0.0-beta8" />
35+
<PackageReference Include="Microsoft.SemanticKernel.TemplateEngine.Basic" Version="1.0.0-beta8" />
3636
<PackageReference Include="SharpToken" Version="1.2.12" />
3737
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
3838
</ItemGroup>
@@ -42,7 +42,7 @@
4242
</ItemGroup>
4343

4444
<ItemGroup>
45-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview1.23165.1">
45+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
4646
<PrivateAssets>all</PrivateAssets>
4747
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4848
</PackageReference>

webapi/Extensions/ISemanticMemoryClientExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static async Task StoreDocumentAsync(
117117
new DocumentUploadRequest
118118
{
119119
DocumentId = documentId,
120-
Files = new List<DocumentUploadRequest.UploadedFile> { new DocumentUploadRequest.UploadedFile(fileName, fileContent) },
120+
Files = new List<DocumentUploadRequest.UploadedFile> { new(fileName, fileContent) },
121121
Index = indexName,
122122
Steps = pipelineSteps,
123123
};

webapi/Extensions/ServiceExtensions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ internal static IServiceCollection AddCorsPolicy(this IServiceCollection service
182182
public static IServiceCollection AddPersistentChatStore(this IServiceCollection services)
183183
{
184184
IStorageContext<ChatSession> chatSessionStorageContext;
185-
IStorageContext<ChatMessage> chatMessageStorageContext;
185+
IStorageContext<CopilotChatMessage> chatMessageStorageContext;
186186
IStorageContext<MemorySource> chatMemorySourceStorageContext;
187187
IStorageContext<ChatParticipant> chatParticipantStorageContext;
188188

@@ -193,7 +193,7 @@ public static IServiceCollection AddPersistentChatStore(this IServiceCollection
193193
case ChatStoreOptions.ChatStoreType.Volatile:
194194
{
195195
chatSessionStorageContext = new VolatileContext<ChatSession>();
196-
chatMessageStorageContext = new VolatileContext<ChatMessage>();
196+
chatMessageStorageContext = new VolatileContext<CopilotChatMessage>();
197197
chatMemorySourceStorageContext = new VolatileContext<MemorySource>();
198198
chatParticipantStorageContext = new VolatileContext<ChatParticipant>();
199199
break;
@@ -210,7 +210,7 @@ public static IServiceCollection AddPersistentChatStore(this IServiceCollection
210210
string directory = Path.GetDirectoryName(fullPath) ?? string.Empty;
211211
chatSessionStorageContext = new FileSystemContext<ChatSession>(
212212
new FileInfo(Path.Combine(directory, $"{Path.GetFileNameWithoutExtension(fullPath)}_sessions{Path.GetExtension(fullPath)}")));
213-
chatMessageStorageContext = new FileSystemContext<ChatMessage>(
213+
chatMessageStorageContext = new FileSystemContext<CopilotChatMessage>(
214214
new FileInfo(Path.Combine(directory, $"{Path.GetFileNameWithoutExtension(fullPath)}_messages{Path.GetExtension(fullPath)}")));
215215
chatMemorySourceStorageContext = new FileSystemContext<MemorySource>(
216216
new FileInfo(Path.Combine(directory, $"{Path.GetFileNameWithoutExtension(fullPath)}_memorysources{Path.GetExtension(fullPath)}")));
@@ -228,7 +228,7 @@ public static IServiceCollection AddPersistentChatStore(this IServiceCollection
228228
#pragma warning disable CA2000 // Dispose objects before losing scope - objects are singletons for the duration of the process and disposed when the process exits.
229229
chatSessionStorageContext = new CosmosDbContext<ChatSession>(
230230
chatStoreConfig.Cosmos.ConnectionString, chatStoreConfig.Cosmos.Database, chatStoreConfig.Cosmos.ChatSessionsContainer);
231-
chatMessageStorageContext = new CosmosDbContext<ChatMessage>(
231+
chatMessageStorageContext = new CosmosDbContext<CopilotChatMessage>(
232232
chatStoreConfig.Cosmos.ConnectionString, chatStoreConfig.Cosmos.Database, chatStoreConfig.Cosmos.ChatMessagesContainer);
233233
chatMemorySourceStorageContext = new CosmosDbContext<MemorySource>(
234234
chatStoreConfig.Cosmos.ConnectionString, chatStoreConfig.Cosmos.Database, chatStoreConfig.Cosmos.ChatMemorySourcesContainer);

webapi/Models/Response/ChatArchive.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class ChatArchive
3535
/// <summary>
3636
/// The chat history. It contains all the messages in the conversation with the bot.
3737
/// </summary>
38-
public List<ChatMessage> ChatHistory { get; set; } = new List<ChatMessage>();
38+
public List<CopilotChatMessage> ChatHistory { get; set; } = new List<CopilotChatMessage>();
3939

4040
/// <summary>
4141
/// Chat archive's embeddings.

webapi/Models/Response/CreateChatResponse.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public class CreateChatResponse
2222
/// Initial bot message.
2323
/// </summary>
2424
[JsonPropertyName("initialBotMessage")]
25-
public ChatMessage InitialBotMessage { get; set; }
25+
public CopilotChatMessage InitialBotMessage { get; set; }
2626

27-
public CreateChatResponse(ChatSession chatSession, ChatMessage initialBotMessage)
27+
public CreateChatResponse(ChatSession chatSession, CopilotChatMessage initialBotMessage)
2828
{
2929
this.ChatSession = chatSession;
3030
this.InitialBotMessage = initialBotMessage;

webapi/Models/Storage/ChatMessage.cs webapi/Models/Storage/CopilotChatMessage.cs

+9-14
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace CopilotChat.WebApi.Models.Storage;
1414
/// <summary>
1515
/// Information about a single chat message.
1616
/// </summary>
17-
public class ChatMessage : IStorageEntity
17+
public class CopilotChatMessage : IStorageEntity
1818
{
1919
private static readonly JsonSerializerOptions SerializerSettings = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
2020

@@ -31,12 +31,7 @@ public enum AuthorRoles
3131
/// <summary>
3232
/// The bot.
3333
/// </summary>
34-
Bot,
35-
36-
/// <summary>
37-
/// The participant who is not the current user nor the bot of the chat.
38-
/// </summary>
39-
Participant
34+
Bot
4035
}
4136

4237
/// <summary>
@@ -133,7 +128,7 @@ public enum ChatMessageType
133128
/// <param name="authorRole">Role of the author</param>
134129
/// <param name="type">Type of the message</param>
135130
/// <param name="tokenUsage">Total token usages used to generate bot response</param>
136-
public ChatMessage(
131+
public CopilotChatMessage(
137132
string userId,
138133
string userName,
139134
string chatId,
@@ -164,9 +159,9 @@ public ChatMessage(
164159
/// <param name="content">The message</param>
165160
/// <param name="prompt">The prompt used to generate the message</param>
166161
/// <param name="tokenUsage">Total token usage of response completion</param>
167-
public static ChatMessage CreateBotResponseMessage(string chatId, string content, string prompt, IEnumerable<CitationSource>? citations, IDictionary<string, int>? tokenUsage = null)
162+
public static CopilotChatMessage CreateBotResponseMessage(string chatId, string content, string prompt, IEnumerable<CitationSource>? citations, IDictionary<string, int>? tokenUsage = null)
168163
{
169-
return new ChatMessage("Bot", "Bot", chatId, content, prompt, citations, AuthorRoles.Bot, IsPlan(content) ? ChatMessageType.Plan : ChatMessageType.Message, tokenUsage);
164+
return new CopilotChatMessage("Bot", "Bot", chatId, content, prompt, citations, AuthorRoles.Bot, IsPlan(content) ? ChatMessageType.Plan : ChatMessageType.Message, tokenUsage);
170165
}
171166

172167
/// <summary>
@@ -176,9 +171,9 @@ public static ChatMessage CreateBotResponseMessage(string chatId, string content
176171
/// <param name="userName">The user name that uploaded the document</param>
177172
/// <param name="chatId">The chat ID that this message belongs to</param>
178173
/// <param name="documentMessageContent">The document message content</param>
179-
public static ChatMessage CreateDocumentMessage(string userId, string userName, string chatId, DocumentMessageContent documentMessageContent)
174+
public static CopilotChatMessage CreateDocumentMessage(string userId, string userName, string chatId, DocumentMessageContent documentMessageContent)
180175
{
181-
return new ChatMessage(userId, userName, chatId, documentMessageContent.ToString(), string.Empty, null, AuthorRoles.User, ChatMessageType.Document);
176+
return new CopilotChatMessage(userId, userName, chatId, documentMessageContent.ToString(), string.Empty, null, AuthorRoles.User, ChatMessageType.Document);
182177
}
183178

184179
/// <summary>
@@ -243,9 +238,9 @@ public override string ToString()
243238
/// </summary>
244239
/// <param name="json">A json string</param>
245240
/// <returns>A ChatMessage object</returns>
246-
public static ChatMessage? FromString(string json)
241+
public static CopilotChatMessage? FromString(string json)
247242
{
248-
return JsonSerializer.Deserialize<ChatMessage>(json, SerializerSettings);
243+
return JsonSerializer.Deserialize<CopilotChatMessage>(json, SerializerSettings);
249244
}
250245

251246
/// <summary>

0 commit comments

Comments
 (0)