conversation

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxConversationTime = time.Minute * 30
	SingleRequestTime   = time.Minute * 1
	MokiHeader          = `` /* 170-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func GetIntroduction

func GetIntroduction(client aiutil.Client, ctx context.Context) (string, error)

GetIntroduction sends the initial message to start the conversation

func HandleUserMessage

func HandleUserMessage(client aiutil.Client, conv *aiutil.Conversation, ctx context.Context, userInput string) error

handleUserMessage handles the user's message

func ManageResourceSelection

func ManageResourceSelection(userInput string) (string, error)

func StartChat

func StartChat(ctx context.Context, client aiutil.Client, conv *aiutil.Conversation) error

StartChat handles the conversation with the user

func StartConversationCLI

func StartConversationCLI(client aiutil.Client, conv *aiutil.Conversation) error

StartConversationCLI starts a conversation with Moki via the CLI

Types

type MokiModel

type MokiModel struct {
	textinput.Model
	// contains filtered or unexported fields
}

func (MokiModel) Init

func (m MokiModel) Init() tea.Cmd

func (MokiModel) Update

func (m MokiModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (MokiModel) View

func (m MokiModel) View() string

type ResourceInputModel

type ResourceInputModel struct {
	textinput.Model
	// contains filtered or unexported fields
}

func (ResourceInputModel) Init

func (m ResourceInputModel) Init() tea.Cmd

func (ResourceInputModel) Update

func (m ResourceInputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ResourceInputModel) View

func (m ResourceInputModel) View() string

type ResourceSelectionModel

type ResourceSelectionModel struct {
	textinput.Model
	// contains filtered or unexported fields
}

func (ResourceSelectionModel) Init

func (m ResourceSelectionModel) Init() tea.Cmd

func (ResourceSelectionModel) Update

func (m ResourceSelectionModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ResourceSelectionModel) View

func (m ResourceSelectionModel) View() string

Jump to

Keyboard shortcuts

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