!pip install tavily-python
from tavily import TavilyClient
tavily = TavilyClient(api_key="my key")
response = tavily.search(query="my query")
context = [{"url": obj["url"], "content": obj["content"]} for obj in response.results]
the API returns response, but the code to find the results is broken. my guess is that the output structure of the API was changed without updating the documentation, see the error:
----> [8](vscode-notebook-cell:/my/path/tavily-api-test.ipynb#W1sZmlsZQ%3D%3D?line=7) context = [{"url": obj["url"], "content": obj["content"]} for obj in response.results]
AttributeError: 'dict' object has no attribute 'results'
Hi I am testing out the API via your demo code: https://docs.tavily.com/docs/tavily-api/python-sdk
i didn't make it very far:
the API returns
response
, but the code to find theresults
is broken. my guess is that the output structure of the API was changed without updating the documentation, see the error:@assafelovic please advise