farizrahman4u / loopgpt

Modular Auto-GPT Framework
MIT License
1.43k stars 131 forks source link

Google Search Failed with Error #61

Open OliverOffing opened 1 month ago

OliverOffing commented 1 month ago

Please check that this issue hasn't been reported before.

Expected Behavior

Google search should return search results

Current behaviour

Google search failed with error: <HttpError 400 when requesting https://customsearch.googleapis.com/customsearch/v1?q=latest+btc+price&num=8&start=1&key=AIzaSyAntxjXqFKmJf0l7zCU7fsl7TmtqWgJk1k+&alt=json returned "Request contains an invalid argument.". Details: "[{'message': 'Request contains an invalid argument.', 'domain': 'global', 'reason': 'badRequest'}]"> Trying DuckDuckGo search instead...

Steps to reproduce

  1. Set up CUSTOM_SEARCH_ENGINE_ID and GOOGLE_API_KEY
  2. Ask the AI agent search for something

Possible solution

It seems we need to update some library perhaps. Ultimately it feels like we need to move away from requirements.txt into something like pdm which uses a lockfile. Or at least the very least set up specific versions in requirements.txt.

Which Operating Systems are you using?

Python Version

LoopGPT Version

latest

Acknowledgements

OliverOffing commented 1 month ago

Btw, the current Dockerfile wasn't building for me, so I'm using this one:

diff --git i/Dockerfile w/Dockerfile
index 58d889f..6bfe067 100644
--- i/Dockerfile
+++ w/Dockerfile
@@ -1,20 +1,27 @@
 # Use an official Python base image from the Docker Hub
-FROM python:3-alpine AS loopgpt-base
-
-# Install browsers
-RUN apk update && apk add --no-cache \
-    firefox \
-    ca-certificates
-
-# Install utilities
-RUN apk add --no-cache curl jq wget git gcc g++ libc-dev bash
+FROM python:3.10-slim AS loopgpt-base
+
+# Install browsers and utilities
+RUN apt-get update && apt-get install -y --no-install-recommends \
+    firefox-esr \
+    ca-certificates \
+    curl \
+    jq \
+    wget \
+    git \
+    gcc \
+    g++ \
+    libc-dev \
+    bash && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/*

 # Set environment variables
 ENV PIP_NO_CACHE_DIR=yes \
     PYTHONUNBUFFERED=1 \
     PYTHONDONTWRITEBYTECODE=1

-RUN adduser -D -g gpt -s /bin/bash gpt
+RUN adduser --disabled-password --gecos "" gpt

 WORKDIR /app
 COPY requirements.txt setup.py ./