From 37f0e75268dfcc8aaba92e0839ef0d12fecd2277 Mon Sep 17 00:00:00 2001 From: Yazhou Cao Date: Fri, 22 Mar 2024 10:42:10 -0700 Subject: [PATCH] Remove keys --- vision_agent/tools/tools.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vision_agent/tools/tools.py b/vision_agent/tools/tools.py index 2d2e2a0b..120d45a0 100644 --- a/vision_agent/tools/tools.py +++ b/vision_agent/tools/tools.py @@ -1,9 +1,10 @@ import logging +import os import tempfile from abc import ABC +from collections import Counter as CounterClass from pathlib import Path from typing import Any, Dict, List, Tuple, Union, cast -from collections import Counter as CounterClass import numpy as np import requests @@ -343,9 +344,12 @@ def __call__(self, image: Union[str, Path]) -> List[str]: assert isinstance(image, str), "The input image must be a string url." image = "https://popmenucloud.com/cdn-cgi/image/width%3D1920%2Cheight%3D1920%2Cfit%3Dscale-down%2Cformat%3Dauto%2Cquality%3D60/vpylarnm/a6ad1671-8938-457f-b4cd-3215caa122cb.png" url = "https://www.googleapis.com/customsearch/v1" + api_key = os.getenv("GOOGLE_API_KEY") + search_engine_id = os.getenv("GOOGLE_SEARCH_ENGINE_ID") + assert api_key and search_engine_id, "Please set the GOOGLE_API_KEY and GOOGLE_SEARCH_ENGINE_ID environment variable. See https://developers.google.com/custom-search/v1/using_rest for more information." params = { - "key": "AIzaSyDy3UMHL1E3nFLTLdIQb3nyIU5-zhSfzPo", - "cx": "831f248aa2e1d4daf", + "key": api_key, + "cx": search_engine_id, "q": image, "num": 10, "searchType":"image",