I am having trouble finding a complete reference to:
client.chat.completions.create
I’ve found:
https://platform.openai.com/docs/guides/text-generation
https://platform.openai.com/docs/quickstart?context=python
https://cookbook.openai.com/examples/how_to_call_functions_with_chat_models
https://platform.openai.com/docs/api-reference
etc., but none has a complete description of the interface.
for example, I can do this:
def gpt_api_send_command(prompt, model=‘gpt-3.5-turbo’, max_lines=100):
client = OpenAI()
function_schema = {
“name”: “send_command”,
“description”: “Execute a command and return the output”,
“parameters”: {
“type”: “object”,
“properties”: {
“commandString”: {
“type”: “string”,
“description”: “The command to execute”
}
},
“required”: [“commandString”]
}
}messages = [ {"role": "user", "content": prompt}, ] print("About to make API call") response = client.chat.completions.create( model=model, messages=messages, functions=[function_schema], function_call={"name": "send_command", "arguments": json.dumps({"commandString": "some command"})} ) print("API call complete")
but I don’t see that anywhere in the docs. (I do see examples using tools as the input and functions within the tools ‘schema’, but I only found those in the cookbook, and nothing that implied only including functions, nor what the detailed options/implications happen to be, etc.)
It would be very helpful to have a complete reference for the completion interface. Does anyone know where to find something like that? If not, maybe a friendly developer at OpenAI or perhaps even some magnanimous member of the community might be so kind as to create something like that for us?
Thanks!