mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
fix: avoid flask backend error
This commit is contained in:
@ -476,11 +476,8 @@ class LLMGenerator:
|
||||
)
|
||||
|
||||
return {
|
||||
"variables": response.variables,
|
||||
**response.model_dump(),
|
||||
"code_language": language,
|
||||
"code": response.code,
|
||||
"outputs": response.outputs,
|
||||
"message": response.explanation,
|
||||
"error": "",
|
||||
}
|
||||
|
||||
@ -529,7 +526,7 @@ class LLMGenerator:
|
||||
)
|
||||
|
||||
prompt_messages: list[PromptMessage] = [
|
||||
SystemPromptMessage(content=system_prompt),
|
||||
UserPromptMessage(content=system_prompt),
|
||||
]
|
||||
|
||||
# Get model instance - use default if model_config not provided
|
||||
|
||||
@ -55,7 +55,7 @@ class CodeNodeStructuredOutput(BaseModel):
|
||||
outputs: list[CodeNodeOutputItem] = Field(
|
||||
description="Output variable definitions specifying name and type for each return value"
|
||||
)
|
||||
explanation: str = Field(description="Brief explanation of what the generated code does")
|
||||
message: str = Field(description="Brief explanation of what the generated code does")
|
||||
|
||||
|
||||
class InstructionModifyOutput(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user