openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

getting a failure when running the search example - https://beta.openai.com/docs/guides/search

Open shlumper opened this issue 3 years ago • 3 comments

when running the Search.create call I am getting a failure

openai.Search.create( model="ada", query="happy", max_rerank=5, file="file-xVMG7P66WxKS1zwzEBKUGGzl" )

here is the failure:

InvalidRequestError Traceback (most recent call last) in ----> 1 openai.Search.create( 2 model="ada", 3 query="happy", 4 max_rerank=5, 5 file="file-xVMG7P66WxKS1zwzEBKUGGzl"

4 frames /usr/local/lib/python3.8/dist-packages/openai/api_requestor.py in _interpret_response_line(self, rbody, rcode, rheaders, stream) 427 stream_error = stream and "error" in resp.data 428 if stream_error or not 200 <= rcode < 300: --> 429 raise self.handle_error_response( 430 rbody, rcode, resp.data, rheaders, stream_error=stream_error 431 )

InvalidRequestError: Invalid URL (POST /v1/search)

shlumper avatar Dec 23 '22 13:12 shlumper

Hi @shlumper! That looks like the correct behavior at this time. The search, answers, and classifications endpoints were recently removed. I hadn't yet pulled them from this repo but will do so after the holidays to make this clearer

hallacy avatar Dec 23 '22 16:12 hallacy

thanks!! of so what is the endpoint I shell use for searching?

also need some kind of consulting of my specific usecase. Who would be the right person to ask?

thanks Mushon(Shlumper)

its-mushon avatar Dec 23 '22 17:12 its-mushon

Good question. We recommend a number of strategies here: https://github.com/openai/openai-cookbook/tree/main/transition_guides_for_deprecated_API_endpoints. Which one you pick will depend a lot on your use case.

As for consulting, I would suggest starting at help.openai.com and seeing if your question can be answered there. If not, you should be able to reach out to the support team from that site.

hallacy avatar Dec 23 '22 17:12 hallacy