diff --git a/README.md b/README.md index bc6768e..6283c43 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,8 @@ error. ```python from gptscript.gptscript import GPTScript from gptscript.frame import RunFrame, CallFrame, PromptFrame -from gptscript.run import Run, RunEventType +from gptscript.run import Run +from gptscript.opts import Options from gptscript.prompt import PromptResponse gptscript = GPTScript() @@ -295,7 +296,7 @@ async def prompt(run: Run, event: RunFrame | CallFrame | PromptFrame): async def evaluate_example(): - run = gptscript.run("/path/to/file", event_handlers=[prompt]) + run = gptscript.run("/path/to/file", opts=Options(prompt=True), event_handlers=[prompt]) output = await run.text() print(output) diff --git a/examples/run.py b/examples/run.py new file mode 100644 index 0000000..a9f3517 --- /dev/null +++ b/examples/run.py @@ -0,0 +1,18 @@ +import asyncio + +from gptscript.gptscript import GPTScript +from gptscript.text import Text +from gptscript.tool import Tool + + +async def main(): + g = GPTScript() + nodes = [ + Text(fmt="nodeGraph", text='{"main":{"x":-692.5543409432609,"y":-114.63783459299711}}'), + Tool(chat=True, tools=["sys.prompt"], context=["github.com/gptscript-ai/context/workspace"], + instructions="Ask the user for their 'first name'. Then reply hello to the user."), + ] + print(await g.fmt(nodes)) + + +asyncio.run(main()) diff --git a/gptscript/install.py b/gptscript/install.py index b7effeb..2e1a36f 100644 --- a/gptscript/install.py +++ b/gptscript/install.py @@ -27,7 +27,7 @@ gptscript_info = { "name": "gptscript", "url": "https://github.com/gptscript-ai/gptscript/releases/download/", - "version": "v0.8.3", + "version": "v0.8.4", } pltfm = {"windows": "windows", "linux": "linux", "darwin": "macOS"}.get( diff --git a/pyproject.toml b/pyproject.toml index f21a66b..b0603c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "gptscript" -version = "0.8.3" +version = "0.8.4" description = "Run gptscripts from Python apps" readme = "README.md" authors = [{ name = "Bill Maxwell", email = "bill@acorn.io" }] diff --git a/scripts/package b/scripts/package index 6663053..2025e78 100755 --- a/scripts/package +++ b/scripts/package @@ -17,7 +17,7 @@ from tempfile import TemporaryDirectory gptscript_info = { "name": "gptscript", "url": "https://github.com/gptscript-ai/gptscript/releases/download/", - "version": "v0.7.1", + "version": "v0.8.4", } # Define platform-specific variables