refactor(models&tools): switch to dify_config in models and tools. (#6394)
Co-authored-by: Poorandy <andymonicamua1@gmail.com>
This commit is contained in:
@@ -6,8 +6,7 @@ from os import listdir, path
|
||||
from threading import Lock
|
||||
from typing import Any, Union
|
||||
|
||||
from flask import current_app
|
||||
|
||||
from configs import dify_config
|
||||
from core.agent.entities import AgentToolEntity
|
||||
from core.app.entities.app_invoke_entities import InvokeFrom
|
||||
from core.helper.module_import_helper import load_single_subclass_from_source
|
||||
@@ -566,7 +565,7 @@ class ToolManager:
|
||||
provider_type = provider_type
|
||||
provider_id = provider_id
|
||||
if provider_type == 'builtin':
|
||||
return (current_app.config.get("CONSOLE_API_URL")
|
||||
return (dify_config.CONSOLE_API_URL
|
||||
+ "/console/api/workspaces/current/tool-provider/builtin/"
|
||||
+ provider_id
|
||||
+ "/icon")
|
||||
@@ -594,4 +593,4 @@ class ToolManager:
|
||||
else:
|
||||
raise ValueError(f"provider type {provider_type} not found")
|
||||
|
||||
ToolManager.load_builtin_providers_cache()
|
||||
ToolManager.load_builtin_providers_cache()
|
||||
|
Reference in New Issue
Block a user