Feat: allow maxStopWords model config option in yaml

This commit is contained in:
Tobias Kulmburg 2025-05-14 22:13:09 +02:00
parent 07636c8e85
commit 1f31554ea6
4 changed files with 5 additions and 1 deletions

View file

@ -77,6 +77,7 @@ export function addModel(
model: model.model,
apiKey: model.apiKey,
apiBase: model.apiBase,
maxStopWords: model.maxStopWords,
defaultCompletionOptions: model.completionOptions,
};
if (model.systemMessage) {

View file

@ -26,6 +26,7 @@ const modelDescriptionSchema = z.object({
apiKey: z.string().optional(),
apiBase: z.string().optional(),
contextLength: z.number().optional(),
maxStopWords: z.number().optional(),
template: z
.enum([
"llama2",

View file

@ -188,6 +188,7 @@ chat, editing, and summarizing.
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`.
- `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists.
- `promptTemplates`: Can be used to override the default prompt templates for different model roles. Valid values are
`chat`, [`edit`](./customize/model-roles/edit.mdx#prompt-templating), [
`apply`](./customize/model-roles/apply.mdx#prompt-templating) and [

View file

@ -107,7 +107,7 @@ const templateSchema = z.enum([
const promptTemplatesSchema = z.object({
apply: z.string().optional(),
chat: templateSchema.optional(),
edit: z.string().optional(),
edit: z.string().optional(),
autocomplete: z.string().optional(),
});
export type PromptTemplates = z.infer<typeof promptTemplatesSchema>;
@ -117,6 +117,7 @@ const baseModelFields = {
model: z.string(),
apiKey: z.string().optional(),
apiBase: z.string().optional(),
maxStopWords: z.number().optional(),
roles: modelRolesSchema.array().optional(),
capabilities: modelCapabilitySchema.array().optional(),
defaultCompletionOptions: completionOptionsSchema.optional(),