Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SystemMessage = openai.ChatMessage{ Role: openai.ChatRoleSystem, Content: "You are HAL, a powerful code and text editor controlled by natural language. Answer as concisely as possible.", }
Functions ¶
Types ¶
type FinishedMsg ¶
type FinishedMsg struct { Err error Buffer []byte History []openai.ChatMessage Tokens int }
type SearchResult ¶
type SearchResult struct { // The message that matched the search query. Message *openai.ChatMessage // MessageIndex is the index of the message in the chat history. MessageIndex int // MatchStart is the index of the start of the match in the message. StartIndex int // MatchEnd is the index of the end of the match in the message. EndIndex int }
SearchResult is a search result for a chat thread.
type Thread ¶
type Thread struct { // Name (title) of the thread. Name string `json:"name"` // Summary (description) of the thread. Summary string `json:"summary"` // Created is the date the thread was created. Created time.Time `json:"date"` // The prompt is the initial text that the model will generate from. // This is the text that the user will see when they first open the // chat window. Prompt string `json:"prompt"` // The chat history is the list of messages that have been sent and // received in the chat session. ChatHistory []openai.ChatMessage `json:"chat_history"` // Tokens is the last reported number of tokens used in the chat session. Tokens int `json:"tokens"` }
Thread is a "chat thread" that is used to store the chat history and metadata for a chat session. It implements the list.Item interface so that it can shown in a list in the UI.
func (*Thread) Description ¶
func (*Thread) FilterValue ¶
func (*Thread) Search ¶
Search retruns the messages that match the search query. Searching happens locally on the host.
TODO: consider returning index information in the search results so that we can highlight the matches in the UI.
Click to show internal directories.
Click to hide internal directories.