Python 文件
PythonFileToolSpec #
基础:BaseToolSpec
源代码位于 llama-index-integrations/tools/llama-index-tools-python-file/llama_index/tools/python_file/base.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
function_definitions #
function_definitions(external: Optional[bool] = True) -> str
使用此函数获取 Python 文件中所有函数定义的名称和参数。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
external
|
可选[布尔值]
|
默认为 true。如果为 false,此函数也将返回以下划线开头的函数。 |
True
|
源代码位于 llama-index-integrations/tools/llama-index-tools-python-file/llama_index/tools/python_file/base.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
get_function #
get_function(name: str) -> str
使用此函数获取 Python 文件中单个函数定义的名称和参数。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
name
|
str
|
要检索的函数名称 |
required |
源代码位于 llama-index-integrations/tools/llama-index-tools-python-file/llama_index/tools/python_file/base.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
get_functions #
get_functions(names: List[str]) -> str
使用此函数获取 Python 文件中函数定义列表的名称和参数。
参数
名称 | 类型 | 描述 | 默认值 |
---|---|---|---|
name
|
列表[字符串]
|
要检索的函数名称 |
required |
源代码位于 llama-index-integrations/tools/llama-index-tools-python-file/llama_index/tools/python_file/base.py
51 52 53 54 55 56 57 58 59 60 61 62 |
|