Skip to content

Commit

Permalink
Merge pull request #208 from arunsathiya/add/evals
Browse files Browse the repository at this point in the history
update(openai): Support "oaieval" and "oaievalset" as executables within the "openai" shell plugin
  • Loading branch information
accraw committed Jun 28, 2023
2 parents d7a779f + a1e226c commit 1e4048c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
25 changes: 25 additions & 0 deletions plugins/openai/oaieval.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package openai

import (
"github.com/1Password/shell-plugins/sdk"
"github.com/1Password/shell-plugins/sdk/needsauth"
"github.com/1Password/shell-plugins/sdk/schema"
"github.com/1Password/shell-plugins/sdk/schema/credname"
)

func OpenAIEvalsCLI() schema.Executable {
return schema.Executable{
Name: "OpenAI Evals CLI",
Runs: []string{"oaieval"},
DocsURL: sdk.URL("https://github.com/openai/evals/blob/main/docs/run-evals.md"),
NeedsAuth: needsauth.IfAll(
needsauth.NotForHelpOrVersion(),
needsauth.NotWithoutArgs(),
),
Uses: []schema.CredentialUsage{
{
Name: credname.APIKey,
},
},
}
}
25 changes: 25 additions & 0 deletions plugins/openai/oaievalset.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package openai

import (
"github.com/1Password/shell-plugins/sdk"
"github.com/1Password/shell-plugins/sdk/needsauth"
"github.com/1Password/shell-plugins/sdk/schema"
"github.com/1Password/shell-plugins/sdk/schema/credname"
)

func OpenAIEvalSetCLI() schema.Executable {
return schema.Executable{
Name: "OpenAI Eval Set CLI",
Runs: []string{"oaievalset"},
DocsURL: sdk.URL("https://github.com/openai/evals/blob/main/docs/run-evals.md"),
NeedsAuth: needsauth.IfAll(
needsauth.NotForHelpOrVersion(),
needsauth.NotWithoutArgs(),
),
Uses: []schema.CredentialUsage{
{
Name: credname.APIKey,
},
},
}
}
2 changes: 2 additions & 0 deletions plugins/openai/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ func New() schema.Plugin {
},
Executables: []schema.Executable{
OpenAICLI(),
OpenAIEvalsCLI(),
OpenAIEvalSetCLI(),
},
}
}

0 comments on commit 1e4048c

Please sign in to comment.