You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ calls. With GPTScript you can do just about anything, like [plan a vacation](./e
10
10
[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).
11
11
12
12
|:memo:| We are currently exploring options for interacting with local models using GPTScript. |
***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
113
119
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_**,
115
121
the model determines if the tool needs to be invoked and what arguments to pass. Tools are intended to be implemented
116
122
with a natural language prompt but can also be implemented with a command or HTTP call.
117
123
118
124
### Example
125
+
119
126
Below are two tool definitions, separated by `---`. The first tool does not require a name or description, but
120
127
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.
121
128
@@ -131,14 +138,19 @@ args: question: The question to ask Bob.
131
138
132
139
When asked how I am doing, respond with "Thanks for asking "${question}", I'm doing great fellow friendly AI tool!"
133
140
```
141
+
134
142
Put the above content in a file named `bob.gpt` and run the following command:
143
+
135
144
```shell
136
145
$ gptscript bob.gpt
146
+
```
137
147
148
+
```
138
149
OUTPUT:
139
150
140
151
Bob said, "Thanks for asking 'How are you doing?', I'm doing great fellow friendly AI tool!"
141
152
```
153
+
142
154
Tools can be implemented by invoking a program instead of a natural language prompt. The below
143
155
example is the same as the previous example but implements Bob using python.
144
156
@@ -165,9 +177,11 @@ or external services.
165
177
## GPT File Reference
166
178
167
179
### Extension
180
+
168
181
GPTScript files use the `.gpt` extension by convention.
169
182
170
183
### File Structure
184
+
171
185
A GPTScript file has one or more tools in the file. Each tool is separated by three dashes `---` alone on a line.
172
186
173
187
```yaml
@@ -200,6 +214,7 @@ Args: arg1: The description of arg1
200
214
201
215
Tool instructions go here.
202
216
```
217
+
203
218
#### Tool Parameters
204
219
205
220
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):
0 commit comments