Documentation
¶
Index ¶
- Constants
- Variables
- func Execute(ctx context.Context)
- func GetClient(ctx context.Context, p core.Platform) (core.Generative, error)
- func NewAnthropic(ctx context.Context) (*anthropic.Client, error)
- func NewGemini(ctx context.Context) (*gemini.Client, error)
- func NewOpenAI() (*openai.Client, error)
- type VersionInfo
Constants ¶
View Source
const ( GITHUB = "github" DRONE = "drone" )
Variables ¶
View Source
var CompletionCmd = &cobra.Command{ Use: "completion [bash|zsh|fish|powershell]", Short: "Generate completion script", Long: `Generate shell completion scripts for CodeGPT CLI. To load completions: Bash: $ source <(codegpt completion bash) # Or save it to a file and source it: $ codegpt completion bash > ~/.codegpt-completion.bash $ echo 'source ~/.codegpt-completion.bash' >> ~/.bashrc Zsh: $ source <(codegpt completion zsh) # Or save it to a file in your $fpath: $ codegpt completion zsh > "${fpath[1]}/_codegpt" Fish: $ codegpt completion fish > ~/.config/fish/completions/codegpt.fish PowerShell: PS> codegpt completion powershell > codegpt.ps1 PS> . ./codegpt.ps1`, DisableFlagsInUseLine: true, ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs), Run: func(cmd *cobra.Command, args []string) { switch args[0] { case "bash": _ = cmd.Root().GenBashCompletion(os.Stdout) case "zsh": _ = cmd.Root().GenZshCompletion(os.Stdout) case "fish": _ = cmd.Root().GenFishCompletion(os.Stdout, true) case "powershell": _ = cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout) } }, }
Functions ¶
func NewAnthropic ¶ added in v0.15.0
NewAnthropic creates a new instance of the anthropic.Client using configuration values retrieved from Viper. The configuration values include the API key, model, maximum tokens, temperature, and top_p.
Parameters:
- ctx: The context for the client.
Returns:
- A pointer to an anthropic.Client instance.
- An error if the client could not be created.
Types ¶
type VersionInfo ¶ added in v1.0.0
type VersionInfo struct { Version string `json:"version"` // Application version GitCommit string `json:"git_commit"` // Git commit SHA BuildTime string `json:"build_time"` // Build timestamp GoVersion string `json:"go_version"` // Go language version BuildOS string `json:"build_os"` // Build operating system BuildArch string `json:"build_arch"` // Build architecture Platform string `json:"platform"` // Combined OS/Arch string }
VersionInfo holds all version-related information for the application.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.