Skip to content

Commit

Permalink
Update simple python test until normal tests are added
Browse files Browse the repository at this point in the history
  • Loading branch information
yiannisha committed Sep 10, 2024
1 parent 4e63509 commit cdce7ae
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env python3

import llm_tool
from llm_tool import tool, GlobalToolConfig
from llm_tool.llm_tool import parse_docstring

from typing import List

GlobalToolConfig.return_required = True
GlobalToolConfig.desc_required = True

hay = """
Generate an image with the given data.
Expand All @@ -17,11 +23,33 @@
:return: Processed Image with the given data drawn.
"""

a = llm_tool.parse_docstring(hay)
print(type(a))
print(dir(a))
print(a)
a = parse_docstring(hay)
# print(a.returns)
# print(a.description)
# print(a.params)

@tool(desc_required=False)
def test_func(graph_data: List[float], portfolio_name: str, description: str = "This is a description", marketValue: float = 14_000) -> None:
"""
Generate an image with the given data.
:param graph_data: List of data points to be plotted on the graph.
We only need the y-axis values.
The x-axis values will be calculated based on the length of the list.
All values are normalized to fit the graph region.
:param portfolio_name: Name of the portfolio.
:param description: Description of the portfolio.
:param marketValue: The marketValue of the portfolio.
:return: Processed Image with the given data drawn.
"""
print(graph_data)
print(portfolio_name)
print(description)
print(marketValue)

print("Description: ", a.description)
print("Returns: ", a.returns)
print("params: ", a.params)
# call test_func
# test_func([1, 2, 3, 4], "test", "test", 10)
#
print(test_func.definition)

0 comments on commit cdce7ae

Please sign in to comment.