From 7032e375d27a33efb25dd721b6c1eead09cc5573 Mon Sep 17 00:00:00 2001 From: Anbraten <6918444+anbraten@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:52:04 +0200 Subject: [PATCH] feat: support streaming (#61) --- nuxt.config.ts | 2 +- package.json | 43 +- pages/chats/[chat_id].vue | 72 +- pnpm-lock.yaml | 4111 ++++++++++------------ server/api/chats/[chat_id]/chat.post.ts | 322 +- server/api/repos/[repo_id]/clone.post.ts | 11 +- server/utils/vectorStore.ts | 2 + 7 files changed, 2255 insertions(+), 2308 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 8807f8d..660a618 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -5,7 +5,7 @@ export default defineNuxtConfig({ runtimeConfig: { ai: { token: '', - model: 'gpt-3.5-turbo', + model: 'gpt-3.5-turbo-1106', // model: 'gpt-4', }, auth: { diff --git a/package.json b/package.json index defff7d..736bcfd 100644 --- a/package.json +++ b/package.json @@ -16,43 +16,44 @@ "start:docker": "docker build -t codecaptain . && docker run --rm -ti -p 3000 --env-file .env codecaptain" }, "devDependencies": { - "@iconify/json": "^2.2.195", + "@iconify/json": "^2.2.218", "@nuxt/devtools": "latest", - "@nuxt/ui": "^2.14.2", - "@nuxtjs/tailwindcss": "^6.11.4", - "@types/better-sqlite3": "^7.6.9", + "@nuxt/ui": "^2.16.0", + "@nuxtjs/tailwindcss": "^6.12.0", + "@types/better-sqlite3": "^7.6.10", "@types/canvas-confetti": "^1.6.4", "@types/jsonwebtoken": "^9.0.6", - "@types/markdown-it": "^13.0.7", - "@types/node": "^20.11.30", + "@types/markdown-it": "^13.0.8", + "@types/node": "^20.14.2", "dotenv": "^16.4.5", - "drizzle-kit": "^0.20.14", + "drizzle-kit": "^0.20.18", "esbuild": "^0.20.2", "esbuild-plugin-copy": "^2.1.1", - "nuxt": "^3.11.2", - "prettier": "^3.2.5", - "tsx": "^4.7.1", + "nuxt": "^3.12.1", + "prettier": "^3.3.2", + "tsx": "^4.15.2", "typescript": "^5.4.5", - "vue-tsc": "^2.0.19" + "vue-tsc": "^2.0.21" }, "dependencies": { "@gitbeaker/core": "^40.0.3", "@gitbeaker/rest": "^40.0.3", - "@langchain/community": "^0.2.2", - "@langchain/openai": "^0.0.33", + "@langchain/community": "^0.2.10", + "@langchain/core": "^0.2.6", + "@langchain/openai": "^0.1.3", "@langchain/weaviate": "^0.0.4", - "better-sqlite3": "^9.4.3", + "better-sqlite3": "^9.6.0", "canvas-confetti": "^1.9.3", "consola": "^3.2.3", - "drizzle-orm": "^0.30.4", - "glob": "^10.3.10", + "drizzle-orm": "^0.30.10", + "glob": "^10.4.1", "jsonwebtoken": "^9.0.2", "jwt-decode": "^4.0.0", - "langchain": "^0.2.2", + "langchain": "^0.2.5", "nuxt-icon": "^0.6.10", - "octokit": "^3.1.2", - "simple-git": "^3.23.0", - "vue-markdown-render": "^2.1.1", - "zod": "^3.22.4" + "octokit": "^3.2.1", + "simple-git": "^3.25.0", + "vue-markdown-render": "^2.2.1", + "zod": "^3.23.8" } } diff --git a/pages/chats/[chat_id].vue b/pages/chats/[chat_id].vue index acb80da..4dd9441 100644 --- a/pages/chats/[chat_id].vue +++ b/pages/chats/[chat_id].vue @@ -1,9 +1,14 @@