Giter Club home page Giter Club logo

vue3-ai-assistant's Introduction

vue3-ai-assistant

构建一个 Vue3 的 AI 助手 用户可以通过聊天的形式来学习 Vue3 的文档

安装

  1. 安装依赖
// 安装 web 依赖
pnpm i 

// 安装 server 依赖
cd server && pnpm i
  1. 创建 .env 文件提供所需要的环境变量

在 server 文件夹下创建 .env 文件 配置以下几个环境变量

// openai 的 api key
OPENAI_API_KEY=""
// pinecone 向量数据库的 api key
PINECONE_API_KEY=""
PINECONE_ENVIRONMENT=""
PINECONE_INDEX=""

使用

  1. 先开启 web 服务
pnpm dev
  1. 在开启 server 服务
cd server && pnpm dev

vue3-ai-assistant's People

Contributors

cuixiaorui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue3-ai-assistant's Issues

有个小小的问题

UnstructuredLoader.load is not a function【再引用这个langchain库的UnstructuredLoader】,读取文档时:ReferenceError: FormData is not defined

在连接到pinecone向量数据库时报错,提示"API key is missing, please provide an API key in the header.

运行: yarn run ingest 命令,控制台报错如下:

/usr/local/bin/yarn run ingest
yarn run v1.22.17
$ node script/ingest-data.js
(node:6620) ExperimentalWarning: buffer.File is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///Users/xz/Documents/code/myGithub/vue3-ai-assistant/server/node_modules/langchain/dist/document_loaders/fs/unstructured.js:72
            throw new Error(`Failed to partition file ${this.filePath} with error ${response.status} and message ${await response.text()}`);
                  ^

Error: Failed to partition file /Users/xz/Documents/code/myGithub/vue3-ai-assistant/server/source/vue3-document-en.md with error 401 and message {"detail":"API key is missing, please provide an API key in the header."}
    at UnstructuredLoader._partition (file:///Users/xz/Documents/code/myGithub/vue3-ai-assistant/server/node_modules/langchain/dist/document_loaders/fs/unstructured.js:72:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async UnstructuredLoader.load (file:///Users/xz/Documents/code/myGithub/vue3-ai-assistant/server/node_modules/langchain/dist/document_loaders/fs/unstructured.js:81:26)
    at async file:///Users/xz/Documents/code/myGithub/vue3-ai-assistant/server/script/ingest-data.js:17:17

Node.js v18.16.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Process finished with exit code 1

.env文件配置正常

.env配置如下,并且在运行 yarn run ingest 命令时 控制台,可以正常打印 process.env.PINECONE_API_KEY 的值。
OPENAI_API_KEY 配置没问题,可以正常使用。请问啥原因

image image image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.