mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
@ -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 = {
|
||||
|
||||
@ -30,8 +30,6 @@ class FakeDatasourceRuntime(DatasourceRuntime):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
|
||||
super().__init__(
|
||||
tenant_id="fake_tenant_id",
|
||||
datasource_id="fake_datasource_id",
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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=[])
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user