Skip to content
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

feat: make prompts parameter optional #108

Merged
merged 5 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
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
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