AzureCosmosDB / cosmosdb-nosql-copilot

Build a copilot application with Azure OpenAI Service, Azure Cosmos DB & Azure App Service.
MIT License
41 stars 26 forks source link

Major Rewrite #54

Closed markjbrown closed 2 days ago

markjbrown commented 3 days ago

Token Management Request Latency Move warning disable to csproj

Purpose

Top level:

ChatPane.razor:

ChatService.cs:

GetChatCompletionAsync():

GetChatSessionContextWindow() now manages conversation history using new env variable, MaxContextWindow which is just conversation depth (prompt + completion) instead of using tokens to limit conversation history used for vector search and cache search. This was not effective given the vast majority of tokens are in the RAG data and not in the text for prompts and completions.

Semantic Kernel.cs:

GetRagCompletionAsync().

TrimToTokenLimit():

Message.cs

ElaspsedTime:

Does this introduce a breaking change?

[X] Yes
[ ] No

Pull Request Type

[X] Bugfix
[X] Feature
[X] Code style update (formatting, local variables)
[X] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

What to Check

Verify that the following are valid

Other Information