chore(release): v0.1.1-alpha
##前端美化和bug修复 #### 💄 美化 - **前端美化**:对于整个前端效果进行了重新设计,现在的前端看起来会更立体。 #### 🐛 修复 - **前端演示**:修复了前端展示workflow列表的bug,但是workflow的具体条目显示由于序列化导致仍然有问题。 - **密钥修复**:对于secret_key现在在使用默认情况时,会强制生成一个安全的密钥。
This commit is contained in:
@@ -16,8 +16,6 @@ import importlib.util
|
||||
import os
|
||||
import sys
|
||||
from typing import Callable, Dict, List
|
||||
import pathlib
|
||||
from pretor.utils.ray_hook import ray_actor_hook
|
||||
|
||||
from pretor.utils.logger import get_logger
|
||||
logger = get_logger('get_tool')
|
||||
@@ -25,6 +23,10 @@ _tool_cache: Dict[str, Callable] = {}
|
||||
|
||||
|
||||
def _get_tool_func(tool_name: str) -> Callable | None:
|
||||
"""检索并获取特定的 tool func 数据集合或实例对象。
|
||||
根据提供的查询条件或上下文凭证,从数据库、缓存或第三方服务中读取对应的资源状态。
|
||||
Args: tool_name (str): 赋予该实体的人类可读名称或标题字符串,主要用于前端 UI 展示、日志记录或模糊检索。
|
||||
Returns: (Callable | None): 经由当前业务模型加工处理后所输出的具体数据实例或领域模型对象。 """
|
||||
func = _tool_cache.get(tool_name, None)
|
||||
if func:
|
||||
return func
|
||||
@@ -64,10 +66,18 @@ def _get_tool_func(tool_name: str) -> Callable | None:
|
||||
return None
|
||||
|
||||
def del_tool_cache(tool_name: str) -> None:
|
||||
"""执行与 del tool cache 相关的核心业务流转操作。
|
||||
该方法封装了具体的算法策略或状态控制逻辑,确保操作能够在事务上下文中被原子且一致地执行。
|
||||
Args: tool_name (str): 赋予该实体的人类可读名称或标题字符串,主要用于前端 UI 展示、日志记录或模糊检索。
|
||||
Returns: (None): 经由当前业务模型加工处理后所输出的具体数据实例或领域模型对象。 """
|
||||
if tool_name in _tool_cache:
|
||||
del _tool_cache[tool_name]
|
||||
|
||||
def load_tools_from_list(tool_names: List[str] | None) -> List[Callable]:
|
||||
"""执行与 load tools from list 相关的核心业务流转操作。
|
||||
该方法封装了具体的算法策略或状态控制逻辑,确保操作能够在事务上下文中被原子且一致地执行。
|
||||
Args: tool_names (List[str] | None): 赋予该实体的人类可读名称或标题字符串,主要用于前端 UI 展示、日志记录或模糊检索。
|
||||
Returns: (List[Callable]): 经过筛选、排序或分页处理后的实体对象列表集合。 """
|
||||
if not tool_names:
|
||||
return []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user