gpt-newspaper icon indicating copy to clipboard operation
gpt-newspaper copied to clipboard

400 Client Error: Bad Request for url: https://api.tavily.com/search

Open robertcedwards opened this issue 1 year ago • 8 comments

Just cloned and started the creation process, get that error and it hangs. MacOS: 14.2.1 (23C71) Python3.9

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.tavily.com/search 127.0.0.1 - - [25/Jan/2024 11:03:57] "POST /generate_newspaper HTTP/1.1" 500 -

robertcedwards avatar Jan 25 '24 17:01 robertcedwards

Hi @robertcedwards just shooting in the dark, was one of your topics les then 4 characters? I will need to fix it on our end in the news api, but as for now tavily take a minimum of 4 chars.

rotemweiss57 avatar Jan 25 '24 18:01 rotemweiss57

Interesting, just Web3 was a 4-char. Let me make sure I properly exported the API keys too, but I think it already made an auth'd call.

robertcedwards avatar Jan 25 '24 23:01 robertcedwards

perfect. lmk know it works with greater than 4 char topics and I'll update you once fixed.

rotemweiss57 avatar Jan 25 '24 23:01 rotemweiss57

I tried it with just a single topic that had more chars and it worked. Thanks for the help and persistence!

robertcedwards avatar Jan 25 '24 23:01 robertcedwards

Also, running into some rate limits, not sure if there are some error handling issues here, don't think it will try again.

File "/Users/robertedwards/Documents/Projects/gpt-newspaper/gpt-newspaper/lib/python3.9/site-packages/openai/_base_client.py", line 959, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'message': 'Rate limit reached for gpt-4 in organization org-4do9SrRAEt8fzaKFeoFMaM1A on tokens per min (TPM): Limit 10000, Used 9979, Requested 2920. Please try again in 17.394s. Visit https://platform.openai.com/account/rate-limits to learn more.', 'type': 'tokens', 'param': None, 'code': 'rate_limit_exceeded'}}

robertcedwards avatar Jan 26 '24 00:01 robertcedwards

I've seen this error as well, confirmed the cause is the chinese characters: image

had some web search, have not get solution yet.

shaojun avatar Jan 26 '24 08:01 shaojun

I got the same error. I had 3 words in the search. 2 with 6 letters and 1 with 4. None of them had any special characters. Removing the word with 4 letters resolved it.

badcom avatar Jan 26 '24 13:01 badcom

I got a similar error. After double checked api keys and restarted my computer, everything is fine.

flyspirit99 avatar Feb 03 '24 23:02 flyspirit99