Installed using - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ gptscript==0.1.0rc1
Example python code provided for exec(tool) fails with "TypeError: exec() arg 1 must be a string, bytes or code object"
python test.py
Traceback (most recent call last):
File "/Users/sangeethahariharan/gptscriprelease/gptscript/examples/test.py", line 27, in <module>
response = exec(tool)
TypeError: exec() arg 1 must be a string, bytes or code object
sangeethahariharan@Sangeethas-MacBook-Pro examples % python test.py
Traceback (most recent call last):
File "/Users/sangeethahariharan/gptscriprelease/gptscript/examples/test.py", line 27, in <module>
response = exec(tool)
TypeError: exec() arg 1 must be a string, bytes or code object
% cat test.py
from gptscript.command import list_models, list_tools
from gptscript.tool import Tool
#models = list_models()
#print(models)
#tools = list_tools()
#print(tools)
tool = Tool(
json_response=True,
instructions="""
Create three short graphic artist descriptions and their muses.
These should be descriptive and explain their point of view.
Also come up with a made up name, they each should be from different
backgrounds and approach art differently.
the response should be in JSON and match the format:
{
artists: [{
name: "name"
description: "description"
}]
}
""",
)
response = exec(tool)
print(response)
Also there is a typo in from gptsript.tool import Tool which needs to fixed to from gptscript.tool import Tool
Installed using -
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ gptscript==0.1.0rc1
Example python code provided for exec(tool) fails with "TypeError: exec() arg 1 must be a string, bytes or code object"
Also there is a typo in
from gptsript.tool import Tool
which needs to fixed tofrom gptscript.tool import Tool