Shaunwei / RealChar

🎙️🤖Create, Customize and Talk to your AI Character/Companion in Realtime (All in One Codebase!). Have a natural seamless conversation with AI everywhere (mobile, web and terminal) using LLM OpenAI GPT3.5/4, Anthropic Claude2, Chroma Vector DB, Whisper Speech2Text, ElevenLabs Text2Speech🎙️🤖
https://RealChar.ai/
MIT License
5.94k stars 727 forks source link

/uploadfile 401 Unauthorized (Invalid Authorization credentials) #498

Open jackgofff opened 8 months ago

jackgofff commented 8 months ago

I logged in side by side on both my localhost (Firebase successfully registering and configured in client/next-web/.env) and the realchar.ai site. Problem: cannot create characters on localhost

On my localhost: I am concurrently running the server via python cli.py run-uvicorn and client via cd client/next-web && npm install && npm run dev . When I try to create a character, I get these errors for /uploadfile (same applies to the /system_prompt, create_character, and upload_image ):

image Screenshot 2023-12-25 at 11 08 07 PM

--------- VS-----------

On the realchar.ai live site:

Creating character works without issue.

image image

💡initial ideas (?): - related to Request URL? ( http://127.0.0.0.1:8000/uploadfile vs https://api.realchar.ai/uploadfile) - Enviornment configurations / variables - Token refresh logic (see below)

One difference I see the token?key=.... row circled in red, both the Headers and the Payload:

image image
y1guo commented 8 months ago

Hi Jack, glad to help!

/uploadfile sends your file to a GCP storage bucket. To use it locally, you'll need to get your own GCP storage bucket, and configure it in .env. A google_credentials.json file is also needed to prove your admin. Put the file under root directory of repo, and also enable GOOGLE_APPLICATION_CREDENTIALS=google_credentials.json in .env. It should work.

jackgofff commented 8 months ago

Ty! I got it to work! A few questions: