Python file
PythonFileToolSpec #
Bases: BaseToolSpec
Source code in 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 |
|
function_definitions #
function_definitions(external: Optional[bool] = True) -> str
Use this function to get the name and arguments of all function definitions in the python file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
external |
Optional[bool]
|
Defaults to true. If false, this function will also return functions that start with _ |
True
|
Source code in 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 |
|
get_function #
get_function(name: str) -> str
Use this function to get the name and arguments of a single function definition in the python file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the function to retrieve |
required |
Source code in llama-index-integrations/tools/llama-index-tools-python-file/llama_index/tools/python_file/base.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
get_functions #
get_functions(names: List[str]) -> str
Use this function to get the name and arguments of a list of function definition in the python file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
List[str]
|
The names of the functions to retrieve |
required |
Source code in llama-index-integrations/tools/llama-index-tools-python-file/llama_index/tools/python_file/base.py
49 50 51 52 53 54 55 56 57 58 59 |
|