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

Repeating Instruction Examples

Open athn-nik opened this issue 1 year ago • 5 comments

Is there a way if I want to query a model for a similar question + set of instruction to avoid passing the instruction every time? eg.

prompt = ['which categories does this <thing> fall in from the list below?\n - fruit \n -vegetable \n etc.']
response = openai.Completion.create(model="text-davinci-003",
                                            prompt=prompt,
                                            temperature=0.0,
                                            max_tokens=256,
                                            top_p=1,
                                            frequency_penalty=0,
                                            presence_penalty=0
                                            )

I want to ask this question for a lot of different <things>, and avoid being billed every time for the same words & instructions.

athn-nik avatar Feb 07 '23 00:02 athn-nik