Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/s-o-w/POWER-Bucky
Browse files Browse the repository at this point in the history
  • Loading branch information
s-o-w committed Nov 8, 2023
2 parents 425c585 + 2c5197e commit 232b973
Show file tree
Hide file tree
Showing 55 changed files with 974 additions and 1,015 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/copilot-build-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Package Copilot Chat WebAPI
run: |
scripts\deploy\package-webapi.ps1 -Configuration Release -DotnetFramework net6.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy -Version ${{ steps.versiontag.outputs.versiontag }} -InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format 'yyyy-MM-dd')" -SkipFrontendFiles=${{ github.event_name == 'pull_request' }}
scripts\deploy\package-webapi.ps1 -Configuration Release -DotnetFramework net6.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy -Version ${{ steps.versiontag.outputs.versiontag }} -InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format 'yyyy-MM-dd')" -SkipFrontendFiles ('${{ github.event_name == 'pull_request' }}' -eq 'true')
- name: Upload package to artifacts
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-build-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/copilot-deploy-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ on:

permissions:
contents: read
id-token: write

jobs:
webapi:
environment: ${{inputs.ENVIRONMENT}}
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/copilot-deploy-memorypipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ on:

permissions:
contents: read
id-token: write

jobs:
memorypipeline:
environment: ${{inputs.ENVIRONMENT}}
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-deploy-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
BACKEND_HOST: ${{needs.int.outputs.backend-host}}

stable:
needs: int-tests
needs: [int-tests, build-webapi, build-memorypipeline, build-plugins]
uses: ./.github/workflows/copilot-deploy-environment.yml
with:
ENVIRONMENT: stable
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/copilot-deploy-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ on:

permissions:
contents: read
id-token: write

jobs:
plugins:
environment: ${{inputs.ENVIRONMENT}}
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
cache-dependency-path: webapp/yarn.lock
Expand Down
3 changes: 2 additions & 1 deletion CopilotChat.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChatCopilotIntegrationTests", "integration-tests\ChatCopilotIntegrationTests.csproj", "{0CD2CD95-536B-455F-B74A-772A455FA607}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CopilotChatShared", "shared\CopilotChatShared.csproj", "{94F12185-FAF9-43E3-B153-28A1708AC918}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSearcher", "plugins\web-searcher\WebSearcher.csproj", "{F83C857D-3080-4DEA-B3D1-978E2BC64BFB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginShared", "plugins\shared\PluginShared.csproj", "{9D03913A-21FF-4D0A-9883-95C4B3D6F65A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PluginShared", "plugins\shared\PluginShared.csproj", "{9D03913A-21FF-4D0A-9883-95C4B3D6F65A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions memorypipeline/CopilotChatMemoryPipeline.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="0.24.230918.1-preview" />
<PackageReference Include="Microsoft.SemanticMemory.Core" Version="0.4.231023.1-preview" />
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.7.231106.1-preview" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta4" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions memorypipeline/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.SemanticMemory;
using Microsoft.SemanticMemory.Diagnostics;
using Microsoft.KernelMemory;
using Microsoft.KernelMemory.Diagnostics;

// ********************************************************
// ************** SETUP ***********************************
// ********************************************************

var builder = WebApplication.CreateBuilder();

ISemanticMemoryClient memory =
new MemoryClientBuilder(builder.Services)
IKernelMemory memory =
new KernelMemoryBuilder(builder.Services)
.FromAppSettings()
.WithCustomOcr(builder.Configuration)
.Build();
Expand Down
4 changes: 2 additions & 2 deletions memorypipeline/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
//
// Semantic Memory configuration - https://github.com/microsoft/semantic-memory
// Kernel Memory configuration - https://github.com/microsoft/kernel-memory
// - ContentStorageType is the storage configuration for memory transfer: "AzureBlobs" or "SimpleFileStorage"
// - TextGeneratorType is the AI completion service configuration: "AzureOpenAIText" or "OpenAI"
// - ImageOcrType is the image OCR configuration: "None" or "AzureFormRecognizer" or "Tesseract"
// - DataIngestion is the configuration section for data ingestion pipelines.
// - Retrieval is the configuration section for memory retrieval.
// - Services is the configuration sections for various memory settings.
//
"SemanticMemory": {
"KernelMemory": {
"ContentStorageType": "SimpleFileStorage",
"TextGeneratorType": "AzureOpenAIText",
"ImageOcrType": "None",
Expand Down
6 changes: 5 additions & 1 deletion plugins/web-searcher/PluginEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ public async Task<HttpResponseData> WebSearch([HttpTrigger(AuthorizationLevel.Fu
return await this.CreateBadRequestResponseAsync(req, "Invalid number of results.");
}

var offset = queries.ContainsKey("Offset") ? int.Parse(queries["Offset"]) : 0;
int offset = 0;
if (queries.TryGetValue("Offset", out var offsetValue))
{
int.TryParse(offsetValue, out offset);
}

var site = queries.ContainsKey("Site") ? queries["Site"].ToString() : string.Empty;
if (string.IsNullOrWhiteSpace(site))
Expand Down
6 changes: 3 additions & 3 deletions plugins/web-searcher/local.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Host": {
"CORS": "*"
},
"PluginConfig": {
"BingApiKey": ""
}
"PluginConfig": {
"BingApiKey": ""
}
}
8 changes: 4 additions & 4 deletions scripts/Configure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $webapiProjectPath = Join-Path "$PSScriptRoot" '../webapi'

Write-Host "Setting 'APIKey' user secret for $AIService..."
if ($AIService -eq $varOpenAI) {
dotnet user-secrets set --project $webapiProjectPath SemanticMemory:Services:OpenAI:APIKey $ApiKey
dotnet user-secrets set --project $webapiProjectPath KernelMemory:Services:OpenAI:APIKey $ApiKey
if ($LASTEXITCODE -ne 0) { exit(1) }
$AIServiceOverrides = @{
OpenAI = @{
Expand All @@ -151,9 +151,9 @@ if ($AIService -eq $varOpenAI) {
};
}
else {
dotnet user-secrets set --project $webapiProjectPath SemanticMemory:Services:AzureOpenAIText:APIKey $ApiKey
dotnet user-secrets set --project $webapiProjectPath KernelMemory:Services:AzureOpenAIText:APIKey $ApiKey
if ($LASTEXITCODE -ne 0) { exit(1) }
dotnet user-secrets set --project $webapiProjectPath SemanticMemory:Services:AzureOpenAIEmbedding:APIKey $ApiKey
dotnet user-secrets set --project $webapiProjectPath KernelMemory:Services:AzureOpenAIEmbedding:APIKey $ApiKey
if ($LASTEXITCODE -ne 0) { exit(1) }
$AIServiceOverrides = @{
AzureOpenAIText = @{
Expand All @@ -180,7 +180,7 @@ $appsettingsOverrides = @{
Planner = @{
Model = $PlannerModel
};
SemanticMemory = @{
KernelMemory = @{
TextGeneratorType = $AIService;
DataIngestion = @{
EmbeddingGeneratorTypes = @($AIService)
Expand Down
8 changes: 4 additions & 4 deletions scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ WEBAPI_PROJECT_PATH="${SCRIPT_DIRECTORY}/../webapi"

echo "Setting 'APIKey' user secret for $AI_SERVICE..."
if [ "$AI_SERVICE" = "$ENV_OPEN_AI" ]; then
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH SemanticMemory:Services:OpenAI:APIKey $API_KEY
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH KernelMemory:Services:OpenAI:APIKey $API_KEY
if [ $? -ne 0 ]; then exit 1; fi
AISERVICE_OVERRIDES="{
\"OpenAI\":
Expand All @@ -168,9 +168,9 @@ if [ "$AI_SERVICE" = "$ENV_OPEN_AI" ]; then
}
}"
else
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH SemanticMemory:Services:AzureOpenAIText:APIKey $API_KEY
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH KernelMemory:Services:AzureOpenAIText:APIKey $API_KEY
if [ $? -ne 0 ]; then exit 1; fi
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH SemanticMemory:Services:AzureOpenAIEmbedding:APIKey $API_KEY
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH KernelMemory:Services:AzureOpenAIEmbedding:APIKey $API_KEY
if [ $? -ne 0 ]; then exit 1; fi
AISERVICE_OVERRIDES="{
\"AzureOpenAIText\": {
Expand All @@ -197,7 +197,7 @@ APPSETTINGS_OVERRIDES="{
\"Planner\": {
\"Model\": \"${PLANNER_MODEL}\"
},
\"SemanticMemory\": {
\"KernelMemory\": {
\"TextGeneratorType\": \"${AI_SERVICE}\",
\"DataIngestion\": {
\"EmbeddingGeneratorTypes\": [\"${AI_SERVICE}\"]
Expand Down
Loading

0 comments on commit 232b973

Please sign in to comment.