Skip to content

Commit

Permalink
Merge branch 'cc-azure-deploy' of https://github.com/gitri-ms/semanti…
Browse files Browse the repository at this point in the history
…c-kernel into cc-azure-deploy
  • Loading branch information
gitri-ms committed Jul 6, 2023
2 parents 6254ea9 + 9cc9e0d commit 9774e88
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 62 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/python-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ name: Python Integration Tests
on:
workflow_dispatch:
push:
branches: [ "main"]
paths:
- 'python/**'
branches: ["main"]
paths:
- "python/**"
schedule:
- cron: '0 */12 * * *' # Run every 12 hours: midnight UTC and noon UTC

- cron: "0 */12 * * *" # Run every 12 hours: midnight UTC and noon UTC

permissions:
contents: read
Expand All @@ -25,44 +24,45 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies wtih hnswlib native disabled
if: matrix.os == 'macos-latest' && matrix.python-version == '3.11'
run: |
export HNSWLIB_NO_NATIVE=1
python -m pip install --upgrade pip setuptools wheel
python -m pip install poetry pytest
cd python && poetry install --with hugging_face --with chromadb --with weaviate
- name: Install dependencies wtih hnswlib native enabled
if: matrix.os != 'macos-latest' || matrix.python-version != '3.11'
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install poetry pytest
cd python && poetry install --with hugging_face --with chromadb --with weaviate
- name: Run Integration Tests
shell: bash
env: # Set Azure credentials secret as an input
HNSWLIB_NO_NATIVE: 1
Python_Integration_Tests: Python_Integration_Tests
AzureOpenAI__Label: azure-text-davinci-003
AzureOpenAIEmbedding__Label: azure-text-embedding-ada-002
AzureOpenAI__DeploymentName: ${{ vars.AZUREOPENAI__DEPLOYMENTNAME }}
AzureOpenAIChat__DeploymentName: ${{ vars.AZUREOPENAI__CHAT__DEPLOYMENTNAME }}
AzureOpenAIEmbeddings__DeploymentName: ${{ vars.AZUREOPENAIEMBEDDING__DEPLOYMENTNAME }}
AzureOpenAI__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
AzureOpenAIEmbeddings__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
AzureOpenAI__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
AzureOpenAIEmbeddings__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
Bing__ApiKey: ${{ secrets.BING__APIKEY }}
OpenAI__ApiKey: ${{ secrets.OPENAI__APIKEY }}
run: |
cd python
poetry run pytest ./tests/integration
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies with hnswlib native disabled
if: matrix.os == 'macos-latest' && matrix.python-version == '3.11'
run: |
export HNSWLIB_NO_NATIVE=1
python -m pip install --upgrade pip setuptools wheel
python -m pip install poetry pytest
cd python && poetry install --with hugging_face --with chromadb --with weaviate
- name: Install dependencies with hnswlib native enabled
if: matrix.os != 'macos-latest' || matrix.python-version != '3.11'
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install poetry pytest
cd python && poetry install --with hugging_face --with chromadb --with weaviate
- name: Run Integration Tests
shell: bash
env: # Set Azure credentials secret as an input
HNSWLIB_NO_NATIVE: 1
Python_Integration_Tests: Python_Integration_Tests
AzureOpenAI__Label: azure-text-davinci-003
AzureOpenAIEmbedding__Label: azure-text-embedding-ada-002
AzureOpenAI__DeploymentName: ${{ vars.AZUREOPENAI__DEPLOYMENTNAME }}
AzureOpenAIChat__DeploymentName: ${{ vars.AZUREOPENAI__CHAT__DEPLOYMENTNAME }}
AzureOpenAIEmbeddings__DeploymentName: ${{ vars.AZUREOPENAIEMBEDDING__DEPLOYMENTNAME }}
AzureOpenAI__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
AzureOpenAIEmbeddings__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
AzureOpenAI__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
AzureOpenAIEmbeddings__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
Bing__ApiKey: ${{ secrets.BING__APIKEY }}
OpenAI__ApiKey: ${{ secrets.OPENAI__APIKEY }}
Pinecone__ApiKey: ${{ secrets.PINECONE__APIKEY }}
Pinecone__Environment: ${{ secrets.PINECONE__ENVIRONMENT }}
run: |
cd python
poetry run pytest ./tests/integration
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

[![Python package](https://img.shields.io/pypi/v/semantic-kernel)](https://pypi.org/project/semantic-kernel/)
[![Nuget package](https://img.shields.io/nuget/vpre/Microsoft.SemanticKernel)](https://www.nuget.org/packages/Microsoft.SemanticKernel/)
[![dotnet](https://github.com/microsoft/semantic-kernel/actions/workflows/dotnet-ci.yml/badge.svg?branch=main)](https://github.com/microsoft/semantic-kernel/actions/workflows/dotnet-ci.yml)
[![dotnet Docker](https://github.com/microsoft/semantic-kernel/actions/workflows/dotnet-ci-docker.yml/badge.svg?branch=main)](https://github.com/microsoft/semantic-kernel/actions/workflows/dotnet-ci-docker.yml)
[![dotnet Windows](https://github.com/microsoft/semantic-kernel/actions/workflows/dotnet-ci-windows.yml/badge.svg?branch=main)](https://github.com/microsoft/semantic-kernel/actions/workflows/dotnet-ci-windows.yml)
[![License: MIT](https://img.shields.io/github/license/microsoft/semantic-kernel)](https://github.com/microsoft/semantic-kernel/blob/main/LICENSE)
[![Discord](https://img.shields.io/discord/1063152441819942922?label=Discord&logo=discord&logoColor=white&color=d82679)](https://aka.ms/SKDiscord)

> ℹ️ **NOTE**:This project is just like AI and will evolve quickly.
> ℹ️ **NOTE**: This project is just like AI and will evolve quickly.
> We invite you to join us in developing the Semantic Kernel together!
> Please contribute by
> using GitHub [Discussions](https://github.com/microsoft/semantic-kernel/discussions),
Expand Down Expand Up @@ -43,31 +44,41 @@ in the history of computing.

Semantic Kernel is available to explore AI and build apps with C# and Python:

<div style="display:flex;height:30px;padding:5px 0 5px 10px;">
<img src="https://user-images.githubusercontent.com/371009/230673036-fad1e8e6-5d48-49b1-a9c1-6f9834e0d165.png" style="margin-right:12px" height="30"/>
<a href="dotnet/README.md">Using Semantic Kernel in C#</a>.
</div>

<div style="display:flex;height:30px;padding:5px 0 5px 10px;">
<img src="https://user-images.githubusercontent.com/371009/230673733-7a447d30-b48e-46e1-bd84-2b321c90649e.png" style="margin-right:12px" height="30"/>
<a href="python/README.md">Using Semantic Kernel in Python</a>.
</div>
<br/>
<table width=100%>
<tbody>
<tr>
<td>
<img align="left" width=52px src="https://user-images.githubusercontent.com/371009/230673036-fad1e8e6-5d48-49b1-a9c1-6f9834e0d165.png">
<div>
<a href="dotnet/README.md">Using Semantic Kernel in C#</a> &nbsp
</div>
</td>
<td>
<img align="left" width=52px src="https://raw.githubusercontent.com/devicons/devicon/master/icons/python/python-original.svg">
<div>
<a href="python/README.md">Using Semantic Kernel in Python</a>
</div>
</td>
</tr>
</tbody>
</table>

See the [Feature Matrix](FEATURE_MATRIX.md) to see a breakdown of feature parity between C# and Python.

The quickest way to get started with the basics is to get an API key
(OpenAI or Azure OpenAI)
and to run one of the C# or Python console applications/scripts:

For C#:
### For C#:

1. Create a new console app.
2. Add the semantic kernel nuget `Microsoft.SemanticKernel`.
3. Copy the code from [here](dotnet/README.md) into the app `Program.cs` file.
4. Replace the configuration placeholders for API key and other params with your key and settings.
5. Run with `F5` or `dotnet run`

For Python:
### For Python:

1. Install the pip package: `python -m pip install semantic-kernel`.
2. Create a new script e.g. `hello-world.py`.
3. Store your API key and settings in an `.env` file as described [here](python/README.md).
Expand Down
6 changes: 3 additions & 3 deletions python/tests/integration/connectors/memory/test_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
def get_pinecone_config():
if "Python_Integration_Tests" in os.environ:
api_key = os.environ["Pinecone__ApiKey"]
org_id = None
environment = os.environ["Pinecone__Environment"]
else:
# Load credentials from .env file
api_key, org_id = sk.pinecone_settings_from_dot_env()
api_key, environment = sk.pinecone_settings_from_dot_env()

return api_key, org_id
return api_key, environment


@pytest.fixture
Expand Down

0 comments on commit 9774e88

Please sign in to comment.