Skip to content

Commit

Permalink
feat: make prompts parameter optional (#108)
Browse files Browse the repository at this point in the history
* feat: make `prompts` parameter optional

* merge main

* rebuild

---------

Co-authored-by: Michael D'Angelo <[email protected]>
  • Loading branch information
typpo and mldangelo authored Sep 12, 2024
1 parent 4084a12 commit cb2158d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ The action can be configured using the following inputs:

| Parameter | Description | Required |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------- |
| `github-token` | The Github token. Used to authenticate requests to the Github API. | Yes |
| `prompts` | The glob patterns for the prompt files. These patterns are used to find the prompt files that the action should evaluate. | Yes |
| `config` | The path to the configuration file. This file contains settings for the action. | Yes |
| `github-token` | The Github token. Used to authenticate requests to the Github API. | Yes |
| `cache-path` | The path to the cache. This is where the action stores temporary data. | No |
| `promptfoo-version` | The version of promptfoo to use. Defaults to `latest` | No |
| `no-share` | No sharing option for promptfoo. Defaults to `false` | No |
| `promptfoo-version` | The version of promptfoo to use. Defaults to `latest` | No |
| `prompts` | The glob patterns for the prompt files. These patterns are used to find the prompt files that the action should evaluate. | No |
| `use-config-prompts` | Use prompt files set at config file. Defaults to `false` | No |

The following API key parameters are supported:
Expand Down Expand Up @@ -71,7 +71,6 @@ jobs:
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
prompts: 'prompts/**/*.json'
config: 'prompts/promptfooconfig.yaml'
cache-path: ~/.cache/promptfoo
```
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function run(): Promise<void> {
});
const githubToken: string = core.getInput('github-token', {required: true});
const promptFilesGlobs: string[] = core
.getInput('prompts', {required: true})
.getInput('prompts', {required: false})
.split('\n');
const configPath: string = core.getInput('config', {
required: true,
Expand Down

0 comments on commit cb2158d

Please sign in to comment.