Skip to content

Passing Reserve Keywords (kernel, chatHistory) to Functions with ChatCompletion Agents #11000

Answered by moonbox3
haithamshahin333 asked this question in Q&A

You must be logged in to vote

Hi @haithamshahin333,

Thanks for raising this question. Here’s a breakdown of how the ChatCompletionAgent currently handles reserved keyword parameters like chat_history and where we might improve clarity.

How It Works Today

With the chat completion agent, you can pass chat_history (or in my test case below, renamed as history) as part of the kernel arguments. This argument is used to generate the prompt for the model. In our implementation, we explicitly remove this argument from the kernel arguments before passing them to the function. (I acknowledge that this behavior could be cleaner.)

Example Test Kernel Function

For testing, I defined a kernel function that retrieves the chat histor…

Replies: 1 comment 3 replies

You must be logged in to vote
3 replies
@haithamshahin333

@moonbox3

@haithamshahin333

Answer selected by haithamshahin333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
python Pull requests for the Python Semantic Kernel agents
2 participants