Skip to content

Commit 1e4048c

Browse files
authored
Merge pull request #208 from arunsathiya/add/evals
update(openai): Support "oaieval" and "oaievalset" as executables within the "openai" shell plugin
2 parents d7a779f + a1e226c commit 1e4048c

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

plugins/openai/oaieval.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package openai
2+
3+
import (
4+
"github.com/1Password/shell-plugins/sdk"
5+
"github.com/1Password/shell-plugins/sdk/needsauth"
6+
"github.com/1Password/shell-plugins/sdk/schema"
7+
"github.com/1Password/shell-plugins/sdk/schema/credname"
8+
)
9+
10+
func OpenAIEvalsCLI() schema.Executable {
11+
return schema.Executable{
12+
Name: "OpenAI Evals CLI",
13+
Runs: []string{"oaieval"},
14+
DocsURL: sdk.URL("https://github.com/openai/evals/blob/main/docs/run-evals.md"),
15+
NeedsAuth: needsauth.IfAll(
16+
needsauth.NotForHelpOrVersion(),
17+
needsauth.NotWithoutArgs(),
18+
),
19+
Uses: []schema.CredentialUsage{
20+
{
21+
Name: credname.APIKey,
22+
},
23+
},
24+
}
25+
}

plugins/openai/oaievalset.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package openai
2+
3+
import (
4+
"github.com/1Password/shell-plugins/sdk"
5+
"github.com/1Password/shell-plugins/sdk/needsauth"
6+
"github.com/1Password/shell-plugins/sdk/schema"
7+
"github.com/1Password/shell-plugins/sdk/schema/credname"
8+
)
9+
10+
func OpenAIEvalSetCLI() schema.Executable {
11+
return schema.Executable{
12+
Name: "OpenAI Eval Set CLI",
13+
Runs: []string{"oaievalset"},
14+
DocsURL: sdk.URL("https://github.com/openai/evals/blob/main/docs/run-evals.md"),
15+
NeedsAuth: needsauth.IfAll(
16+
needsauth.NotForHelpOrVersion(),
17+
needsauth.NotWithoutArgs(),
18+
),
19+
Uses: []schema.CredentialUsage{
20+
{
21+
Name: credname.APIKey,
22+
},
23+
},
24+
}
25+
}

plugins/openai/plugin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ func New() schema.Plugin {
1717
},
1818
Executables: []schema.Executable{
1919
OpenAICLI(),
20+
OpenAIEvalsCLI(),
21+
OpenAIEvalSetCLI(),
2022
},
2123
}
2224
}

0 commit comments

Comments
 (0)