Files
semantic-kernel/python/samples/learn_resources
Eduard van Valkenburg fb8edbef94 Python: updates to cicd and notebooks (#6485)
### 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.
-->
Small update to test coverage workflow, to retrigger based on workflow
run.
Small updates to samples notebooks, to use GLOBAL_LLM_SERVICE allowing
control of where they run through env.

### 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 😄
2024-06-03 13:58:02 +00:00
..
2024-05-28 15:46:18 +00:00
2024-05-28 15:46:18 +00:00
2024-05-28 15:46:18 +00:00

SK Python Documentation Examples

This project contains a collection of examples used in documentation on learn.microsoft.com.

Prerequisites

  • Python 3.10 and above
  • Install Semantic Kernel through PyPi:
    pip install semantic-kernel
    

Configuring the sample

The samples can be configured with a .env file in the project which holds api keys and other secrets and configurations.

Make sure you have an Open AI API Key or Azure Open AI service key

Copy the .env.example file to a new file named .env. Then, copy those keys into the .env file:

GLOBAL_LLM_SERVICE="OpenAI" # Toggle between "OpenAI" or "AzureOpenAI"

OPEN_AI_CHAT_MODEL_ID="gpt-3.5-turbo-0125"
OPEN_AI_TEXT_MODEL_ID="gpt-3.5-turbo-instruct"
OPENAI_API_KEY=""
OPENAI_ORG_ID=""

AZURE_OPEN_AI_CHAT_DEPLOYMENT_NAME="gpt-35-turbo"
AZURE_OPEN_AI_TEXT_DEPLOYMENT_NAME="gpt-35-turbo-instruct"
AZURE_OPENAI_ENDPOINT=""
AZURE_OPENAI_API_KEY=""
AZURE_OPENAI_API_VERSION=""

Note: if running the examples with VSCode, it will look for your .env file at the main root of the repository.

Running the sample

To run the console application within Visual Studio Code, just hit F5. Otherwise the sample can be run via the command line:

python.exe <absolute_path_to_sk_code>/python/samples/documentation_examples/planner.py