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

Add Azure OpenAI as a Provider for the Title Generation, Excerpt Generation and Content Resizing Features #716

Merged
merged 7 commits into from
Feb 21, 2024

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Feb 14, 2024

Description of the Change

This PR adds a new Provider, Azure OpenAI, and sets that up to work for the Title Generation, Excerpt Generation and Content Resizing Features.

Azure allows you to deploy your own OpenAI resource and choose which model that resource uses (so can choose something like GPT-3.5 or GPT-4). It then provides an endpoint URL and an API key that are used to make requests.

This PR adds a new Provider that accepts those arguments and then filters any requests to that endpoint. We don't set the model during those requests as that is set when the resource is deployed on the Azure side.

Closes #492

How to test the Change

To fully test things, you'll need an Azure account that has access to OpenAI (currently this has to be applied for) and then you'll need to deploy an OpenAI resource.

Once that is in place, you can then access an endpoint URL, an API key and a deployment name, which all three are needed to make successful API requests.

Title Generation.

  1. Go to Tools > ClassifAI > Language Processing > Title Generation
  2. Select Azure OpenAI in the provider field
  3. Enter the endpoint URL, API key and deployment name
  4. Save settings
  5. Create/Edit a post and click the "Generate Titles" button in the sidebar panel
  6. Verify that you will get the title suggestion in a popup as expected

Excerpt Generation.

  1. Go to Tools > ClassifAI > Language Processing > Excerpt Generation
  2. Select Azure OpenAI in the provider field
  3. Enter the endpoint URL, API key and deployment name
  4. Save settings
  5. Create/Edit a post and click the "Generate excerpt" button in the sidebar panel
  6. Verify that you will get the excerpt generated as expected

Content Resizing.

  1. Go to Tools > ClassifAI > Language Processing > Content Resizing
  2. Select Azure OpenAI in the provider field.
  3. Enter the endpoint URL, API key and deployment name
  4. Save settings
  5. Create/Edit a post, add a content paragraph, and click the "Expand/Condense this text" button from the block toolbar
  6. Verify that content gets resized accordingly

Changelog Entry

Added - Azure OpenAI Provider for the Title Generation, Excerpt Generation, and Content Resizing Features

Credits

Props @dkotter, @jeffpaul

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 3.0.0 milestone Feb 14, 2024
@dkotter dkotter self-assigned this Feb 14, 2024
@dkotter dkotter requested review from jeffpaul and a team as code owners February 14, 2024 18:36
@github-actions github-actions bot added the needs:code-review This requires code review. label Feb 14, 2024
@dkotter dkotter requested review from iamdharmesh and removed request for a team and jeffpaul February 19, 2024 17:30
@dkotter dkotter mentioned this pull request Feb 20, 2024
19 tasks
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

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

Thank you for adding this @dkotter. PR LGTM and it tests well. 🚀

@iamdharmesh iamdharmesh merged commit 47bed7b into develop Feb 21, 2024
14 checks passed
@iamdharmesh iamdharmesh deleted the feature/492 branch February 21, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Azure's OpenAI offering
2 participants