Skip to content

Commit

Permalink
Merge pull request openai#53 from openai/dev/atty/functions-updates
Browse files Browse the repository at this point in the history
Updates for function calling
  • Loading branch information
athyuttamre committed Jun 28, 2023
2 parents 8493692 + b716d8b commit 7e16a4f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,8 @@ components:
description: The role of the messages author. One of `system`, `user`, `assistant`, or `function`.
content:
type: string
description: The contents of the message. `content` is required for all messages except assistant messages with function calls.
nullable: true
description: The contents of the message. `content` is required for all messages, and may be null for assistant messages with function calls.
name:
type: string
description: The name of the author of this message. `name` is required if role is `function`, and it should be the name of the function whose response is in the `content`. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
Expand All @@ -1899,13 +1900,16 @@ components:
arguments:
type: string
description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
required:
required:
- name
- arguments
required:
- role
- content

ChatCompletionFunctionParameters:
type: object
description: The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
# TODO type this as json schema
description: "The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/gpt/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\n\nTo describe a function that accepts no parameters, provide the value `{\"type\": \"object\", \"properties\": {}}`."
additionalProperties: true

ChatCompletionFunctions:
Expand All @@ -1916,7 +1920,7 @@ components:
description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
description:
type: string
description: The description of what the function does.
description: A description of what the function does, used by the model to choose when and how to call the function.
parameters:
$ref: '#/components/schemas/ChatCompletionFunctionParameters'
required:
Expand Down Expand Up @@ -1978,7 +1982,7 @@ components:
oneOf:
- type: string
- type: string
enum: ["gpt-4","gpt-4-0613","gpt-4-32k","gpt-4-32k-0613","gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-3.5-turbo-0613","gpt-3.5-turbo-16k-0613"]
enum: ["gpt-4","gpt-4-0314","gpt-4-0613","gpt-4-32k","gpt-4-32k-0314","gpt-4-32k-0613","gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-3.5-turbo-0301","gpt-3.5-turbo-0613","gpt-3.5-turbo-16k-0613"]
messages:
description: A list of messages comprising the conversation so far. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb).
type: array
Expand Down

0 comments on commit 7e16a4f

Please sign in to comment.