docs for input

This commit is contained in:
ishaan-jaff 2023-09-22 21:03:39 -07:00
parent a848c7b137
commit 254b0386c4

View file

@ -1,31 +1,29 @@
# Input Format
The Input params are **exactly the same** as the
<a href="https://platform.openai.com/docs/api-reference/chat/create" target="_blank" rel="noopener noreferrer">OpenAI Create chat completion</a>, and let you call Azure OpenAI, Anthropic, Cohere, Replicate, OpenRouter models in the same format.
In addition, liteLLM allows you to pass in the following **Optional** liteLLM args:
`force_timeout`, `azure`, `logger_fn`, `verbose`
The Input params are **exactly the same** as the <a href="https://platform.openai.com/docs/api-reference/chat/create" target="_blank" rel="noopener noreferrer">OpenAI Create chat completion</a>, and let you call 100+ models in the same format.
## Input - Request Body
# Request Body
**Required Fields**
### Required Fields
- `model`: *string* - ID of the model to use. Refer to the model endpoint compatibility table for details on which models work with the Chat API.
- `messages`: *array* - A list of messages comprising the conversation so far.
#### Properties of `messages`
*Note* - Each message in the array contains the following properties:
- `role`: *string* - The role of the message's author. Roles can be: system, user, assistant, or function.
- `content`: *string or null* - The contents of the message. It is required for all messages, but may be null for assistant messages with function calls.
- `name`: *string (optional)* - The name of the author of the message. It is required if the role is "function". The name should match the name of the function represented in the content. It can contain characters (a-z, A-Z, 0-9), and underscores, with a maximum length of 64 characters.
- `function_call`: *object (optional)* - The name and arguments of a function that should be called, as generated by the model.
- `role`: *string* - The role of the message's author. Roles can be: system, user, assistant, or function.
- `content`: *string or null* - The contents of the message. It is required for all messages, but may be null for assistant messages with function calls.
- `name`: *string (optional)* - The name of the author of the message. It is required if the role is "function". The name should match the name of the function represented in the content. It can contain characters (a-z, A-Z, 0-9), and underscores, with a maximum length of 64 characters.
- `function_call`: *object (optional)* - The name and arguments of a function that should be called, as generated by the model.
**Optional Fields**
### Optional Fields
- `functions`: *array* - A list of functions that the model may use to generate JSON inputs. Each function should have the following properties: