From 769810cb78bd9e4d2eb43a38b5203dd7ec9996ab Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Wed, 11 Oct 2023 22:20:42 -0400 Subject: [PATCH] deps: update --- package.json | 2 +- pnpm-lock.yaml | 37 ++++++++++++++----------------------- src/utils/openai.ts | 3 +-- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index c6dd6d4..d065730 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "mermaid": "^10.4.0", "nanoid": "^5.0.1", "next": "13.5.4", - "openai": "^4.4.0", + "openai": "^4.12.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-highlight": "^0.15.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b47342b..422dd9c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,8 +78,8 @@ dependencies: specifier: 13.5.4 version: 13.5.4(react-dom@18.2.0)(react@18.2.0) openai: - specifier: ^4.4.0 - version: 4.4.0 + specifier: ^4.12.1 + version: 4.12.1 react: specifier: ^18.2.0 version: 18.2.0 @@ -1890,15 +1890,15 @@ packages: resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} dev: false - /@types/node-fetch@2.6.4: - resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} + /@types/node-fetch@2.6.6: + resolution: {integrity: sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw==} dependencies: '@types/node': 20.6.3 - form-data: 3.0.1 + form-data: 4.0.0 dev: false - /@types/node@18.17.14: - resolution: {integrity: sha512-ZE/5aB73CyGqgQULkLG87N9GnyGe5TcQjv34pwS8tfBs1IkCh0ASM69mydb2znqd6v0eX+9Ytvk6oQRqu8T1Vw==} + /@types/node@18.18.4: + resolution: {integrity: sha512-t3rNFBgJRugIhackit2mVcLfF6IRc0JE4oeizPQL8Zrm8n2WY/0wOdpOPhdtG0V9Q2TlW/axbF1MJ6z+Yj/kKQ==} dev: false /@types/node@20.6.3: @@ -2203,7 +2203,7 @@ packages: /axios@0.26.1: resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==} dependencies: - follow-redirects: 1.15.2 + follow-redirects: 1.15.3 transitivePeerDependencies: - debug dev: false @@ -3502,8 +3502,8 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: false - /follow-redirects@1.15.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + /follow-redirects@1.15.3: + resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -3522,15 +3522,6 @@ packages: resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==} dev: false - /form-data@3.0.1: - resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: false - /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -5086,12 +5077,12 @@ packages: - debug dev: false - /openai@4.4.0: - resolution: {integrity: sha512-JN0t628Kh95T0IrXl0HdBqnlJg+4Vq0Bnh55tio+dfCnyzHvMLiWyCM9m726MAJD2YkDU4/8RQB6rNbEq9ct2w==} + /openai@4.12.1: + resolution: {integrity: sha512-EAoUwm4dtiWvFwBhOCK/VfF8sj1ZU8+aAIJnfT4NyeTfrt1DM/6Gdd6fOZWTjBYryTAqu9Vpb5+9Wu6JMtm/gA==} hasBin: true dependencies: - '@types/node': 18.17.14 - '@types/node-fetch': 2.6.4 + '@types/node': 18.18.4 + '@types/node-fetch': 2.6.6 abort-controller: 3.0.0 agentkeepalive: 4.5.0 digest-fetch: 1.3.0 diff --git a/src/utils/openai.ts b/src/utils/openai.ts index 4017845..d8de29a 100644 --- a/src/utils/openai.ts +++ b/src/utils/openai.ts @@ -1,13 +1,12 @@ import {ClientOptions, OpenAI} from "openai"; import {db} from "../db"; import {config} from "./config"; -import {ChatCompletion, ChatCompletionMessage, Completions} from "openai/resources/chat"; import {GPTTokens, supportModelType} from "gpt-tokens/index"; import {useApiKey} from "../hooks/useApiKey"; import {CancelToken} from "cancel-token"; -import ChatCompletionChunk = Completions.ChatCompletionChunk; import {Stream} from "openai/streaming"; import {updateChatTitle} from "./chatUpdateTitle"; +import {ChatCompletion, ChatCompletionChunk, ChatCompletionMessage} from "openai/resources/chat"; function getClient( apiType: string,