GPTCache
GPTCache copied to clipboard
[Feature]: Support more configs for openAI models
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
- max_tokens? just bypass to GPT for now
- temperature: there are couple things we can do,
- randomly pick answer from returned result if they are all very similar.
- edit the answer with another small model:For instance image -> https://huggingface.co/lambdalabs/sd-image-variations-diffusers
- n -> if there no enough cached result, we will need to generate from OpenAI anyway.
- 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
working on temperature
Will function_call="auto"
in openai.ChatCompletion.create(...)
be supported?
@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.