semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Python SK: Use ChatGPT for Semantic Functions

Open awharrison-28 opened this issue 2 years ago • 0 comments

Motivation and Context

Users want to use ChatGPT as the service for their semantic functions. This feature exists with the C# SK. ChatGPT is perfectly capable of doing this. Additionally added more end-to-end tests with the intention of being able to run them as integration tests for the Python SK.

Description

  • OpenAIChatCompletion now additionally inherits from TextCompletionClientBase. This extends to AzureOpenAIChatCompletion.
  • If a chat service is also a TextCompletionClientBase, it will be added to both text_services and chat_services.
  • Created 4 end-to-end tests that target the combination of Azure, OpenAI, text service, and chat service. Abstracted common behavior for these tests.
  • Added asserts to these end-to-end tests. These should be run as integration tests, but that will be handled in a separate PR.

Contribution Checklist

  • [x] The code builds clean without any errors or warnings
  • [x] The PR follows SK Contribution Guidelines (https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
  • [x] The code follows the .NET coding conventions (https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions) verified with dotnet format
  • [x] All unit tests pass, and I have added new tests where possible
  • [x] I didn't break anyone :smile:

awharrison-28 avatar Apr 25 '23 17:04 awharrison-28