Skip to content

Commit

Permalink
agent: fix tools setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik committed Oct 25, 2024
1 parent 5c414a3 commit 30bd00b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/agent/Dockerfile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions examples/agent/tools/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def extract_results(search_response):
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

0 comments on commit 30bd00b

Please sign in to comment.