domain

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

pandawiki特供类型

Index

Constants

This section is empty.

Variables

View Source
var Models []Model
View Source
var TypeModelMap map[consts.ModelType][]Model

Functions

This section is empty.

Types

type CheckModelReq

type CheckModelReq struct {
	Provider   string `` /* 155-byte string literal not displayed */
	Model      string `json:"model" validate:"required"`
	BaseURL    string `json:"base_url" validate:"required"`
	APIKey     string `json:"api_key"`
	APIHeader  string `json:"api_header"`
	APIVersion string `json:"api_version"` // for azure openai
	Type       string `json:"type" validate:"required,oneof=chat embedding rerank"`
}

type CheckModelResp

type CheckModelResp struct {
	Error   string `json:"error"`
	Content string `json:"content"`
}

type GetProviderModelListReq

type GetProviderModelListReq struct {
	Provider  string `` /* 166-byte string literal not displayed */
	BaseURL   string `json:"base_url" query:"base_url" validate:"required"`
	APIKey    string `json:"api_key" query:"api_key"`
	APIHeader string `json:"api_header" query:"api_header"`
	Type      string `json:"type" query:"type" validate:"required,oneof=chat embedding rerank"`
}

type GetProviderModelListResp

type GetProviderModelListResp struct {
	Models []ProviderModelListItem `json:"models"`
}

type IModelProvider added in v1.0.3

type IModelProvider[T any] interface {
	ListModel(subType string, provider string) ([]T, error)
}

type Model

type Model struct {
	ID        string               `json:"id"`         // 模型的名字
	Object    string               `json:"object"`     // 总是model
	Created   int                  `json:"created"`    // 创建时间
	OwnedBy   consts.ModelProvider `json:"owned_by"`   // 提供商
	ModelType consts.ModelType     `json:"model_type"` // 模型类型
}

type ModelKit

type ModelKit interface {
}

type ModelProvider added in v1.0.3

type ModelProvider struct {
	OwnerName  consts.ModelProvider `json:"owner_name"`  // 提供商
	APIBase    string               `json:"api_base"`    // 接口地址 如:https://api.qwen.com
	APIKey     string               `json:"api_key"`     // 接口密钥 如:sk-xxxx
	APIVersion string               `json:"api_version"` // 接口版本 如:2023-05-15
	APIHeader  string               `json:"api_header"`  // 接口头 如:Authorization: Bearer sk-xxxx
	Models     []Model              `json:"models"`      // 模型列表
}

type PandaGetProviderModelListReq added in v1.0.3

type PandaGetProviderModelListReq struct {
	Provider  string `` /* 166-byte string literal not displayed */
	BaseURL   string `json:"base_url" query:"base_url" validate:"required"`
	APIKey    string `json:"api_key" query:"api_key"`
	APIHeader string `json:"api_header" query:"api_header"`
	Type      string `json:"type" query:"type" validate:"required,oneof=chat embedding rerank"`
}

type PandaModel added in v1.0.3

type PandaModel struct {
	ID         string `json:"id"`
	Provider   string `json:"provider"`
	Model      string `json:"model"`
	APIKey     string `json:"api_key"`
	APIHeader  string `json:"api_header"`
	BaseURL    string `json:"base_url"`
	APIVersion string `json:"api_version"` // for azure openai
	Type       string `json:"type" gorm:"default:chat;uniqueIndex"`

	IsActive bool `json:"is_active" gorm:"default:false"`

	PromptTokens     uint64 `json:"prompt_tokens" gorm:"default:0"`
	CompletionTokens uint64 `json:"completion_tokens" gorm:"default:0"`
	TotalTokens      uint64 `json:"total_tokens" gorm:"default:0"`

	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type ProviderModelListItem

type ProviderModelListItem struct {
	Model string `json:"model"`
}

func From

func From(ModelProvider ModelProvider) []ProviderModelListItem

type Resp

type Resp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data,omitempty"`
}

type Response

type Response struct {
	Message string `json:"message"`
	Success bool   `json:"success"`
	Data    any    `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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