diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-07 15:16:31 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-07 15:16:31 +0800 |
| commit | 739a832d87c00e3b5977a24bba5654fa5ea7a702 (patch) | |
| tree | 2bb4c102a3e04b9c8c1ecd61bdb6c92f84ca27cb /tools/demo_tool.py | |
| parent | 2b07fc2c7e4e6311d35ae72c17b25e47680d61f6 (diff) | |
| download | llm-functions-docker-739a832d87c00e3b5977a24bba5654fa5ea7a702.tar.gz | |
feat: js/py generate declarations from comments (#30)
Diffstat (limited to 'tools/demo_tool.py')
| -rw-r--r-- | tools/demo_tool.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/demo_tool.py b/tools/demo_tool.py new file mode 100644 index 0000000..bd353ad --- /dev/null +++ b/tools/demo_tool.py @@ -0,0 +1,32 @@ +from typing import List, Literal, Optional + + +def main( + boolean: bool, + string: str, + string_enum: Literal["foo", "bar"], + integer: int, + number: float, + array: List[str], + string_optional: Optional[str] = None, + array_optional: Optional[List[str]] = None, +) -> None: + """Demonstrate how to create a tool using Python and how to use comments. + Args: + boolean: Define a required boolean property + string: Define a required string property + string_enum: Define a required string property with enum + integer: Define a required integer property + number: Define a required number property + array: Define a required string array property + string_optional: Define a optional string property + array_optional: Define a optional string array property + """ + print(f"boolean: {boolean}") + print(f"string: {string}") + print(f"string_enum: {string_enum}") + print(f"integer: {integer}") + print(f"number: {number}") + print(f"array: {array}") + print(f"string_optional: {string_optional}") + print(f"array_optional: {array_optional}") |
