cmd

package
v0.0.0-...-5f3b022 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StepNone = iota
	StepSelectProvider
	StepSelectLLM
	StepEnterAPIKey
	StepEnterAccountID
	StepToggleConfirmation
)

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type AIMessage

type AIMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type AnthropicRequest

type AnthropicRequest struct {
	System      string      `json:"system"`
	Messages    []AIMessage `json:"messages"`
	Model       string      `json:"model"`
	MaxTokens   int         `json:"max_tokens"`
	Temperature float64     `json:"temperature,omitempty"`
}

type AnthropicResponse

type AnthropicResponse struct {
	Content []struct {
		Text string `json:"text"`
	} `json:"content"`
}

type CloudflareRequest

type CloudflareRequest struct {
	Messages    []AIMessage `json:"messages"`
	MaxTokens   int         `json:"max_tokens"`
	Temperature float64     `json:"temperature,omitempty"`
}

type CloudflareResponse

type CloudflareResponse struct {
	Result struct {
		Response string `json:"response"`
	} `json:"result"`
}

type Command

type Command struct {
	XMLName xml.Name `xml:"command"`
	Content string   `xml:",chardata"`
}

type OllamaModel

type OllamaModel struct {
	Name string `json:"name"`
}

type OllamaResponse

type OllamaResponse struct {
	Models []OllamaModel `json:"models"`
}

type OpenAIEmbeddingRequest

type OpenAIEmbeddingRequest struct {
	Model string      `json:"model"`
	Input interface{} `json:"input"`
}

type OpenAIEmbeddingResponse

type OpenAIEmbeddingResponse struct {
	Object string `json:"object"`
	Data   []struct {
		Object    string    `json:"object"`
		Index     int       `json:"index"`
		Embedding []float32 `json:"embedding"`
	} `json:"data"`
	Model string `json:"model"`
	Usage struct {
		PromptTokens int `json:"prompt_tokens"`
		TotalTokens  int `json:"total_tokens"`
	} `json:"usage"`
}

type OpenAIRequest

type OpenAIRequest struct {
	Model       string      `json:"model"`
	Messages    []AIMessage `json:"messages"`
	MaxTokens   int         `json:"max_tokens"`
	Temperature float64     `json:"temperature,omitempty"`
}

type OpenAIResponse

type OpenAIResponse struct {
	Choices []struct {
		Message struct {
			Role    string `json:"role"`
			Content string `json:"content"`
		} `json:"message"`
	} `json:"choices"`
}

type RequestType

type RequestType int
const (
	LLMRequest RequestType = iota
	EmbeddingsRequest
)

Jump to

Keyboard shortcuts

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