chore: code format

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN-
2025-09-08 14:25:33 +08:00
parent 165cd0d272
commit 719edb3707
6 changed files with 6 additions and 9 deletions

View File

@ -14,7 +14,6 @@ from sqlalchemy.exc import SQLAlchemyError
from configs import dify_config
from constants.languages import languages
from core.helper import encrypter
from core.plugin.entities.plugin import PluginInstallationSource
from core.plugin.impl.plugin import PluginInstaller
from core.rag.datasource.vdb.vector_factory import Vector
from core.rag.datasource.vdb.vector_type import VectorType
@ -1494,7 +1493,7 @@ def transform_datasource_credentials():
for credential in credentials:
auth_count += 1
# get credential api key
credentials_json =json.loads(credential.credentials)
credentials_json = json.loads(credential.credentials)
api_key = credentials_json.get("config", {}).get("api_key")
base_url = credentials_json.get("config", {}).get("base_url")
new_credentials = {

View File

@ -30,8 +30,6 @@ class FakeDatasourceRuntime(DatasourceRuntime):
"""
def __init__(self):
super().__init__(
tenant_id="fake_tenant_id",
datasource_id="fake_datasource_id",

View File

@ -1,5 +1,5 @@
from collections.abc import Sequence
from typing import Annotated, Any, TypeAlias, cast
from typing import Annotated, Any, TypeAlias
from uuid import uuid4
from pydantic import BaseModel, Discriminator, Field, Tag

View File

@ -184,7 +184,6 @@ class KnowledgeIndexNode(Node):
def version(cls) -> str:
return "1"
def get_streaming_template(self) -> Template:
"""
Get the template for streaming.
@ -192,4 +191,4 @@ class KnowledgeIndexNode(Node):
Returns:
Template instance for this knowledge index node
"""
return Template(segments=[])
return Template(segments=[])

View File

@ -2643,7 +2643,9 @@ class SegmentService:
return segment_data_list
@classmethod
def update_segment(cls, args: SegmentUpdateArgs, segment: DocumentSegment, document: Document, dataset: Dataset) -> DocumentSegment:
def update_segment(
cls, args: SegmentUpdateArgs, segment: DocumentSegment, document: Document, dataset: Dataset
) -> DocumentSegment:
assert isinstance(current_user, Account)
assert current_user.current_tenant_id is not None

View File

@ -3,7 +3,6 @@ import os
import uuid
from typing import Any, Literal, Union
from flask_login import current_user
from sqlalchemy import Engine
from sqlalchemy.orm import sessionmaker
from werkzeug.exceptions import NotFound