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

Http consistency: Hugging Face #1261

Conversation

SergeyMenshykh
Copy link
Member

Description

This PR introduces the following changes:

  1. The classes HuggingFaceTextCompletion and HuggingFaceTextEmbeddingGeneration now accept a custom HTTP client, allowing the hosting application/client code to provide their own instances.
  2. Two new extension methods, WithHuggingFaceTextCompletionService and WithHuggingFaceTextEmbeddingGenerationService, are added to the KernelBuilder class. These methods simplify the registration of Hugging Face AI services, align the registration process with other connector registration, and enforce the usage of an HTTP client and retry handlers configured by the SK SDK.
  3. Several older constructors of the classes are marked as obsolete to prevent any potential breaking changes.

Contribution Checklist

@github-actions github-actions bot added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel samples labels May 29, 2023
@SergeyMenshykh SergeyMenshykh added the PR: ready for review All feedback addressed, ready for reviews label May 29, 2023
@SergeyMenshykh SergeyMenshykh changed the title Http consistency second iteration Http consistency: Hugging face May 29, 2023
@SergeyMenshykh SergeyMenshykh changed the title Http consistency: Hugging face Http consistency: Hugging Face May 29, 2023
@SergeyMenshykh SergeyMenshykh added PR: paused PR temporarily parked PR: feedback to address Waiting for PR owner to address comments/questions and removed PR: ready for review All feedback addressed, ready for reviews labels May 30, 2023
@SergeyMenshykh SergeyMenshykh added PR: ready for review All feedback addressed, ready for reviews and removed PR: feedback to address Waiting for PR owner to address comments/questions PR: paused PR temporarily parked labels Jun 6, 2023
Copy link
Member

@lemillermicrosoft lemillermicrosoft left a comment

Choose a reason for hiding this comment

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

LGTM -- left one comment re: guidance from obsolete markings.

@lemillermicrosoft lemillermicrosoft merged commit fc3202a into microsoft:main Jun 6, 2023
15 checks passed
salmon131 pushed a commit to salmon131/semantic-kernel that referenced this pull request Jun 7, 2023
### Description
This PR introduces the following changes:
1. The classes HuggingFaceTextCompletion and
HuggingFaceTextEmbeddingGeneration now accept a custom HTTP client,
allowing the hosting application/client code to provide their own
instances.
2. Two new extension methods, WithHuggingFaceTextCompletionService and
WithHuggingFaceTextEmbeddingGenerationService, are added to the
KernelBuilder class. These methods simplify the registration of Hugging
Face AI services, align the registration process with other connector
registration, and enforce the usage of an HTTP client and retry handlers
configured by the SK SDK.
3. Several older constructors of the classes are marked as obsolete to
prevent any potential breaking changes.
@SergeyMenshykh SergeyMenshykh linked an issue Jun 20, 2023 that may be closed by this pull request
shawncal pushed a commit to shawncal/semantic-kernel that referenced this pull request Jul 6, 2023
### Description
This PR introduces the following changes:
1. The classes HuggingFaceTextCompletion and
HuggingFaceTextEmbeddingGeneration now accept a custom HTTP client,
allowing the hosting application/client code to provide their own
instances.
2. Two new extension methods, WithHuggingFaceTextCompletionService and
WithHuggingFaceTextEmbeddingGenerationService, are added to the
KernelBuilder class. These methods simplify the registration of Hugging
Face AI services, align the registration process with other connector
registration, and enforce the usage of an HTTP client and retry handlers
configured by the SK SDK.
3. Several older constructors of the classes are marked as obsolete to
prevent any potential breaking changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: ready for review All feedback addressed, ready for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semantic Kernel needs a consistent story around HttpClient
3 participants