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

openai.Completion.retrieve()

Open hend41234 opened this issue 1 year ago • 1 comments

Describe the bug

EngineAPIResource.init() takes from 1 to 2 positional arguments but 3 were given

To Reproduce

does this only happen to me when using 'retrieve' in openai. i got this error : "EngineAPIResource.init() takes from 1 to 2 positional arguments but 3 are given"

Code snippets

key = "my_api_key"
openai.api_key=key
id_chat = "my_completion_id"
try:
    result = openai.Completion.retrieve(id_chat)
    print(result['choices'][0]['text'])
except Exception as a:
    print(a)

OS

arch linux

Python version

Python 3.10.9

Library version

openai-python v0.26.5

hend41234 avatar Feb 28 '23 14:02 hend41234

openai currently does not support retrieving past completions, you should save and manage completion responses client-side.

tanpinxi avatar Mar 01 '23 07:03 tanpinxi

^ is correct. There is no way to retrieve past completions with the API

hallacy avatar Mar 07 '23 03:03 hallacy

Will there be support in subsequent versions? I feel openai.Completion.retrieve() is still necessary .

gnehcgnaw avatar Mar 29 '23 09:03 gnehcgnaw