Skip to content

Commit 52e5cf2

Browse files
committed
docs: separate shell command from output in examples
Signed-off-by: tylerslaton <[email protected]>
1 parent 635f704 commit 52e5cf2

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ calls. With GPTScript you can do just about anything, like [plan a vacation](./e
1010
[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).
1111

1212
| :memo: | We are currently exploring options for interacting with local models using GPTScript. |
13-
|-|:-|
13+
| ------ | :------------------------------------------------------------------------------------ |
1414

15-
```yaml
15+
````yaml
1616
# example.gpt
1717

1818
Tools: sys.download, sys.exec, sys.remove
@@ -27,15 +27,17 @@ Form and run a SQL query to find the artist with the most number of albums and o
2727
the result of that.
2828

2929
When done remove the database file and the downloaded content.
30-
```
31-
```
30+
```shell
3231
$ gptscript ./example.gpt
32+
````
3333
34+
```
3435
OUTPUT:
3536

3637
The artist with the most number of albums in the database is Iron Maiden, with a total
3738
of 21 albums.
3839
```
40+
3941
## Quick Start
4042

4143
### 1. Install the latest release
@@ -80,16 +82,20 @@ $env:OPENAI = 'your-api-key'
8082

8183
```shell
8284
gptscript https://get.gptscript.ai/echo.gpt --input 'Hello, World!'
85+
```
8386

87+
```
8488
OUTPUT:
8589

8690
Hello, World!
8791
```
92+
8893
The model used by default is `gpt-4-turbo-preview` and you must have access to that model in your OpenAI account.
8994

9095
### 4. Extra Credit: Examples and Run Debugging UI
9196

9297
Clone examples and run debugging UI
98+
9399
```shell
94100
git clone https://github.com/gptscript-ai/gptscript
95101
cd gptscript/examples
@@ -100,13 +106,14 @@ gptscript --server
100106

101107
## How it works
102108

103-
***GPTScript is composed of tools.*** Each tool performs a series of actions similar to a function. Tools have available
109+
**_GPTScript is composed of tools._** Each tool performs a series of actions similar to a function. Tools have available
104110
to them other tools that can be invoked similar to a function call. While similar to a function, the tools are
105-
primarily implemented with a natural language prompt. ***The interaction of the tools is determined by the AI model***,
111+
primarily implemented with a natural language prompt. **_The interaction of the tools is determined by the AI model_**,
106112
the model determines if the tool needs to be invoked and what arguments to pass. Tools are intended to be implemented
107113
with a natural language prompt but can also be implemented with a command or HTTP call.
108114

109115
### Example
116+
110117
Below are two tool definitions, separated by `---`. The first tool does not require a name or description, but
111118
every tool after name and description are required. The first tool, has the parameter `tools: bob` meaning that the tool named `bob` is available to be called if needed.
112119

@@ -122,14 +129,19 @@ args: question: The question to ask Bob.
122129
123130
When asked how I am doing, respond with "Thanks for asking "${question}", I'm doing great fellow friendly AI tool!"
124131
```
132+
125133
Put the above content in a file named `bob.gpt` and run the following command:
134+
126135
```shell
127136
$ gptscript bob.gpt
137+
```
128138

139+
```
129140
OUTPUT:
130141

131142
Bob said, "Thanks for asking 'How are you doing?', I'm doing great fellow friendly AI tool!"
132143
```
144+
133145
Tools can be implemented by invoking a program instead of a natural language prompt. The below
134146
example is the same as the previous example but implements Bob using python.
135147

@@ -156,9 +168,11 @@ or external services.
156168
## GPT File Reference
157169

158170
### Extension
171+
159172
GPTScript files use the `.gpt` extension by convention.
160173

161174
### File Structure
175+
162176
A GPTScript file has one or more tools in the file. Each tool is separated by three dashes `---` alone on a line.
163177

164178
```yaml
@@ -191,6 +205,7 @@ Args: arg1: The description of arg1
191205
192206
Tool instructions go here.
193207
```
208+
194209
#### Tool Parameters
195210

196211
Tool parameters are key-value pairs defined at the beginning of a tool block, before any instructional text. They are specified in the format `key: value`. The parser recognizes the following keys (case-insensitive and spaces are ignored):

docs/docs/01-overview.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GPTScript is a new scripting language to automate your interaction with a Large
1111
We are currently exploring options for interacting with local models using GPTScript.
1212
:::
1313

14-
```yaml
14+
````yaml
1515
# example.gpt
1616

1717
Tools: sys.download, sys.exec, sys.remove
@@ -26,10 +26,11 @@ Form and run a SQL query to find the artist with the most number of albums and o
2626
the result of that.
2727

2828
When done remove the database file and the downloaded content.
29-
```
30-
```
29+
```shell
3130
$ gptscript ./example.gpt
31+
````
3232
33+
```
3334
OUTPUT:
3435

3536
The artist with the most number of albums in the database is Iron Maiden, with a total

docs/docs/100-tools/100-tools.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ When asked how I am doing, respond with "Thanks for asking "${question}", I'm do
2323

2424

2525
Put the above content in a file named `bob.gpt` and run the following command:
26-
```sh
26+
```shell
2727
$ gptscript bob.gpt
28-
28+
```
29+
```
2930
OUTPUT:
3031
3132
Bob said, "Thanks for asking 'How are you doing?', I'm doing great fellow friendly AI tool!"

0 commit comments

Comments
 (0)