Skip to content

Commit 33894c2

Browse files
committed
docs: separate shell command from output in examples
Signed-off-by: tylerslaton <[email protected]>
1 parent 01583db commit 33894c2

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
@@ -89,16 +91,20 @@ $env:OPENAI = 'your-api-key'
8991

9092
```shell
9193
gptscript https://get.gptscript.ai/echo.gpt --input 'Hello, World!'
94+
```
9295

96+
```
9397
OUTPUT:
9498

9599
Hello, World!
96100
```
101+
97102
The model used by default is `gpt-4-turbo-preview` and you must have access to that model in your OpenAI account.
98103

99104
### 4. Extra Credit: Examples and Run Debugging UI
100105

101106
Clone examples and run debugging UI
107+
102108
```shell
103109
git clone https://github.com/gptscript-ai/gptscript
104110
cd gptscript/examples
@@ -109,13 +115,14 @@ gptscript --server
109115

110116
## How it works
111117

112-
***GPTScript is composed of tools.*** Each tool performs a series of actions similar to a function. Tools have available
118+
**_GPTScript is composed of tools._** Each tool performs a series of actions similar to a function. Tools have available
113119
to them other tools that can be invoked similar to a function call. While similar to a function, the tools are
114-
primarily implemented with a natural language prompt. ***The interaction of the tools is determined by the AI model***,
120+
primarily implemented with a natural language prompt. **_The interaction of the tools is determined by the AI model_**,
115121
the model determines if the tool needs to be invoked and what arguments to pass. Tools are intended to be implemented
116122
with a natural language prompt but can also be implemented with a command or HTTP call.
117123

118124
### Example
125+
119126
Below are two tool definitions, separated by `---`. The first tool does not require a name or description, but
120127
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.
121128

@@ -131,14 +138,19 @@ args: question: The question to ask Bob.
131138
132139
When asked how I am doing, respond with "Thanks for asking "${question}", I'm doing great fellow friendly AI tool!"
133140
```
141+
134142
Put the above content in a file named `bob.gpt` and run the following command:
143+
135144
```shell
136145
$ gptscript bob.gpt
146+
```
137147

148+
```
138149
OUTPUT:
139150

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

@@ -165,9 +177,11 @@ or external services.
165177
## GPT File Reference
166178

167179
### Extension
180+
168181
GPTScript files use the `.gpt` extension by convention.
169182

170183
### File Structure
184+
171185
A GPTScript file has one or more tools in the file. Each tool is separated by three dashes `---` alone on a line.
172186

173187
```yaml
@@ -200,6 +214,7 @@ Args: arg1: The description of arg1
200214
201215
Tool instructions go here.
202216
```
217+
203218
#### Tool Parameters
204219

205220
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)