dify/api/core
Ganondorf a147d2a200
feat(api): use `json_repair` to fix invalid json while generating structured output (#18977)
When generating JSON schema using an LLM in the structured output feature,
models may occasionally return invalid JSON, which prevents clients from correctly 
parsing the response and can lead to UI breakage.

This commit addresses the issue by introducing `json_repair` to automatically 
fix invalid JSON strings returned by the LLM, ensuring smoother functionality 
and better client-side handling of structured outputs.


Co-authored-by: lizb <lizb@sugon.com>
2025-04-29 12:39:13 +08:00
..
agent refactor: rename plugin manager to plugin client and rename path from manager to impl (#18876) 2025-04-27 14:22:25 +08:00
app fix(workflow_cycle_manage): failed nodes were not updated in workflow_node_executions (#18994) 2025-04-29 10:31:08 +08:00
callback_handler fix retrival resource miss in chatflow (#18307) 2025-04-17 18:05:15 +08:00
entities fix: #18744 The model order defined in position.yaml in the Model Plugin is not taking effect. (#18756) 2025-04-25 16:45:48 +08:00
errors fix(core/errors): change base class of custom exceptions to ValueError (#11955) 2024-12-22 10:41:34 +08:00
extension feat: mypy for all type check (#10921) 2024-12-24 18:38:51 +08:00
external_data_tool chore(lint): fix quotes for f-string formatting by bumping ruff to 0.9.x (#12702) 2025-01-21 10:12:29 +08:00
file fix: Update prompt message content types to use Literal and add union type for content (#17136) 2025-04-22 16:17:55 +08:00
helper Http requests node add ssl verify (#18125) 2025-04-16 15:59:34 +08:00
llm_generator feat(api): use `json_repair` to fix invalid json while generating structured output (#18977) 2025-04-29 12:39:13 +08:00
memory fix: Update prompt message content types to use Literal and add union type for content (#17136) 2025-04-22 16:17:55 +08:00
model_runtime refactor: rename plugin manager to plugin client and rename path from manager to impl (#18876) 2025-04-27 14:22:25 +08:00
moderation issue: #17056 : Add a reason field to the message_replace event (#17195) 2025-04-25 10:08:06 +08:00
ops refactor: Refactors repository imports structure (#18901) 2025-04-27 17:29:03 +08:00
plugin refactor(plugin/backwards_invocation/app): Remove unnecessary .value from StrEnum (#18896) 2025-04-28 14:50:59 +08:00
prompt fix: Update prompt message content types to use Literal and add union type for content (#17136) 2025-04-22 16:17:55 +08:00
rag fix depth param issue for WaterCrawl (#18839) 2025-04-27 11:04:56 +08:00
repositories refactor: Refactors repository imports structure (#18901) 2025-04-27 17:29:03 +08:00
tools fix: when cot_agent call tool like searxng lost some response content (#16781) 2025-04-28 09:27:46 +08:00
variables fix Unicode Escape Characters (#15318) 2025-03-10 09:22:41 +08:00
workflow remove unstructured api key check (#18989) 2025-04-28 17:26:30 +08:00
__init__.py chore(api/core): apply ruff reformatting (#7624) 2024-09-10 17:00:20 +08:00
hosting_configuration.py chore(provider_manager): Update hosted model's name (#14334) 2025-02-25 18:47:33 +08:00
indexing_runner.py fix full-doc mode document doesn't reindex after enable or un_archive (#16737) 2025-03-25 16:26:14 +08:00
model_manager.py feat: re-add prompt messages to result and chunks in llm (#17883) 2025-04-11 17:04:49 +08:00
provider_manager.py fix: perferred model provider not match with provider. (#18282) 2025-04-17 15:44:00 +08:00