開始ボタンを押してから、会話までに最初時間がかかる場合があります。 またMultimodal Live API の同時接続数制限が3なので、動かない場合はこちらになっている可能性があります。
-
Set your default Google Cloud project and region:
export PROJECT_ID="janjan-for-kids" gcloud auth login --update-adc gcloud config set project $PROJECT_ID gcloud auth application-default set-quota-project $PROJECT_ID
-
Install Dependencies: Install the required Python packages using Poetry:
poetry install
-
Run the Backend Server: Start the FastAPI server:
poetry run uvicorn app.server:app --host 0.0.0.0 --port 8000 --reload
-
Install Dependencies:
In a separate terminal, install the required Node.js packages for the frontend:
npm --prefix frontend install
-
Start the Frontend:
Launch the React development server:
npm --prefix frontend start
This command starts the frontend application, accessible at
http://localhost:3000.
You can quickly test the application in Cloud Run. Ensure your service account has the roles/aiplatform.user role to access Gemini.
-
Deploy:
export REGION="us-central1" gcloud run deploy janjan-for-kids \ --source . \ --project $PROJECT_ID \ --memory "4Gi" \ --region $REGION \ --port 8080
-
Access: Use Cloud Run proxy for local access. The backend will be accessible at
http://localhost:8000:gcloud run services proxy genai-app-sample --port 8000 --project $PROJECT_ID --region $REGION
You can then use the same frontend setup described above to interact with your Cloud Run deployment.