Skip to content

Commit 0ca3004

Browse files
authored
Merge pull request #5675 from t-kulmburg/yaml-maxStopWords
Feat: support maxStopWords model config option in yaml
2 parents 1e49e61 + 5f132ee commit 0ca3004

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

core/config/util.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export function addModel(
7777
model: model.model,
7878
apiKey: model.apiKey,
7979
apiBase: model.apiBase,
80+
maxStopWords: model.maxStopWords,
8081
defaultCompletionOptions: model.completionOptions,
8182
};
8283
if (model.systemMessage) {

core/control-plane/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const modelDescriptionSchema = z.object({
2626
apiKey: z.string().optional(),
2727
apiBase: z.string().optional(),
2828
contextLength: z.number().optional(),
29+
maxStopWords: z.number().optional(),
2930
template: z
3031
.enum([
3132
"llama2",

docs/docs/reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ chat, editing, and summarizing.
188188
not currently used.
189189
- `capabilities`: Array of strings denoting model capabilities, which will overwrite Continue's autodetection based on
190190
provider and model. Supported capabilities include `tool_use` and `image_input`.
191+
- `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists.
191192
- `promptTemplates`: Can be used to override the default prompt templates for different model roles. Valid values are
192193
`chat`, [`edit`](./customize/model-roles/edit.mdx#prompt-templating), [
193194
`apply`](./customize/model-roles/apply.mdx#prompt-templating) and [

packages/config-yaml/src/schemas/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const baseModelFields = {
117117
model: z.string(),
118118
apiKey: z.string().optional(),
119119
apiBase: z.string().optional(),
120+
maxStopWords: z.number().optional(),
120121
roles: modelRolesSchema.array().optional(),
121122
capabilities: modelCapabilitySchema.array().optional(),
122123
defaultCompletionOptions: completionOptionsSchema.optional(),

0 commit comments

Comments
 (0)