Fix JSON Schema export

This commit is contained in:
kwaroran
2024-09-11 23:05:31 +09:00
parent 86ab84a1a0
commit c6b70260cc

View File

@@ -998,6 +998,10 @@ export interface botPreset{
top_k?:number
instructChatTemplate?:string
JinjaTemplate?:string
jsonSchemaEnabled?:boolean
jsonSchema?:string
strictJsonSchema?:boolean
extractJson?:string
}
@@ -1282,7 +1286,11 @@ export function saveCurrentPreset(){
moduleIntergration: db.moduleIntergration ?? "",
top_k: db.top_k,
instructChatTemplate: db.instructChatTemplate,
JinjaTemplate: db.JinjaTemplate ?? ''
JinjaTemplate: db.JinjaTemplate ?? '',
jsonSchemaEnabled:db.jsonSchemaEnabled??false,
jsonSchema:db.jsonSchema ?? '',
strictJsonSchema:db.strictJsonSchema ?? true,
extractJson:db.extractJson ?? '',
}
db.botPresets = pres
setDatabase(db)
@@ -1371,6 +1379,10 @@ export function setPreset(db:Database, newPres: botPreset){
db.top_k = newPres.top_k ?? db.top_k
db.instructChatTemplate = newPres.instructChatTemplate ?? db.instructChatTemplate
db.JinjaTemplate = newPres.JinjaTemplate ?? db.JinjaTemplate
db.jsonSchemaEnabled = newPres.jsonSchemaEnabled ?? false
db.jsonSchema = newPres.jsonSchema ?? ''
db.strictJsonSchema = newPres.strictJsonSchema ?? true
db.extractJson = newPres.extractJson ?? ''
return db
}