agent: fix tools setup

This commit is contained in:
Olivier Chafik 2024-10-25 02:00:47 +01:00
parent 5c414a3335
commit 30bd00bcf7
2 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,8 @@ FROM python:3.12-slim
RUN python -m pip install --upgrade pip && \
apt clean cache
COPY requirements.txt tools/*.py /root/
COPY requirements.txt /root/
COPY tools /root/tools
WORKDIR /root
RUN pip install -r requirements.txt

View File

@ -70,6 +70,7 @@ async def brave_search(*, query: str) -> List[Dict]:
if not response.ok:
raise Exception(response.text)
response.raise_for_status()
results = list(itertools.islice(extract_results(response.json()), max_results))
print(json.dumps(dict(query=query, response=response, results=results), indent=2))
response_json = response.json()
results = list(itertools.islice(extract_results(response_json), max_results))
print(json.dumps(dict(query=query, response=response_json, results=results), indent=2))
return results