mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-23 12:26:24 +03:00
Compare commits
9 commits
842bb2ff41
...
631dd28d9a
Author | SHA1 | Date | |
---|---|---|---|
631dd28d9a | |||
e02996355b | |||
0045b27287 | |||
c34a6fe5c2 | |||
b94980a1de | |||
36785c20b8 | |||
62a87f7d36 | |||
8ed77ea3f9 | |||
2ae13e6079 |
4 changed files with 26 additions and 2 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules
|
||||||
|
dist
|
13
Dockerfile
Normal file
13
Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
FROM node:18-alpine as build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:18-alpine as run
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/package*.json /app/index.js /app/note_validator.js /app/core.js /usr/src/app/
|
||||||
|
COPY --from=build /app/dist/ /usr/src/app/dist/
|
||||||
|
RUN npm install --omit=dev
|
||||||
|
CMD npm run start
|
||||||
|
EXPOSE 80
|
8
docker-compose.yml
Normal file
8
docker-compose.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
anopaper:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
restart: unless-stopped
|
|
@ -15,16 +15,17 @@
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Configuration, OpenAIApi } from "openai";
|
import OpenAi from "openai";
|
||||||
|
|
||||||
async function Complete(text) {
|
async function Complete(text) {
|
||||||
document.body.style.cursor = "wait";
|
document.body.style.cursor = "wait";
|
||||||
|
|
||||||
let initText = text;
|
let initText = text;
|
||||||
|
|
||||||
const configuration = new Configuration({
|
const configuration = new OpenAi({
|
||||||
apiKey: settings.openAiKey,
|
apiKey: settings.openAiKey,
|
||||||
});
|
});
|
||||||
|
|
||||||
const openai = new OpenAIApi(configuration);
|
const openai = new OpenAIApi(configuration);
|
||||||
const response = await openai.createCompletion({
|
const response = await openai.createCompletion({
|
||||||
model: "text-davinci-003",
|
model: "text-davinci-003",
|
||||||
|
|
Loading…
Add table
Reference in a new issue