chat

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SYSTEM_MESSAGE = ai.ChatCompletionMessage{
	Role: ai.ChatMessageRoleSystem,
	Content: `As an AI, you are programmed to generate precise console commands based on user instructions for any shell type. These instructions are your main focus. Along with these instructions, you may receive 'context' c.messages containing various details such as the file listing of the current directory, specific contents of files, command history, and the shell identifier. This context should be used as needed to create the most suitable console command, but remember, it may or may not be helpful in generating the command. The user's instruction should always be your primary guide.
    In every situation, your output should be exclusively the console command, with no added text or explanations. Reiterating for clarity, your output, crafted using any relevant user instructions and possibly the provided context, should contain no other information apart from the command itself. NOT even a prefix like 'Command:' can be present, 100% only the that is to be execued. Even when the instructions or context might be ambiguous, you are to give it your best try without asking for any additional clarification or providing any explanation - just the console command.`,
}

Functions

This section is empty.

Types

type Chat

type Chat struct {
	Context     []context.Item
	Instruction string
	// contains filtered or unexported fields
}

func New

func New(instruction string, token string) Chat

func (*Chat) AddContext

func (c *Chat) AddContext(item context.Item, err error)

func (*Chat) Execute

func (c *Chat) Execute() (string, error)

func (*Chat) Revise

func (c *Chat) Revise(revision string) (string, error)

Jump to

Keyboard shortcuts

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