Open peakji opened 1 year ago
Prompt templating is available in v4.34:
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.
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)