pangukitsappdev.api.tool package

Submodules

pangukitsappdev.api.tool.base module

class pangukitsappdev.api.tool.base.AbstractTool(*, name: str, description: str, args_schema: Optional[Type[BaseModel]] = None, return_direct: bool = False, verbose: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, handle_tool_error: Optional[Union[bool, str, Callable[[ToolException], str]]] = False, handle_validation_error: Optional[Union[bool, str, Callable[[ValidationError], str]]] = False, input_desc: str, output_desc: str, principle: str, func: Optional[Callable[[...], str]] = None, return_type: Optional[Type] = None)

基类:BaseTool, ABC

func: Optional[Callable[[...], str]]
abstract get_input_schema() str

获取入参的Json Schema定义 Returns: str, 获取入参的Json Schema定义

abstract get_output_schema() str

获取出参的Json Schema定义 Returns: str, 获取出参的Json Schema定义

abstract get_pangu_function() str

获取pangu Function的定义 Returns: str, pangu Function的定义

get_tool_desc() str

工具的描述,唯一值 Returns: str, 工具的描述

get_tool_id()

工具的唯一标识,在同一个Agent里必须唯一 Returns: str, 工具的标识

input_desc: str
property input_type

工具的input类型, Returns: Type, 工具input类型

output_desc: str
property output_type

工具的返回值类型,此方法可获取func或_run方法返回类型 Returns: Type, 工具的返回值类型

principle: str
return_type: Optional[Type]
class pangukitsappdev.api.tool.base.PanguFunction(*, name: Optional[str] = None, description: Optional[str] = None, arguments: Optional[Any] = None, principle: Optional[str] = None, results: Optional[Any] = None)

基类:BaseModel

PanguFunction参数 Attributes:

name: tool名称 description: tool功能描述,描述tool的作用 arguments: tool输入 principle: tool使用原则,告诉模型在什么情况下使用tool results: tool输出

arguments: Optional[Any]
description: Optional[str]
name: Optional[str]
principle: Optional[str]
results: Optional[Any]

Module contents