Has anyone encountered the issue where including multiple domains using the API returns irrelevant results, while using a single domain returns the correct result?
Hello there,
Thank you for reaching out.
When using the include_domains
parameter, please make sure to call it like this:
from tavily import TavilyClient
tavily_client = TavilyClient(api_key='TAVILY_API_KEY')
query = "AI-powered tools for business automation"
include_domains = ["wikipedia.org", "nytimes.com"]
response = tavily_client.search(query, include_domains=include_domains)
This ensures that the domains are passed correctly as a list of strings. Let me know if you’re still experiencing issues after making this adjustment!
Best,
May
Thanks for your response. Yes, that’s how I call the API. When I call it with only one domain, it returns results with a relevance score greater than 0.8:
include_domains = ["wikipedia.org"]
However, when I call it with multiple domains, it returns results with a relevance score less than 0.2:
include_domains = ["wikipedia.org", "nytimes.com", "bbc.com", ...]
Is there a way to force the response to only include results with a relevance score of 0.8 or above?
Hi! Could you share an example of the query and response you’re getting? This will help us better understand the issue.
Regarding your question about forcing the response to include results with a relevance score of 0.8 or above, this would need to be handled on your side, as the threshold for filtering results may vary depending on the use case. That said, we’re currently reviewing our scoring system to ensure relevance scores remain consistent and reliable, and we’ll make sure to address multiple domain use cases as well.