chat

package
v0.0.0-...-63f5808 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "chat",
	Short: "Start a chart",
	RunE: func(cmd *cobra.Command, _ []string) error {
		istty := isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())

		c, err := chat.NewChat(&openai.Config{
			Server:         flagServer,
			SecretKey:      flagSecretKey,
			OrganizationID: flagOrgID,
			Proxy:          flagProxy,
		}, chat.Options{
			Model:            flagModel,
			TimeoutPerRound:  flagTimeoutPerRound,
			OutputDecoration: istty,
			OutputColor:      istty,
		})
		if err != nil {
			return fmt.Errorf("create chat error: %w", err)
		}
		return c.Start(cmd.Context())
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL