refactor(models&tools): switch to dify_config in models and tools. (#6394)
Co-authored-by: Poorandy <andymonicamua1@gmail.com>
This commit is contained in:
parent
35f4a264d6
commit
8a80af39c9
5 changed files with 103 additions and 75 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue