-
Notifications
You must be signed in to change notification settings - Fork 3k
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: Implement AI request settings #4097
Merged
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
ba3792c
to
18a9528
Compare
moonbox3
reviewed
Dec 9, 2023
moonbox3
reviewed
Dec 9, 2023
moonbox3
reviewed
Dec 9, 2023
python/semantic_kernel/connectors/ai/google_palm/services/gp_text_completion.py
Show resolved
Hide resolved
What an awesome PR. Thank you for doing this. I love the direction we're heading and how much you're simplifying config related items. |
Have we gone through all Kernel examples and updated them with these new settings? Does the example |
e29e8c4
to
6cf6f1d
Compare
moonbox3
reviewed
Dec 11, 2023
python/semantic_kernel/connectors/ai/open_ai/services/open_ai_text_completion_base.py
Outdated
Show resolved
Hide resolved
e96557d
to
dc24883
Compare
6e969ce
to
addcc5a
Compare
4 tasks
e54242f
to
8ae7a07
Compare
692c4ab
to
b8effc1
Compare
6249156
to
b7b0eeb
Compare
moonbox3
approved these changes
Jan 3, 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 PR implements the new approach to AI Request settings as described here: https://github.com/microsoft/semantic-kernel/blob/main/docs/decisions/0008-support-generic-llm-request-settings.md and completes #3312
Description
Does this:
from_ai_request_settings
-> constructor to create a new request_settings object based on another, supports creating specific ai_request_settings from generic ones.update_from_ai_request_settings
-> updating the fields of a request setting from another ones.prepare_settings_dict
-> method that is used when actually creating the dict that get's passed to the handler of the AI service.get_request_settings_class
to ai_services to return the class used for the settings for that service.The goal is that when running, this settings object get's updated and a single operations (called
prepare_settings_dict
) is used to return a dict that can be passed to the api call directly, thereby reducing the need for custom logic everywhere, this will also negate the need for things likecomplete_chat_with_functions_async
and others. So also removed complete_chat_..._async methods from openai and azure openai.It has also changed the prompt_template_config with the generic type for the AIRequestSettings or subclasses, and some other changes.
Contribution Checklist