Skip to content

Commit 15f7c5e

Browse files
committed
PR feedback
Signed-off-by: Grant Linville <[email protected]>
1 parent 742dcb4 commit 15f7c5e

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

docs/docs/03-tools/08-workspace.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ gptscript --workspace . my-script.gpt
1010
```
1111

1212
In the above example, the user’s current directory (denoted by `.`) will be set as the workspace.
13+
The workspace directory is no longer temporary if it is explicitly set, and everything in it will persist after the script has finished running.
1314
Both absolute and relative paths are supported.
1415

1516
Regardless of whether it is set implicitly or explicitly, the workspace is then made available to the script execution as the `GPTSCRIPT_WORKSPACE_DIR` environment variable.
@@ -21,7 +22,7 @@ The tools must decide to make use of the workspace environment variable.
2122

2223
## The Workspace Context Tool
2324

24-
To make prompt-based tools aware of the workspace, you can reference the workspace context tool:
25+
To make a non-code tool that uses the LLM aware of the workspace, you can reference the workspace context tool:
2526

2627
```
2728
Context: github.com/gptscript-ai/context/workspace

docs/docs/03-tools/09-code-tool-guidelines.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This guide provides guidelines for setting up GitHub repos for proper tool distr
1010
### `tool.gpt` or `agent.gpt` file
1111

1212
Every repo should have a `tool.gpt` or `agent.gpt` file. This is the main logic of the tool.
13+
If both files exist, GPTScript will use the `agent.gpt` file and ignore the `tool.gpt` file.
1314
Your repo can have other `.gpt` files that are referenced by the main file, but there must be a `tool.gpt` or `agent.gpt` file present.
1415

1516
Under most circumstances, this file should live in the root of the repo.
@@ -116,6 +117,10 @@ Name: my-go-tool
116117
#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool
117118
```
118119

120+
:::important
121+
Unlike the Python and Node cases above where you can name the file you are going to run anything you want, Go tools must be `#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool`.
122+
:::
123+
119124
GPTScript will build the Go program located at `./main.go` to a file called `./bin/gptscript-go-tool` before running the tool.
120125
All of your dependencies need to be properly specified in a `go.mod` file.
121126

docs/docs/03-tools/10-daemon.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,17 @@ Let's talk about the daemon tool, called `my-daemon`, first.
5858
The body of this tool begins with `#!sys.daemon`. This tells GPTScript to take the rest of the body as a command to be
5959
run in the background that will listen for HTTP requests. GPTScript will run this command (in this case, a Node script).
6060
GPTScript will assign a port number for the server and set the `PORT` environment variable to that number, so the
61-
server needs to check that variable and listen on the proper port. The server is required to respond to a GET request at
62-
`/` with 200 OK, so that GPTScript can make sure it is running properly before continuing execution.
61+
server needs to check that variable and listen on the proper port.
62+
63+
After GPTScript runs the daemon, it will send it an HTTP GET request to make sure that it is running properly.
64+
The daemon needs to respond with a 200 OK to this request.
65+
By default, the request goes to `/`, but this can be configured with the following syntax:
66+
67+
```
68+
#!sys.daemon (path=/api/ready) node
69+
70+
// (node script here)
71+
```
6372

6473
### The Entrypoint Tool
6574

0 commit comments

Comments
 (0)