Skip to content

docs: provide info on the generic credential tool #471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/docs/03-tools/04-credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ credentials: credential-tool-2.gpt
(tool stuff here)
```

### Generic Credential Tool

GPTScript also provides a generic credential tool (`github.com/gptscript-ai/credential`) that is ideal for cases
where you only need to set one environment variable. Here is an example of how to use it:

```yaml
credentials: github.com/gptscript-ai/credential as myCredentialName with MY_ENV_VAR as env and "this message will be displayed to the user" as message and key as field

(tool stuff here)
```

When this tool is run, the user will be shown the message and prompted to enter a key. The value entered will be set as
the environment variable `MY_ENV_VAR` and stored in a credential called `myCredentialName`.

See [the repo](https://github.com/gptscript-ai/credential) for more information.

## Credential Tool Arguments

A credential tool may define arguments. Here is an example:
Expand Down
Loading