Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Allow chat history mutation from auto-function invocation filters #7952

Conversation

SergeyMenshykh
Copy link
Member

Motivation and Context

Today, {Azure} OpenAI connectors don't allow auto-function invocation filters to update/mutate chat history. The mutation can be useful to reduce the number of tokens sent to LLM by removing no longer needed function-calling messages from the chat history.

Partially closes: #7590. The MistralAI connector will be updated in a separate PR.

Description

This PR updates the ClientCore class to generate a list of messages to send to the LLM based on the latest chat history for every function-calling loop iteration, rather than separately updating the list of LLM messages and chat history.

Contribution Checklist

@SergeyMenshykh SergeyMenshykh added .NET Issue or Pull requests regarding .NET code ai connector Anything related to AI connectors filters Anything related to filters labels Aug 7, 2024
@SergeyMenshykh SergeyMenshykh self-assigned this Aug 7, 2024
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner August 7, 2024 08:59
@markwallace-microsoft markwallace-microsoft added the kernel Issues or pull requests impacting the core kernel label Aug 7, 2024
@RogerBarreto
Copy link
Member

RogerBarreto commented Aug 7, 2024

@SergeyMenshykh in the description says a change in the behavior but I'm just seeing UnitTests added as part of the PR, is that correct?

@SergeyMenshykh SergeyMenshykh merged commit e8ace92 into microsoft:feature-connectors-openai Aug 8, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai connector Anything related to AI connectors filters Anything related to filters kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants