Skip to content

Commit

Permalink
Initial PR: azure-search-openai-demo with dotnet backend (#2)
Browse files Browse the repository at this point in the history
Initial PR: azure-search-openai-demo with dotnet backend

---------

Co-authored-by: Liam Cavanagh <[email protected]>
Co-authored-by: Microsoft Open Source <[email protected]>
Co-authored-by: Pablo Castro <[email protected]>
Co-authored-by: Arun Chandrasekhar <[email protected]>
Co-authored-by: Alex Zeltov <[email protected]>
Co-authored-by: Sunil Sattiraju <[email protected]>
Co-authored-by: Jon Gallant <[email protected]>
Co-authored-by: Victor Vazquez <[email protected]>
Co-authored-by: anatolip <[email protected]>
Co-authored-by: mkmsftgit <[email protected]>
Co-authored-by: XiaoYun Zhang <[email protected]>
Co-authored-by: Xiaoyun Zhang <[email protected]>
Co-authored-by: David Pine <[email protected]>
Co-authored-by: David Fowler <[email protected]>
  • Loading branch information
15 people authored Apr 6, 2023
1 parent e510aab commit 21843b2
Show file tree
Hide file tree
Showing 102 changed files with 7,495 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG VARIANT=bullseye
FROM --platform=amd64 mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update && apt-get install -y xdg-utils \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "Azure Developer CLI",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "bullseye"
}
},
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "os-provided"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "16",
"nodeGypDependencies": false
},
"ghcr.io/devcontainers/features/powershell:1.1.0": {},
"ghcr.io/devcontainers/features/azure-cli:1.0.8": {}
},
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.azure-dev",
"ms-azuretools.vscode-bicep",
"ms-python.python"
]
}
},
"forwardPorts": [
5000
],
"postCreateCommand": "",
"remoteUser": "vscode",
"hostRequirements": {
"memory": "8gb"
}
}
9 changes: 9 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Microsoft Open Source Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

Resources:

- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE MIGHT BE CLOSED WITHOUT FURTHER CONSIDERATION OR INVESTIGATION
-->
> Please provide us with the following information:
> ---------------------------------------------------------------
### This issue is for a: (mark with an `x`)
```
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```

### Minimal steps to reproduce
>
### Any log messages given by the failure
>
### Expected/desired behavior
>
### OS and Version?
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
### Versions
>
### Mention any other details that might be useful

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.
45 changes: 45 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Purpose
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
* ...

## Does this introduce a breaking change?
<!-- Mark one with an "x". -->
```
[ ] Yes
[ ] No
```

## Pull Request Type
What kind of change does this Pull Request introduce?

<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
```

## How to Test
* Get the code

```
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
```

* Test the code
<!-- Add steps to run the tests suite and/or manually test -->
```
```

## What to Check
Verify that the following are valid
* ...

## Other Information
<!-- Add any other helpful information that may be needed here. -->
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"ms-azuretools.azure-dev"
]
}
60 changes: 60 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"cwd": "${workspaceFolder}/app/backend",
"env": {
"FLASK_APP": "app.py",
"FLASK_ENV": "development",
"FLASK_DEBUG": "0"
},
"args": [
"run",
"--no-debugger",
"--no-reload",
"-p 5000"
],
"console": "integratedTerminal",
"justMyCode": true,
"envFile": "${input:dotEnvFilePath}",
},
{
"name": "Frontend: watch",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/app/frontend",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"watch"
],
"console": "integratedTerminal",
},
{
"name": "Frontend: build",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/app/frontend",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"build"
],
"console": "integratedTerminal",
}
],
"inputs": [
{
"id": "dotEnvFilePath",
"type": "command",
"command": "azure-dev.commands.getDotEnvFilePath"
}
]
}
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"search.exclude": {
"**/node_modules": true,
"static": true
}
}
35 changes: 35 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start App",
"type": "dotenv",
"targetTasks": [
"Start App (Script)"
],
"file": "${input:dotEnvFilePath}"
},
{
"label": "Start App (Script)",
"type": "shell",
"command": "${workspaceFolder}/app/start.sh",
"windows": {
"command": "pwsh ${workspaceFolder}/app/start.ps1"
},
"presentation": {
"reveal": "silent"
},
"options": {
"cwd": "${workspaceFolder}/app"
},
"problemMatcher": []
}
],
"inputs": [
{
"id": "dotEnvFilePath",
"type": "command",
"command": "azure-dev.commands.getDotEnvFilePath"
}
]
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## [project-title] Changelog

<a name="x.y.z"></a>
# x.y.z (yyyy-mm-dd)

*Features*
* ...

*Bug Fixes*
* ...

*Breaking Changes*
* ...
File renamed without changes.
19 changes: 19 additions & 0 deletions app/backend/Backend.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>6c0daa7e-5118-4a21-8aeb-f7b977fe2f01</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.8.2" />
<PackageReference Include="Azure.Search.Documents" Version="11.4.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.15.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Microsoft.SemanticKernel" Version="0.9.61.1-preview" />
<PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.5" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions app/backend/Backend.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33516.290
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Backend", "Backend.csproj", "{8F69B6F2-3A1D-4CD0-8E60-3ED6A07EE0B9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F69B6F2-3A1D-4CD0-8E60-3ED6A07EE0B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F69B6F2-3A1D-4CD0-8E60-3ED6A07EE0B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F69B6F2-3A1D-4CD0-8E60-3ED6A07EE0B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F69B6F2-3A1D-4CD0-8E60-3ED6A07EE0B9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8ECFF1CB-3BA1-4EDF-BC00-D96024BBDDAD}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 21843b2

Please sign in to comment.