Skip to content

Conversation

@eavanvalkenburg
Copy link
Member

Motivation and Context

Adds singular get_..._content methods to all services, initially implemented by calling the multi version and passing back the first result, it therefore does not check on the number of responses parameter, just provides the interface.

Also add generate_raw_embeddings to Embedding Base to allow models to return different types, while keeping generate_embeddings to return a numpy array.

Fixes #6926

Description

Contribution Checklist

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner July 11, 2024 09:50
@eavanvalkenburg eavanvalkenburg changed the title Python: added singular Python: added singular get methods Jul 11, 2024
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Jul 11, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jul 11, 2024

Py3.10 Test Coverage

Python 3.10 Test Coverage Report •
FileStmtsMissCoverMissing
semantic_kernel/connectors/ai
   chat_completion_client_base.py17853%53–56, 95–101
   text_completion_client_base.py15847%43–46, 77–81
semantic_kernel/connectors/ai/embeddings
   embedding_generator_base.py8188%50
semantic_kernel/connectors/ai/hugging_face/services
   hf_text_embedding.py32584%77–81
semantic_kernel/connectors/ai/open_ai/services
   open_ai_text_embedding_base.py36197%57
TOTAL686640294% 

Python 3.10 Unit Test Overview

Tests Skipped Failures Errors Time
1756 1 💤 0 ❌ 0 🔥 23.595s ⏱️

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Jul 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 11, 2024
@moonbox3 moonbox3 enabled auto-merge July 11, 2024 20:43
@moonbox3 moonbox3 added this pull request to the merge queue Jul 11, 2024
Merged via the queue into microsoft:main with commit 6a0077c Jul 11, 2024
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Adds singular get_..._content methods to all services, initially
implemented by calling the multi version and passing back the first
result, it therefore does not check on the number of responses
parameter, just provides the interface.

Also add `generate_raw_embeddings` to Embedding Base to allow models to
return different types, while keeping generate_embeddings to return a
numpy array.

Fixes microsoft#6926 


### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Tao Chen <taochen@microsoft.com>
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: provide get_chat_message_content (singular) method

6 participants