feat: llm support struct output (#17994)

Co-authored-by: twwu <twwu@dify.ai>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
This commit is contained in:
Joel 2025-04-18 16:53:43 +08:00 • committed by GitHub
commit 775dc47abe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
82 changed files with 4190 additions and 276 deletions

View file

@ -180,6 +180,17 @@ const translation = {
noParams: 'No parameters needed',
},
showMyCreatedAppsOnly: 'Created by me',
structOutput: {
moreFillTip: 'Showing max 10 levels of nesting',
required: 'Required',
LLMResponse: 'LLM Response',
configure: 'Configure',
notConfiguredTip: 'Structured output has not been configured yet',
structured: 'Structured',
structuredTip: 'Structured Outputs is a feature that ensures the model will always generate responses that adhere to your supplied JSON Schema',
modelNotSupported: 'Model not supported',
modelNotSupportedTip: 'The current model does not support this feature and is automatically downgraded to prompt injection.',
},
}
export default translation

View file

@ -56,6 +56,7 @@ const translation = {
regenerate: 'Regenerate',
submit: 'Submit',
skip: 'Skip',
format: 'Format',
},
errorMsg: {
fieldRequired: '{{field}} is required',

View file

@ -423,6 +423,34 @@ const translation = {
variable: 'Variable',
},
sysQueryInUser: 'sys.query in user message is required',
jsonSchema: {
title: 'Structured Output Schema',
instruction: 'Instruction',
promptTooltip: 'Convert the text description into a standardized JSON Schema structure.',
promptPlaceholder: 'Describe your JSON Schema...',
generate: 'Generate',
import: 'Import from JSON',
generateJsonSchema: 'Generate JSON Schema',
generationTip: 'You can use natural language to quickly create a JSON Schema.',
generating: 'Generating JSON Schema...',
generatedResult: 'Generated Result',
resultTip: 'Here is the generated result. If you\'re not satisfied, you can go back and modify your prompt.',
back: 'Back',
regenerate: 'Regenerate',
apply: 'Apply',
doc: 'Learn more about structured output',
resetDefaults: 'Reset',
required: 'required',
addField: 'Add Field',
addChildField: 'Add Child Field',
showAdvancedOptions: 'Show advanced options',
stringValidations: 'String Validations',
fieldNamePlaceholder: 'Field Name',
descriptionPlaceholder: 'Add description',
warningTips: {
saveSchema: 'Please finish editing the current field before saving the schema',
},
},
},
knowledgeRetrieval: {
queryVariable: 'Query Variable',