Describe the Bug
First: it is unclear if the date format should be ‘mm-dd-yyyy’, as described in the reference API, or ‘mm/dd/yyyy’. On one occasion, using ‘mm=dd-yyyy’ gave a format error only when I used one of them (either search_before or search_after), whereas if I set both (time interval), there was no error.
Second: whatever you do, the filter by date seems to be ignored, and I tried with search_mode set to ‘academic’ or ‘web’.
Using last_updated_before/after didn’t help, these seem to be ignored as well.
Expected Behavior
I expect the response.search_results to have results in the desired date range.
Actual Behavior
The search_before/after and/or last_updated_before/after have no effect on the search results
Steps to Reproduce
-
response = client.chat.completions.create(
model=model, # A powerful model with web-search capabilities max_tokens=16384, messages=messages, temperature=0.2, response_format=response_format, search_before_date_filter="01/01/2020", last_updated_before_filter="01/01/2020", search_domain_filter=domain_filter_2, web_search_options={"search_context_size": "high"}, search_mode="web")
-
Check response.search_results
API Request & Response (if applicable)
Environment
- API Version: [e.g., sonar-3.1]
- SDK (if applicable): [e.g., Python SDK v0.5]
- Operating System: [e.g., MacOS, Linux, Windows]
Logs or Screenshots (if applicable)
Add any logs or screenshots that can help debug the issue.
Additional Context
Add any other context about the problem here.