Skip to content

Commit

Permalink
Fix all code lint and format issues (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
blrchen committed Jul 9, 2023
1 parent a7bfa39 commit f5de99c
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 281 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.next
node_modules
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "website",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev"],
"autoAttachChildProcesses": true,
"stopOnEntry": true,
"skipFiles": ["<node_internals>/**"]
}
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
}
}
20 changes: 11 additions & 9 deletions README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ curl -X "POST" "http://localhost:3000/v1/chat/completions" \

The azure-openai-proxy has been tested and confirmed to work with the following applications:

| Application Name | Docker-compose File |
|------------------|---------------------|
| [chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) | [docker-compose.yml](./e2e/chatbot-ui/docker-compose.yml) |
| Application Name | Docker-compose File |
| --------------------------------------------------------------- | --------------------------------------------------------------- |
| [chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) | [docker-compose.yml](./e2e/chatbot-ui/docker-compose.yml) |
| [chatgpt-next-web](https://github.com/Yidadaa/ChatGPT-Next-Web) | [docker-compose.yml](./e2e/chatgpt-next-web/docker-compose.yml) |
| [chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web) | [docker-compose.yml](./e2e/chatgpt-web/docker-compose.yml) |
| [chatgpt-lite](https://github.com/blrchen/chatgpt-lite) | [docker-compose.yml](./e2e/chatgpt-lite/docker-compose.yml) |
| [chatgpt-mininal](https://github.com/blrchen/chatgpt-mininal) | [docker-compose.yml](./e2e/chatgpt-mininal/docker-compose.yml) |
| [chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web) | [docker-compose.yml](./e2e/chatgpt-web/docker-compose.yml) |
| [chatgpt-lite](https://github.com/blrchen/chatgpt-lite) | [docker-compose.yml](./e2e/chatgpt-lite/docker-compose.yml) |
| [chatgpt-mininal](https://github.com/blrchen/chatgpt-mininal) | [docker-compose.yml](./e2e/chatgpt-mininal/docker-compose.yml) |

To test locally, follow these steps:

Expand All @@ -78,19 +78,21 @@ To test locally, follow these steps:
## FAQs

<details>
<summary>Q: What are `AZURE_RESOURCE_ID`,`AZURE_MODEL_DEPLOYMENT`, and `AZURE_API_KEY`?
<summary>Q: What are `AZURE_RESOURCE_ID`,`AZURE_MODEL_DEPLOYMENT`, and `AZURE_API_KEY`?</summary>

A: You can find these in the Azure management portal. Refer to the image below for details:

![resource-and-model](./resource-and-model.jpg)

</details>

<details>
<summary>Q: How can I use GPT-4?
<summary>Q: How can I use GPT-4?</summary>

A: To use GPT-4, use the key format as follows:

`AZURE_RESOURCE_ID:gpt-3.5-turbo|AZURE_MODEL_DEPLOYMENT,gpt-4|AZURE_MODEL_DEPLOYMENT,gpt-4-32k|AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY:AZURE_API_VERSION`

</details>

## Contributing
Expand All @@ -99,4 +101,4 @@ We welcome various PR submissions.

## Disclaimer

This code is intended for demonstration and testing purposes only.
This code is intended for demonstration and testing purposes only.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

[English](./README.en-US.md) | 简体中文

Azure OpenAI Proxy是一个 OpenAI API 代理工具,它可以将OpenAI API请求转换为Azure OpenAI API请求,使仅支持OpenAI的应用程序可以无缝地使用Azure OpenAI。
Azure OpenAI Proxy 是一个 OpenAI API 代理工具,它可以将 OpenAI API 请求转换为 Azure OpenAI API 请求,使仅支持 OpenAI 的应用程序可以无缝地使用 Azure OpenAI。

## 使用要求

必须拥有Azure OpenAI帐户才能使用 Azure OpenAI Proxy。
必须拥有 Azure OpenAI 帐户才能使用 Azure OpenAI Proxy。

## Azure部署
## Azure 部署

[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fscalaone%2Fazure-openai-proxy%2Fmain%2Fdeploy%2Fazure-deploy.json)

Expand Down Expand Up @@ -56,13 +56,13 @@ curl -X "POST" "http://localhost:3000/v1/chat/completions" \

以下应用已经过测试,确认可以与 azure-openai-proxy 一起工作:

| App Name | E2E Docker-compose file |
|------------------|-------------------------|
| [chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) | [docker-compose.yml](./e2e/chatbot-ui/docker-compose.yml) |
| App Name | E2E Docker-compose file |
| --------------------------------------------------------------- | --------------------------------------------------------------- |
| [chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) | [docker-compose.yml](./e2e/chatbot-ui/docker-compose.yml) |
| [chatgpt-next-web](https://github.com/Yidadaa/ChatGPT-Next-Web) | [docker-compose.yml](./e2e/chatgpt-next-web/docker-compose.yml) |
| [chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web) | [docker-compose.yml](./e2e/chatgpt-web/docker-compose.yml) |
| [chatgpt-lite](https://github.com/blrchen/chatgpt-lite) | [docker-compose.yml](./e2e/chatgpt-lite/docker-compose.yml) |
| [chatgpt-minimal](https://github.com/blrchen/chatgpt-minimal) | [docker-compose.yml](./e2e/chatgpt-minimal/docker-compose.yml) |
| [chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web) | [docker-compose.yml](./e2e/chatgpt-web/docker-compose.yml) |
| [chatgpt-lite](https://github.com/blrchen/chatgpt-lite) | [docker-compose.yml](./e2e/chatgpt-lite/docker-compose.yml) |
| [chatgpt-minimal](https://github.com/blrchen/chatgpt-minimal) | [docker-compose.yml](./e2e/chatgpt-minimal/docker-compose.yml) |

要在本地运行测试,请按照以下步骤操作:

Expand All @@ -80,19 +80,21 @@ curl -X "POST" "http://localhost:3000/v1/chat/completions" \
A: 可以在Azure的管理门户里查找,具体见下图标注

![resource-and-model](./resource-and-model.jpg)

</details>

<details>
<summary>Q: 如何支持GPT-4</summary>
A: 要使用GPT-4,请使用下列格式的key:
A: 要使用GPT-4,请使用下列格式的key:

`AZURE_RESOURCE_ID:gpt-3.5-turbo|AZURE_MODEL_DEPLOYMENT,gpt-4|AZURE_MODEL_DEPLOYMENT,gpt-4-32k|AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY:AZURE_API_VERSION`

</details>

# 贡献代码方式

欢迎提交各种PR
欢迎提交各种 PR

# 免责声明

此代码仅供演示和测试目的。
此代码仅供演示和测试目的。

0 comments on commit f5de99c

Please sign in to comment.