GPTCache icon indicating copy to clipboard operation
GPTCache copied to clipboard

[Feature]: Support more configs for openAI models

Open xiaofan-luan opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

Due to the document of openAI, we missed some major parameters of openAI document, see:

https://platform.openai.com/docs/api-reference/completions/create

  1. max_tokens? just bypass to GPT for now
  2. temperature: there are couple things we can do,
    1. randomly pick answer from returned result if they are all very similar.
    2. edit the answer with another small model:For instance image -> https://huggingface.co/lambdalabs/sd-image-variations-diffusers
  3. n -> if there no enough cached result, we will need to generate from OpenAI anyway.
  4. bestof -> control the topk numbers we want to retrieved from cache

Describe the solution you'd like.

No response

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

xiaofan-luan avatar Apr 18 '23 22:04 xiaofan-luan

working on temperature

jaelgu avatar Apr 25 '23 08:04 jaelgu

Will function_call="auto" in openai.ChatCompletion.create(...) be supported?

tmquan avatar Aug 01 '23 09:08 tmquan

@tmquan I haven't had time to experiment with this feature yet. But I'm a little confused, according to openai's definition of function_call: "auto":

Note that the default behavior (function_call: "auto") is for the model to decide on its own whether to call a function and if so which function to call.

If the question is asking about the weather, the answers obtained should be inconsistent every day. That is to say, if the result of the function execution will continue to change, it seems that the cache is meaningless. If the execution result of the function remains unchanged, then this parameter does not seem to require any additional processing, and the current cahce seems to work normally.

Not sure what other thoughts you have on this parameter.

SimFG avatar Aug 01 '23 09:08 SimFG