Skip to content

Commit a8552ea

Browse files
README Updates
1 parent 06541ff commit a8552ea

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

README.md

+27-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
GPTScript is a new scripting language to automate your interaction with a Large Language Model (LLM), namely OpenAI.
66
The syntax of GPTScript is largely natural language, making it very easy to learn and use.
77
Natural language prompts can be mixed with traditional scripts such as bash and python or even external HTTP service
8-
calls.
8+
calls. With GPTScript you can do just about anything like [plan a vacation](./examples/travel-agent.gpt),
9+
[edit a file](./examples/add-go-mod-dep.gpt), [run some SQL](./examples/sqlite-download.gpt), or [build a mongodb/flask app](./examples/hacker-news-headlines.gpt).
910

1011
```yaml
1112
# example.gpt
@@ -63,6 +64,17 @@ export OPENAI_API_KEY="your-api-key"
6364
gptscript https://get.gptscript.ai/echo.gpt --input 'Hello, World!'
6465
```
6566

67+
### 4. Extra Credit: Examples and Run Debugging UI
68+
69+
Clone examples and run debugging UI
70+
```shell
71+
git clone https://github.com/gptscript-ai/gptscript
72+
cd gptscript/examples
73+
74+
# Run the debugging UI
75+
gptscript --server
76+
```
77+
6678
## How it works
6779

6880
***GPTScript is composed of tools.*** Each tool performs a series of actions similar to a function. Tools have available
@@ -96,7 +108,7 @@ OUTPUT:
96108
Bob said, "Thanks for asking 'How are you doing?', I'm doing great fellow friendly AI tool!"
97109
```
98110
Tools can be implemented by invoking a program instead of a natural language prompt. The below
99-
example is the same as the previous example but implements Bob using bash.
111+
example is the same as the previous example but implements Bob using python.
100112

101113
```yaml
102114
Tools: bob
@@ -108,9 +120,11 @@ Name: bob
108120
Description: I'm Bob, a friendly guy.
109121
Args: question: The question to ask Bob.
110122

111-
#!/bin/bash
123+
#!python3
124+
125+
import os
112126

113-
echo "Thanks for asking ${question}, I'm doing great fellow friendly AI tool!"
127+
print(f"Thanks for asking {os.environ['question']}, I'm doing great fellow friendly AI tool!")
114128
```
115129

116130
With these basic building blocks you can create complex scripts with AI interacting with AI, your local system, data,
@@ -146,7 +160,7 @@ as the text is typically more useful in the description, argument descriptions o
146160

147161
```yaml
148162
Name: tool-name
149-
# This is a comment in the preamble. Comments don't typically provide much value
163+
# This is a comment in the preamble.
150164
Description: Tool description
151165
# This tool can invoke tool1 or tool2 if needed
152166
Tools: tool1, tool2
@@ -169,13 +183,14 @@ description is used by the LLM to determine if the tool is to be invoked.
169183
default system prompt to instruct the AI to behave more like a script engine and not a "helpful assistant."
170184

171185
`Tools`: A comma-separated list of tools that are available to be called by this tool. A tool can only call the tools
172-
that are defined here.
186+
that are defined here. A tool name can reference a name in the current file, or a file relative to the current directory
187+
of the tool file, a http(s) URL, or a file in GitHub using github.com/username/repo/file.gpt format. When referencing
188+
a file or URL the tool loaded is the first tool in the file. To reference a specific tool in a file or URL use the
189+
syntax `tool-name from file-or-url`.
173190

174191
`Args`: Arguments for the tool. Each argument is defined in the format `arg-name: description`. All arguments are essentially
175192
strings. No other type really exists as all input and output to tools is text based.
176193

177-
`Vision`: If set to true this model will use vision capabilities. Vision models currently do not support the `Args` or `Tools` parameters.
178-
179194
`Max Tokens`: Set to a number if you wish to limit the maximum number of tokens that can be generated by the LLM.
180195

181196
`JSON Response`: Setting to `true` will cause the LLM to respond in a JSON format. If you set true you must also include instructions in the tool
@@ -211,6 +226,10 @@ echo "${input}"
211226

212227
For more examples check out the [examples](examples) directory.
213228

229+
## Community
230+
231+
Join us on Discord: [![Discord](https://img.shields.io/discord/1204558420984864829?label=Discord)](https://discord.gg/9sSf4UyAMC)
232+
214233
## License
215234

216235
Copyright (c) 2023 [Acorn Labs, Inc.](http://acorn.io)

examples/add-go-mod-dep.gpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
tools: sys.read, sys.write, sys.exec
1+
tools: sys.read, sys.write
22

3-
Edit the go.mod file and add ${package} version ${version} as a dependency in it
3+
Edit the go.mod file and add k8s.io/api version v0.29.0 as a dependency in it

0 commit comments

Comments
 (0)