We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 51b4f39 + a132560 commit 62c8113Copy full SHA for 62c8113
gptscript/command.py
@@ -20,6 +20,12 @@ def _get_command():
20
return os.path.join(python_bin_dir, "gptscript")
21
22
23
+def version():
24
+ cmd = _get_command()
25
+ out, _ = exec_cmd(cmd, ["--version"])
26
+ return out
27
+
28
29
def list_tools():
30
cmd = _get_command()
31
out, _ = exec_cmd(cmd, ["--list-tools"])
tests/test_gptscript.py
@@ -1,6 +1,7 @@
1
import os
2
import pytest
3
from gptscript.command import (
4
+ version,
5
list_models,
6
list_tools,
7
exec,
@@ -70,6 +71,11 @@ def tool_list():
70
71
]
72
73
74
+def test_version():
75
+ v = version()
76
+ assert "gptscript version " in v
77
78
79
# Test function for listing models
80
def test_list_models():
81
models = list_models()
0 commit comments