cmd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type ChatMessage

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

type LLMService

type LLMService struct {
	Name     string
	Protocol string
	Hostname string
	APIPath  string
	Headers  map[string]string
	AuthKey  string
}

LLM服务配置

type OllamaRequest

type OllamaRequest struct {
	Model       string  `json:"model"`
	System      string  `json:"system"`
	Prompt      string  `json:"prompt"`
	Temperature float64 `json:"temperature"`
	TopP        float64 `json:"top-p"`
	MaxTokens   int     `json:"max-tokens"`
	Stream      bool    `json:"stream"`
}

type OllamaResponse

type OllamaResponse struct {
	Response string `json:"response"`
}

Ollama响应结构

type OpenAIRequest

type OpenAIRequest struct {
	Model       string        `json:"model"`
	Messages    []ChatMessage `json:"messages"`
	Temperature float64       `json:"temperature"`
	TopP        float64       `json:"top-p"`
	MaxTokens   int           `json:"max-tokens"`
	Stream      bool          `json:"stream"`
}

LLM API请求结构

type OpenAIResponse

type OpenAIResponse struct {
	Choices []struct {
		Delta struct {
			Content string `json:"content"`
		} `json:"delta"`
	} `json:"choices"`
}

OpenAI响应结构

Jump to

Keyboard shortcuts

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