Merge pull request #5236 from mq200/feat/yaml_support_template
add standalone template parameter in yaml model config
This commit is contained in:
commit
9223acee1a
3 changed files with 23 additions and 1 deletions
|
|
@ -60,6 +60,7 @@ async function modelConfigToBaseLLM({
|
|||
logger: llmLogger,
|
||||
uniqueId,
|
||||
title: model.name,
|
||||
template: model.promptTemplates?.chatTemplate,
|
||||
promptTemplates: model.promptTemplates,
|
||||
baseChatSystemMessage: model.chatOptions?.baseSystemMessage,
|
||||
capabilities: {
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ The `models` section defines the language models used in your configuration. Mod
|
|||
- `apiBase`: Can be used to override the default API base that is specified per model
|
||||
- `roles`: An array specifying the roles this model can fulfill, such as `chat`, `autocomplete`, `embed`, `rerank`, `edit`, `apply`, `summarize`. The default value is `[chat, edit, apply, summarize]`. Note that the `summarize` role is not currently used.
|
||||
- `capabilities`: Array of strings denoting model capabilities, which will overwrite Continue's autodetection based on provider and model. Supported capabilities include `tool_use` and `image_input`.
|
||||
- `promptTemplates`: Can be used to override the default prompt templates for different model roles. Valid values are [`edit`](./customize/model-roles/edit.mdx#prompt-templating), [`apply`](./customize/model-roles/apply.mdx#prompt-templating) and [autocomplete](./customize/model-roles/autocomplete.md#prompt-templating)
|
||||
- `promptTemplates`: Can be used to override the default prompt templates for different model roles. Valid values are `chatTemplate`, [`edit`](./customize/model-roles/edit.mdx#prompt-templating), [`apply`](./customize/model-roles/apply.mdx#prompt-templating) and [`autocomplete`](./customize/model-roles/autocomplete.md#prompt-templating). The `chatTemplate` property must be a valid template name, such as `llama3` or `anthropic`.
|
||||
- `chatOptions`: If the model includes role `chat`, these settings apply for Chat and Agent mode:
|
||||
- `baseSystemMessage`: Can be used to override the default system prompt.
|
||||
- `embedOptions`: If the model includes role `embed`, these settings apply for embeddings:
|
||||
|
|
|
|||
|
|
@ -69,9 +69,30 @@ export const chatOptionsSchema = z.object({
|
|||
});
|
||||
export type ChatOptions = z.infer<typeof chatOptionsSchema>;
|
||||
|
||||
const templateSchema = z.enum([
|
||||
"llama2",
|
||||
"alpaca",
|
||||
"zephyr",
|
||||
"phi2",
|
||||
"phind",
|
||||
"anthropic",
|
||||
"chatml",
|
||||
"none",
|
||||
"openchat",
|
||||
"deepseek",
|
||||
"xwin-coder",
|
||||
"neural-chat",
|
||||
"codellama-70b",
|
||||
"llava",
|
||||
"gemma",
|
||||
"granite",
|
||||
"llama3",
|
||||
]);
|
||||
|
||||
/** Prompt templates use Handlebars syntax */
|
||||
const promptTemplatesSchema = z.object({
|
||||
apply: z.string().optional(),
|
||||
chatTemplate: templateSchema.optional(),
|
||||
edit: z.string().optional(),
|
||||
autocomplete: z.string().optional()
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue