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
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ 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
129
+
**_GPTScript is composed of tools._** Each tool performs a series of actions similar to a function. Tools have available
122
130
to them other tools that can be invoked similar to a function call. While similar to a function, the tools are
123
-
primarily implemented with a natural language prompt. ***The interaction of the tools is determined by the AI model***,
131
+
primarily implemented with a natural language prompt. **_The interaction of the tools is determined by the AI model_**,
124
132
the model determines if the tool needs to be invoked and what arguments to pass. Tools are intended to be implemented
125
133
with a natural language prompt but can also be implemented with a command or HTTP call.
126
134
127
135
### Example
136
+
128
137
Below are two tool definitions, separated by `---`. The first tool does not require a name or description, but
129
138
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.
130
139
@@ -140,15 +149,19 @@ args: question: The question to ask Bob.
140
149
141
150
When asked how I am doing, respond with "Thanks for asking "${question}", I'm doing great fellow friendly AI tool!"
142
151
```
152
+
143
153
Put the above content in a file named `bob.gpt` and run the following command:
154
+
144
155
```shell
145
156
$ gptscript bob.gpt
146
157
```
158
+
147
159
```
148
160
OUTPUT:
149
161
150
162
Bob said, "Thanks for asking 'How are you doing?', I'm doing great fellow friendly AI tool!"
151
163
```
164
+
152
165
Tools can be implemented by invoking a program instead of a natural language prompt. The below
153
166
example is the same as the previous example but implements Bob using python.
154
167
@@ -175,9 +188,11 @@ or external services.
175
188
## GPT File Reference
176
189
177
190
### Extension
191
+
178
192
GPTScript files use the `.gpt` extension by convention.
179
193
180
194
### File Structure
195
+
181
196
A GPTScript file has one or more tools in the file. Each tool is separated by three dashes `---` alone on a line.
182
197
183
198
```yaml
@@ -210,6 +225,7 @@ Args: arg1: The description of arg1
210
225
211
226
Tool instructions go here.
212
227
```
228
+
213
229
#### Tool Parameters
214
230
215
231
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