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
109
+
**_GPTScript is composed of tools._** Each tool performs a series of actions similar to a function. Tools have available
104
110
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_**,
106
112
the model determines if the tool needs to be invoked and what arguments to pass. Tools are intended to be implemented
107
113
with a natural language prompt but can also be implemented with a command or HTTP call.
108
114
109
115
### Example
116
+
110
117
Below are two tool definitions, separated by `---`. The first tool does not require a name or description, but
111
118
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.
112
119
@@ -122,14 +129,19 @@ args: question: The question to ask Bob.
122
129
123
130
When asked how I am doing, respond with "Thanks for asking "${question}", I'm doing great fellow friendly AI tool!"
124
131
```
132
+
125
133
Put the above content in a file named `bob.gpt` and run the following command:
134
+
126
135
```shell
127
136
$ gptscript bob.gpt
137
+
```
128
138
139
+
```
129
140
OUTPUT:
130
141
131
142
Bob said, "Thanks for asking 'How are you doing?', I'm doing great fellow friendly AI tool!"
132
143
```
144
+
133
145
Tools can be implemented by invoking a program instead of a natural language prompt. The below
134
146
example is the same as the previous example but implements Bob using python.
135
147
@@ -156,9 +168,11 @@ or external services.
156
168
## GPT File Reference
157
169
158
170
### Extension
171
+
159
172
GPTScript files use the `.gpt` extension by convention.
160
173
161
174
### File Structure
175
+
162
176
A GPTScript file has one or more tools in the file. Each tool is separated by three dashes `---` alone on a line.
163
177
164
178
```yaml
@@ -191,6 +205,7 @@ Args: arg1: The description of arg1
191
205
192
206
Tool instructions go here.
193
207
```
208
+
194
209
#### Tool Parameters
195
210
196
211
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