-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: slight improvements in kernel and function result content, sample of local function calling with Nexus Raven #6982
Merged
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
Jun 27, 2024
Python 3.10 Test Coverage Report •
Python 3.10 Unit Test Overview
|
eavanvalkenburg
force-pushed
the
nexusraven
branch
2 times, most recently
from
June 27, 2024 12:49
509390b
to
7b5303f
Compare
moonbox3
approved these changes
Jun 27, 2024
TaoChenOSU
reviewed
Jun 27, 2024
eavanvalkenburg
force-pushed
the
nexusraven
branch
from
June 28, 2024 08:48
5d84282
to
d49c9ec
Compare
moonbox3
approved these changes
Jun 28, 2024
alliscode
approved these changes
Jun 28, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jun 28, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jun 28, 2024
eavanvalkenburg
force-pushed
the
nexusraven
branch
from
June 28, 2024 19:24
85abf9e
to
2f3b999
Compare
moonbox3
approved these changes
Jun 28, 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
This introduces a sample that uses function calling with a local model, Nexus Raven V2, in this case using the API, but the same model can be loaded using the Hugging Face Connection, the class here is highly adapted and specific to Nexus including parsing the returned function call value, into FunctionCallContent and then running that.
It then returns one or more ChatMessageContents with the function call content and function result content which can then be shared with a OpenAI call.
Error handling improvements:
python/semantic_kernel/contents/chat_history.py
: Improved error logging when parsing prompts as XML fails.python/semantic_kernel/contents/function_result_content.py
: Removed field validator forresult
and allow result to be any value, instead of casting everything to string. [1] [2] [3] [4]Minor changes:
python/semantic_kernel/core_plugins/math_plugin.py
: Removed some docstrings for clarity. [1] [2]python/semantic_kernel/functions/kernel_function_from_prompt.py
: Changed the order of condition checks for better readability.python/semantic_kernel/kernel.py
: Added functionality to update kernel arguments ininvoke_stream
method and madefunction_name
andplugin_name
optional ininvoke_prompt
method. [1] [2] [3] [4] [5]Closes #6804
Closes #6944
Description
Contribution Checklist