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

Python: updated Chat Message Content with Function Call and Result Content #5946

Merged
merged 8 commits into from Apr 25, 2024

Conversation

eavanvalkenburg
Copy link
Member

Motivation and Context

Introducing FunctionCallContent and FunctionResultContent
Changed ChatRole to AuthorRole
Adapting ChatMessageContent to have 1 or more other contents within (currently TextContent or one of the above)
Closes #5890

Description

Changed OpenAI classes, to remove OpenAIChatMessageContent and AzureChatMessageContent
Changed OpenAI classes to create and parse FunctionCallContent and other new things.

Contribution Checklist

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner April 22, 2024 08:22
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Apr 22, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Apr 22, 2024

Py3.8 Test Coverage

Python 3.8 Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/connectors/ai
   chat_completion_client_base.py12192%19
semantic_kernel/connectors/ai/google_palm
   gp_prompt_execution_settings.py29290%1–42
semantic_kernel/connectors/ai/ollama/services
   ollama_chat_completion.py70691%57, 93, 113, 131, 164, 183
semantic_kernel/connectors/ai/open_ai/contents
   azure_streaming_chat_message_content.py322522%36, 45–70
   open_ai_chat_message_content.py38976%40, 44–47, 49–50, 56, 60, 66
   open_ai_streaming_chat_message_content.py322522%36, 45–70
semantic_kernel/connectors/ai/open_ai/services
   azure_chat_completion.py491471%243, 249–251, 269–271, 286–293, 297
   open_ai_chat_completion_base.py1716264%112, 134–137, 139–142, 159–162, 172–175, 186–209, 218–220, 237–239, 262, 270, 276–282, 293–299, 335–341, 359, 378–380
semantic_kernel/contents
   chat_history.py130894%261–262, 292–294, 307–309
   chat_message_content.py43295%62, 71
   streaming_chat_message_content.py171041%35, 43–51
   streaming_text_content.py14843%31, 38–44
semantic_kernel/functions
   kernel_function_from_prompt.py164498%174, 200, 297, 367
semantic_kernel/planners/function_calling_stepwise_planner
   function_calling_stepwise_planner.py1023863%122–185, 219–224
semantic_kernel/prompt_template/utils
   handlebars_system_helpers.py92199%17
   jinja2_system_helpers.py47394%16, 42, 47
TOTAL557899882% 

Python 3.8 Unit Test Overview

Tests Skipped Failures Errors Time
1211 18 💤 0 ❌ 0 🔥 27.670s ⏱️

@eavanvalkenburg eavanvalkenburg changed the title Python: Function call content Python: updated Chat Message Content with Function Call and Result Content Apr 22, 2024
@eavanvalkenburg eavanvalkenburg force-pushed the function_call_content branch 2 times, most recently from ec65f91 to 8f3de14 Compare April 22, 2024 14:35
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Apr 22, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/connectors/ai/google_palm
   gp_prompt_execution_settings.py29293%43–44
semantic_kernel/connectors/ai/google_palm/services
   gp_chat_completion.py661676%10, 135–140, 151–152, 201, 204, 207–208, 216, 220–221, 229
   gp_text_completion.py38684%10, 57–58, 64–65, 94
semantic_kernel/connectors/ai/ollama/services
   ollama_chat_completion.py70691%57, 93, 113, 131, 164, 183
semantic_kernel/connectors/ai/open_ai/services
   azure_chat_completion.py763455%248, 254–255, 264–265, 270–287, 291–298, 310–321
   open_ai_chat_completion_base.py1817658%112, 133–144, 160–163, 173–176, 187–216, 225–233, 249–256, 277, 285, 291–297, 304–310, 350–356, 374, 392–394
semantic_kernel/contents
   function_call_content.py59493%27, 34, 80, 87
   function_result_content.py37489%46, 61, 86, 91
   streaming_text_content.py14471%31, 39, 41, 43
   text_content.py22291%40, 47
semantic_kernel/functions
   kernel_function_from_prompt.py163597%171, 197, 294, 310, 364
semantic_kernel/planners/function_calling_stepwise_planner
   function_calling_stepwise_planner.py1023863%122–185, 219–224
semantic_kernel/prompt_template/utils
   handlebars_system_helpers.py93397%16, 43–44
   jinja2_system_helpers.py48394%15, 45, 50
TOTAL5827103582% 

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1257 1 💤 0 ❌ 0 🔥 15.729s ⏱️

@eavanvalkenburg eavanvalkenburg force-pushed the function_call_content branch 3 times, most recently from 4c658ae to f6713f3 Compare April 24, 2024 14:50
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 25, 2024
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Apr 25, 2024
Merged via the queue into microsoft:main with commit 65e94b3 Apr 25, 2024
25 checks passed
@eavanvalkenburg eavanvalkenburg deleted the function_call_content branch April 25, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python: Function call content type
5 participants