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: improved content inits, added ndarray support for binary content and small fixes to defaults #10469

Merged

Conversation

eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Feb 10, 2025

Motivation and Context

This PR adds support for ndarray's as the content carrier for all binary content types (binary, image, audio) as that is more optimized for larger content.

It also does some fixes to the initialization of those content types and the underlying data uri type.

Also some fixes for unspecified default param in pydantic Field, language servers do not recognize Field("default value") as having a default, so changed those occurances to Field(default="default value")

Description

Contribution Checklist

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner February 10, 2025 15:37
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel memory labels Feb 10, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 10, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/connectors/ai/open_ai/prompt_execution_settings
   open_ai_text_to_image_execution_settings.py36197%60
semantic_kernel/connectors/search/bing
   bing_search_response.py17170%3–29
semantic_kernel/connectors/search/google
   google_search_result.py21210%3–29
semantic_kernel/contents
   audio_content.py21195%88
   binary_content.py1111190%99, 120, 127, 140, 145–146, 187–191
semantic_kernel/contents/utils
   data_uri.py109595%91, 98, 101, 120, 176
semantic_kernel/processes/dapr_runtime
   dapr_process_info.py32488%26, 31, 41, 48
   dapr_step_info.py31294%30, 39
semantic_kernel/services
   ai_service_client_base.py22195%64
TOTAL18599219888% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3181 5 💤 0 ❌ 0 🔥 1m 44s ⏱️

Copy link
Contributor

@moonbox3 moonbox3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to update the PR title to be more descriptive, instead of simply "bunch of updates for content..." :)

@eavanvalkenburg eavanvalkenburg changed the title Python: bunch of updates for content and added ndarray support Python: improved content inits, added ndarray support for binary content and small fixes to defaults Feb 12, 2025
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 12, 2025
Merged via the queue into microsoft:main with commit cbfd7e9 Feb 12, 2025
28 checks passed
@eavanvalkenburg eavanvalkenburg deleted the fix_binary_content_init branch February 12, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants