Merge branch 'main' into feat/dify-builder

This commit is contained in:
twwu committed 2026-09-17 17:01:34 +08:00
commit 782688563d
266 files changed
+9891 -3597

No files matched your search

+1 -1
View File
@@ -115,7 +115,7 @@ class DatasourceManager:
"""
get the datasource runtime
:param provider_type: the type of the provider
:param datasource_type: the type of the datasource
:param provider_id: the id of the provider
:param datasource_name: the name of the datasource
:param tenant_id: the tenant id
@@ -93,7 +93,7 @@ class DatasourceParameter(PluginParameter):
:param required: if the parameter is required
:param options: the options of the parameter
"""
# convert options to ToolParameterOption
# convert options to PluginParameterOption
# FIXME fix the type error
if options:
option_objs = [
+3 -1
View File
@@ -64,7 +64,9 @@ class TokenBufferMemory:
"""
match self.conversation.mode:
case AppMode.AGENT_CHAT | AppMode.COMPLETION | AppMode.CHAT:
file_extra_config = FileUploadConfigManager.convert(self.conversation.model_config)
file_extra_config = FileUploadConfigManager.convert(
self.conversation.model_config_with_session(session=db.session())
)
case AppMode.ADVANCED_CHAT | AppMode.WORKFLOW:
app = self.conversation.app
if not app:
+1 -1
View File
@@ -1188,7 +1188,7 @@ class TraceTask:
dataset_retrieval_trace_info = DatasetRetrievalTraceInfo(
trace_id=self.trace_id,
message_id=message_id,
inputs=message_data.query or message_data.inputs,
inputs=message_data.query or message_data.inputs_with_session(session=db.session()),
documents=doc_list,
start_time=timer.get("start"),
end_time=timer.get("end"),
+4 -1
View File
@@ -281,7 +281,10 @@ class PluginAppBackwardsInvocation(BaseBackwardsInvocation):
@classmethod
def _get_workflow(cls, app: App) -> Workflow | None:
"""
get workflow without relying on App.workflow's request-scoped session property
get workflow with an owned session, additionally scoped by tenant and app
`App.workflow_with_session` resolves by `workflow_id` alone; a plugin
invocation must also confirm the workflow belongs to this tenant and app.
"""
if not app.workflow_id:
return None
+5 -3
View File
@@ -83,10 +83,12 @@ class ExtractProcessor:
suffix = Path(url).suffix
if not suffix and suffix != ".":
# get content-type
if response.headers.get("Content-Type"):
suffix = "." + response.headers.get("Content-Type").split("/")[-1]
content_type = response.headers.get("Content-Type")
if content_type:
# strip parameters such as "; charset=utf-8" before using the subtype as suffix
suffix = "." + content_type.split(";")[0].strip().split("/")[-1]
else:
content_disposition = response.headers.get("Content-Disposition")
content_disposition = response.headers.get("Content-Disposition", "")
filename_match = re.search(r'filename="([^"]+)"', content_disposition)
if filename_match:
filename = unquote(filename_match.group(1))