Skip to content

Commit 8a38e0e

Browse files
authored
docs: update OpenAPI docs to explain credential tool generation (#592)
Signed-off-by: Grant Linville <[email protected]>
1 parent 1c3e069 commit 8a38e0e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

Diff for: docs/docs/03-tools/03-openapi.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,8 @@ OAuth and OIDC schemes will be ignored.
5454
GPTScript will look at the `security` defined on the operation (or defined globally, if it is not defined on the operation) before it makes the request.
5555
It will set the necessary headers, cookies, or query parameters based on the corresponding security scheme.
5656

57-
Environment variables must be set for each security scheme that will be used by the operation.
58-
`<HOSTNAME>` is the hostname of the server, but all caps, and with dashes (`-`) and dots (`.`) replaced with underscores (`_`).
59-
`<SCHEME NAME>` is the name of the security scheme, but all caps, and with dashes (`-`) and dots (`.`) replaced with underscores (`_`).
60-
61-
- For `apiKey`-type and `http`-type with `bearer` scheme, the environment variable is `GPTSCRIPT_<HOSTNAME>_<SCHEME NAME>`
62-
- For `http`-type with `basic` scheme, the environment variables are `GPTSCRIPT_<HOSTNAME>_<SCHEME NAME>_USERNAME` and `GPTSCRIPT_<HOSTNAME>_<SCHEME NAME>_PASSWORD`
57+
When internally generating the tool for the operation with a supported security scheme, GPTScript will include a credential tool.
58+
This tool will prompt the user to enter their credentials. This will make the key available to GPTScript during the tool's execution.
6359

6460
#### Example
6561

@@ -85,10 +81,10 @@ security:
8581
```
8682

8783
In this example, we have two security schemes, and both are defined as the defaults on the global level.
88-
They are separate entries in the global `security` array, so they are treated as a logical OR, and GPTScript will only
89-
need the environment variable for one or the other to make the request.
84+
They are separate entries in the global `security` array, so they are treated as a logical OR, and GPTScript will prompt
85+
the user to enter the credential for the first one (basic auth).
9086

91-
When put into the same entry, they would be a logical AND, and the environment variables for both would be required.
87+
When put into the same entry, they would be a logical AND, and both would be required.
9288
It would look like this:
9389

9490
```yaml
@@ -97,10 +93,7 @@ security:
9793
MyAPIKey: []
9894
```
9995

100-
The environment variable names are as follows:
101-
102-
- `GPTSCRIPT_API_EXAMPLE_COM_MYBASIC_USERNAME` and `GPTSCRIPT_API_EXAMPLE_COM_MYBASIC_PASSWORD` for basic auth
103-
- `GPTSCRIPT_API_EXAMPLE_COM_MYAPIKEY` for the API key
96+
In this case, GPTScript will prompt the user for both the basic auth credentials and the API key.
10497

10598
### 2. Bearer token for server
10699

0 commit comments

Comments
 (0)