llama-index-tools-python-file 0.1.2__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: llama-index-tools-python-file
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: llama-index tools python_file integration
5
5
  License: MIT
6
6
  Author: Your Name
7
7
  Author-email: you@example.com
8
8
  Maintainer: ajhofmann
9
- Requires-Python: >=3.8.1,<3.12
9
+ Requires-Python: >=3.8.1,<4.0
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
- Requires-Dist: llama-index-core (>=0.10.1,<0.11.0)
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Requires-Dist: llama-index-core (>=0.11.0,<0.12.0)
16
17
  Description-Content-Type: text/markdown
17
18
 
18
19
  # Python File Tool
@@ -27,7 +28,7 @@ Here's an example usage of the PythonFileToolSpec.
27
28
 
28
29
  ```python
29
30
  from llama_index.tools.python_file import PythonFileToolSpec
30
- from llama_index.agent import OpenAIAgent
31
+ from llama_index.agent.openai import OpenAIAgent
31
32
 
32
33
  pyfile = PythonFileToolSpec("./numpy_linalg.py")
33
34
 
@@ -35,15 +36,15 @@ agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())
35
36
 
36
37
  agent.chat(
37
38
  """Load the eig, transpose and solve functions from the python file,
38
- and then write a function defintion using only builtin python types (List, float, Tuple)
39
+ and then write a function definition using only builtin python types (List, float, Tuple)
39
40
  with a short 5-10 line doc string tool prompts for the functions that only has a small description and arguments
40
41
  """
41
42
  )
42
43
  ```
43
44
 
44
45
  `function_definitions`: Get all of the function definitions from the Python file
45
- `get_function`: Get a specfic function definiton from the Python file
46
+ `get_function`: Get a specific function definition from the Python file
46
47
  `get_functions`: Get a list of functions from the python file
47
48
 
48
- This loader is designed to be used as a way to load data as a Tool in a Agent. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.
49
+ This loader is designed to be used as a way to load data as a Tool in a Agent.
49
50
 
@@ -10,7 +10,7 @@ Here's an example usage of the PythonFileToolSpec.
10
10
 
11
11
  ```python
12
12
  from llama_index.tools.python_file import PythonFileToolSpec
13
- from llama_index.agent import OpenAIAgent
13
+ from llama_index.agent.openai import OpenAIAgent
14
14
 
15
15
  pyfile = PythonFileToolSpec("./numpy_linalg.py")
16
16
 
@@ -18,14 +18,14 @@ agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())
18
18
 
19
19
  agent.chat(
20
20
  """Load the eig, transpose and solve functions from the python file,
21
- and then write a function defintion using only builtin python types (List, float, Tuple)
21
+ and then write a function definition using only builtin python types (List, float, Tuple)
22
22
  with a short 5-10 line doc string tool prompts for the functions that only has a small description and arguments
23
23
  """
24
24
  )
25
25
  ```
26
26
 
27
27
  `function_definitions`: Get all of the function definitions from the Python file
28
- `get_function`: Get a specfic function definiton from the Python file
28
+ `get_function`: Get a specific function definition from the Python file
29
29
  `get_functions`: Get a list of functions from the python file
30
30
 
31
- This loader is designed to be used as a way to load data as a Tool in a Agent. See [here](https://github.com/emptycrown/llama-hub/tree/main) for examples.
31
+ This loader is designed to be used as a way to load data as a Tool in a Agent.
@@ -13,7 +13,7 @@ class PythonFileToolSpec(BaseToolSpec):
13
13
 
14
14
  def function_definitions(self, external: Optional[bool] = True) -> str:
15
15
  """
16
- Use this function to get the name and arguments of all function defintions in the python file.
16
+ Use this function to get the name and arguments of all function definitions in the python file.
17
17
 
18
18
  Args:
19
19
  external (Optional[bool]): Defaults to true. If false, this function will also return functions that start with _
@@ -8,10 +8,12 @@ check-hidden = true
8
8
  skip = "*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
9
9
 
10
10
  [tool.llamahub]
11
- classes = ["PythonFileToolSpec"]
12
11
  contains_example = false
13
12
  import_path = "llama_index.tools.python_file"
14
13
 
14
+ [tool.llamahub.class_authors]
15
+ PythonFileToolSpec = "ajhofmann"
16
+
15
17
  [tool.mypy]
16
18
  disallow_untyped_defs = true
17
19
  exclude = ["_static", "build", "examples", "notebooks", "venv"]
@@ -21,15 +23,16 @@ python_version = "3.8"
21
23
  [tool.poetry]
22
24
  authors = ["Your Name <you@example.com>"]
23
25
  description = "llama-index tools python_file integration"
26
+ exclude = ["**/BUILD"]
24
27
  license = "MIT"
25
28
  maintainers = ["ajhofmann"]
26
29
  name = "llama-index-tools-python-file"
27
30
  readme = "README.md"
28
- version = "0.1.2"
31
+ version = "0.2.0"
29
32
 
30
33
  [tool.poetry.dependencies]
31
- python = ">=3.8.1,<3.12"
32
- llama-index-core = "^0.10.1"
34
+ python = ">=3.8.1,<4.0"
35
+ llama-index-core = "^0.11.0"
33
36
 
34
37
  [tool.poetry.group.dev.dependencies]
35
38
  ipython = "8.10.0"