ai

package
v0.0.0-...-989d2c1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOpenAiEndpoint = "https://api.openai.com/v1/chat/completions"

Variables

View Source
var TestOnlyOverrideAiSuggestions map[string][]string = make(map[string][]string)

Functions

This section is empty.

Types

type AiSuggestionRequest

type AiSuggestionRequest struct {
	DeviceId          string `json:"device_id"`
	UserId            string `json:"user_id"`
	Query             string `json:"query"`
	NumberCompletions int    `json:"number_completions"`
	ShellName         string `json:"shell_name"`
	OsName            string `json:"os_name"`
}

type AiSuggestionResponse

type AiSuggestionResponse struct {
	Suggestions []string `json:"suggestions"`
}

type OpenAiUsage

type OpenAiUsage struct {
	PromptTokens     int `json:"prompt_tokens"`
	CompletionTokens int `json:"completion_tokens"`
	TotalTokens      int `json:"total_tokens"`
}

func GetAiSuggestionsViaOpenAiApi

func GetAiSuggestionsViaOpenAiApi(apiEndpoint, query, shellName, osName string, numberCompletions int) ([]string, OpenAiUsage, error)

type TestOnlyOverrideAiSuggestionRequest

type TestOnlyOverrideAiSuggestionRequest struct {
	Query       string   `json:"query"`
	Suggestions []string `json:"suggestions"`
}

Jump to

Keyboard shortcuts

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