guangzhengli / ChatFiles

Document Chatbot — multiple files. Powered by GPT / Embedding.
MIT License
3.23k stars 480 forks source link

Difference between the variable names in .env? #112

Open magedhelmy1 opened 1 year ago

magedhelmy1 commented 1 year ago

Hi, can you please give an explanation on

NEXT_PUBLIC_CHAT_FILES_MAX_SIZE=0
NEXT_PUBLIC_CHAT_FILES_UPLOAD_PATH=public/uploads# if you want to deploy on vercel, please use /tmp folder
SUPABASE_SERVICE_ROLE_KEY=xxxx
SUPABASE_URL=https://xxxx.supabase.co
OPENAI_TYPE=OPENAI# OPENAI_TYPE=AZURE_OPENAI
OPENAI_API_KEY=sk-xxx
OPENAI_API_MODEL=gpt-3.5-turbo
AZURE_OPENAI_API_KEY=
AZURE_OPENAI_API_DEPLOYMENT_NAME=
AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=
AZURE_OPENAI_API_INSTANCE_NAME=
AZURE_OPENAI_API_VERSION=2023-05-15#default
guangzhengli commented 1 year ago
  1. Only one OpenAI API and Azure OpenAI API key needs to be selected. If OPENAI_TYPE=OPENAI is selected, OPENAI_API_KEY needs to be provided; if AZURE_OPENAI is selected, other environment variables related to AZURE_OPENAI are required. Of course, you can also choose not to enter the environment variables and input them on the front-end page. and this is an open source project and we cannot provide free OpenAPI services.

  2. If you deploy the OpenAI Service in Azure, it will create an instance resource with an instance name, and then you can choose to deploy different models, such as gpt-3.5-turbo, text-embeddings, and other different models. Each deployed model will get a deployment name. In the production environment of ChatFiles, AZURE_OPENAI_API_DEPLOYMENT_NAME deploys the gpt-3.5-turbo model, and AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME deploys the text-embedding-ada-002 model.

  3. This repository mainly focuses on uploading files and providing AI Q&A services, similar to current websites such as ChatPDF, but VectorHub will provide more capabilities, such as GPT embedding based on webpage URLs, helps you build a platform for chat with knowledge bases AI based on your data. and more AI scenarios such as AI search and SDK & API integrating with your website will be supported in the future.

magedhelmy1 commented 1 year ago

Interesting! Thank you and I ran into the following bug. Basically, when I type without submitting a file.

Screenshot 2023-07-24 at 21 01 41
guangzhengli commented 1 year ago

Yes, this is a known bug. Sometimes it outputs information in this format and is not very stable. It's related to LangChian Bug, and I will try to fix it.

magedhelmy1 commented 1 year ago

Thank you for creating a ticket! I shall close this ticket then since you are tracking it from somewhere else. Thanks again and keep the good work up!

magedhelmy1 commented 1 year ago

I saw Github moved this automatically to close! So I reopened it just in case!

magedhelmy1 commented 1 year ago

Do you know where does it get the below message from? Although I have send an empty message (AKA single space click) I am trying to think how can we workaround this bug.

Screenshot 2023-07-27 at 00 28 21
guangzhengli commented 1 year ago

This is because I used the default Prompt of LangChain.JS framework, which carries default messages such as HumanMessage and SystemMessage. The reason why GPT previously returned JSON fixed format instead of String was also due to this reason. I am currently fixing this issue.