-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Python: Include a function_invoke_attempt index with Streaming CMC #10009
Merged
eavanvalkenburg
merged 8 commits into
microsoft:main
from
moonbox3:streaming-request-index
Dec 19, 2024
Merged
Python: Include a function_invoke_attempt index with Streaming CMC #10009
eavanvalkenburg
merged 8 commits into
microsoft:main
from
moonbox3:streaming-request-index
Dec 19, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
markwallace-microsoft
added
the
python
Pull requests for the Python Semantic Kernel
label
Dec 18, 2024
Python Test Coverage Report •
Python Unit Test Overview
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some big questions for you :D
python/samples/concepts/auto_function_calling/chat_completion_with_function_calling.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py
Show resolved
Hide resolved
TaoChenOSU
reviewed
Dec 18, 2024
python/samples/concepts/auto_function_calling/chat_completion_with_function_calling.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/ai/anthropic/services/anthropic_chat_completion.py
Show resolved
Hide resolved
TaoChenOSU
reviewed
Dec 19, 2024
python/samples/concepts/auto_function_calling/chat_completion_with_function_calling.py
Outdated
Show resolved
Hide resolved
eavanvalkenburg
approved these changes
Dec 19, 2024
TaoChenOSU
reviewed
Dec 19, 2024
python/samples/concepts/auto_function_calling/chat_completion_with_manual_function_calling.py
Outdated
Show resolved
Hide resolved
TaoChenOSU
approved these changes
Dec 19, 2024
Create an item to track this issue for .Net: #10017 |
eavanvalkenburg
approved these changes
Dec 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of nits on the samples, feel free to ignore
python/samples/concepts/auto_function_calling/chat_completion_with_auto_function_calling.py
Outdated
Show resolved
Hide resolved
...mples/concepts/auto_function_calling/chat_completion_with_auto_function_calling_streaming.py
Outdated
Show resolved
Hide resolved
...mples/concepts/auto_function_calling/chat_completion_with_auto_function_calling_streaming.py
Outdated
Show resolved
Hide resolved
eavanvalkenburg
approved these changes
Dec 19, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Dec 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
During auto function calling, we're yielding all messages back without any indication as to which invocation index they are related to. This information could be helpful to the caller to understand in which order message chunks were received during the auto function invocation loop.
Depending upon the behavior of auto function calling, the
request_index
iterates up to themaximum_auto_invoke_attempts
. The caller doesn't know today which function auto invoke attempt they're currently on -- so simply handing all yielded messages can be confusing. In a new PR, we will handle adding therequest_index
(perhaps with a different name) to make it easier to know which streaming message chunks to concatenate, which should help reduce the confusion down the line.Description
This PR adds:
function_invoke_attempt
attribute to theStreamingChatMessageContent
class. This can help callers/users track which streaming chat message chunks belong to which auto function invocation attempt._inner_get_streaming_chat_message_contents
to allow thefunction_invoke_attempt
int to be passed through to theStreamingChatMessageContent
creation in each AI Service. This additive keyword argument should not break existing.Contribution Checklist