model

package
v0.0.0-...-38ea638 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBaseURL

func DefaultBaseURL(p Provider) string

DefaultBaseURL 后端默认 BaseURL(Ark 走 SDK 默认,返回空)。

func DefaultModel

func DefaultModel(p Provider) string

DefaultModel 后端内置默认模型名(Ollama 无统一默认,返回空)。

func ListOllamaModels

func ListOllamaModels(baseURL string) ([]string, error)

ListOllamaModels 拉取本机 Ollama 已安装模型名。

func NewChatModel

func NewChatModel(ctx context.Context, cfg Config) (model.ToolCallingChatModel, string, error)

NewChatModel 按 Provider 构造 Eino ToolCallingChatModel。

func ResolveModel

func ResolveModel(p Provider, model string) string

ResolveModel 空模型名时回落到后端默认。

func ResolveOllamaModel

func ResolveOllamaModel(ctx context.Context, baseURL, name string) (string, error)

ResolveOllamaModel 将用户输入解析为 Ollama 完整模型名(支持 qwen3.6 → qwen3.6:35b)。

Types

type Config

type Config struct {
	Provider Provider
	APIKey   string
	BaseURL  string
	Model    string
	// Thinking:DeepSeek / 千问 / Ark / Ollama 等思考开关;MiniMax→adaptive|disabled。
	Thinking bool
}

Config 构造 ChatModel 的参数。

type Provider

type Provider string

Provider 大模型提供方。

const (
	ProviderQwen     Provider = "qwen"
	ProviderDeepSeek Provider = "deepseek"
	ProviderMiniMax  Provider = "minimax"
	ProviderOllama   Provider = "ollama"
	ProviderArk      Provider = "ark"
	ProviderTokenHub Provider = "tokenhub"
	ProviderOpenAI   Provider = "openai" // OpenAI 兼容(含自定义 BaseURL)
)

func ParseProvider

func ParseProvider(raw string) Provider

ParseProvider 从设置字符串解析后端。

Jump to

Keyboard shortcuts

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