You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Regardless of whether the last role in messages is user or assistant, the response will always be assistant.
When steam=true, the first returned event will always be {"role": "assistant"}.
When steam=true, the specific finish_reason will be yielded as a separate event.
Compatibility
Parameter
Basaran
OpenAI
Default Value
Maximum Value
model
○
●
-
-
messages
●
●
[]
CHAT_MAX_PROMPT
min_tokens
●
○
0
CHAT_MAX_TOKENS
max_tokens
●
●
512
CHAT_MAX_TOKENS
temperature
●
●
1.0
-
top_p
●
●
1.0
-
n
●
●
1
CHAT_MAX_N
stream
●
●
false
-
stop
○
●
-
-
presence_penalty
○
●
-
-
frequency_penalty
○
●
-
-
logit_bias
○
●
-
-
user
○
●
-
-
Examples
Chat completion (n=1, stream=false)
{
"id": "chatcmpl-6z5sqEUkSdUyWqsNFRyyJ1s7kCzpM",
"object": "chat.completion",
"created": 1680018644,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 14,
"total_tokens": 26
},
"choices": [
{
"message": {
"role": "assistant",
"content": "I was created by a team of developers and engineers at OpenAI."
},
"finish_reason": "stop",
"index": 0
}
]
}
Chat completion (n=2, stream=false)
{
"id": "chatcmpl-6z5sOxJ318FNEWVkDsRbsZPS7wexL",
"object": "chat.completion",
"created": 1680018616,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 34,
"total_tokens": 46
},
"choices": [
{
"message": {
"role": "assistant",
"content": "I was created by a team of developers at OpenAI."
},
"finish_reason": "stop",
"index": 0
},
{
"message": {
"role": "assistant",
"content": "I was created by a team of developers at OpenAI, using advanced artificial intelligence and natural language processing technologies."
},
"finish_reason": "stop",
"index": 1
}
]
}
We've added a new template feature for chat models. This allows the formatting that a chat model was trained with to be saved with the model, ensuring that users can exactly reproduce that formatting when they want to fine-tune the model or use it for inference. For more information, see our template documentation.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Checklist
messages
isuser
orassistant
, the response will always beassistant
.steam=true
, the first returned event will always be{"role": "assistant"}
.steam=true
, the specificfinish_reason
will be yielded as a separate event.Compatibility
model
messages
[]
CHAT_MAX_PROMPT
min_tokens
0
CHAT_MAX_TOKENS
max_tokens
512
CHAT_MAX_TOKENS
temperature
1.0
top_p
1.0
n
1
CHAT_MAX_N
stream
false
stop
presence_penalty
frequency_penalty
logit_bias
user
Examples
Chat completion (n=1, stream=false)
Chat completion (n=2, stream=false)
Chat completion (n=1, stream=true)
Chat completion (n=2, stream=true)
Text completion (n=1, stream=false)
The text was updated successfully, but these errors were encountered: