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

Semantic Kernel Python README document fix

Open daibi opened this issue 2 years ago • 6 comments

Motivation and Context

Semantic Kernel newbee here, trying to walk through the simple guide in python/README.md. Out-of-date implementations from kernel_config.py and OpenAITextCompletion and are found in the document.

To go through the guide in the document, one should do the following modifications:

  • new path to import text completion service: from semantic_kernel.ai.open_ai import OpenAITextCompletion, AzureTextCompletion
  • change add_text_service to add_text_method to register the text completion service
  • org_id is not required for initializing the text completion service

Description

fix python/README.md:

  • change the path to import OpenAITextCompletion, AzureTextCompletion to semantic_kernel.ai.open_ai
  • use add_text_backend method for text completion service to match the current implementation
  • add a tip that org_id is not required for initializing the text completion service

daibi avatar Apr 26 '23 05:04 daibi

Hi there, I still have some question on the import path of OpenAITextCompletion. It seems that the connector path has returned, but when I try to pip install the semantic kernel, the importing error still exists: ModuleNotFoundError: No module named 'semantic_kernel.connectors'

In the latest update on python-doc-fix, I return the connector path back to make it consist with current main branch implementation.

Will this inconsistency be fixed soon?

daibi avatar Apr 26 '23 06:04 daibi

@daibi @shawncal I believe that the newest API is using add_text_service not add_text_backend

https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/kernel_config.py

alexchaomander avatar Apr 26 '23 07:04 alexchaomander

Hi there, I still have some question on the import path of OpenAITextCompletion. It seems that the connector path has returned, but when I try to pip install the semantic kernel, the importing error still exists: ModuleNotFoundError: No module named 'semantic_kernel.connectors'

In the latest update on python-doc-fix, I return the connector path back to make it consist with current main branch implementation.

Will this inconsistency be fixed soon?

We're doing a lot of cleanup since the core Python SK APIs have been updated! The pip package is currently not always published with the latest changes. Definitely reflect whatever is the latest in main.

@awharrison-28 @dluc FYI

alexchaomander avatar Apr 26 '23 07:04 alexchaomander

@alexchaomander Yeah you are right. I reviewed again and the implementation has been changed to add_text_service.

But the problem still exists when I pip install the newest version of SK

Consider publishing a new version of python package and close this pull request?

daibi avatar Apr 26 '23 07:04 daibi

@alexchaomander Yeah you are right. I reviewed again and the implementation has been changed to add_text_service.

But the problem still exists when I pip install the newest version of SK

Consider publishing a new version of python package and close this pull request?

Yup we're on it! Right now main is out of sync with the latest pip package. We need to publish a new one. @dluc @awharrison-28

alexchaomander avatar Apr 26 '23 07:04 alexchaomander

@awharrison-28 we updated the README too soon, e.g. before releasing the pip package. When introducing breaking changes like this one, the documentation should be synchronized with the release. In other words, code and documentation sometimes are updated asynchronously.

dluc avatar Apr 26 '23 07:04 dluc

Readme and notebooks should all be consistent with the new pip package released today: 0.2.6.dev

awharrison-28 avatar May 02 '23 00:05 awharrison-28

Closing this as it should be resolved with latest pip package.

alexchaomander avatar May 03 '23 21:05 alexchaomander