metadata

package
v1.3.0-rc.0...-12c9840 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunBailianModelMeta

type AliyunBailianModelMeta struct {
	Public AliyunBailianModelMetaPublic `json:"public,omitempty"`
	Secret AliyunBailianModelMetaSecret `json:"secret,omitempty"`
}

type AliyunBailianModelMetaPublic

type AliyunBailianModelMetaPublic struct{}

type AliyunBailianModelMetaSecret

type AliyunBailianModelMetaSecret struct {
	AppId string `json:"appId,omitempty"`
}

type AliyunBailianProviderMeta

type AliyunBailianProviderMeta struct {
	Public AliyunBailianProviderMetaPublic `json:"public,omitempty"`
	Secret AliyunBailianProviderMetaSecret `json:"secret,omitempty"`
}

type AliyunBailianProviderMetaPublic

type AliyunBailianProviderMetaPublic struct{}

type AliyunBailianProviderMetaSecret

type AliyunBailianProviderMetaSecret struct {
	AccessKeyId     string `json:"accessKeyId,omitempty"`
	AccessKeySecret string `json:"accessKeySecret,omitempty"`
	AgentKey        string `json:"agentKey,omitempty"`
}

type AliyunDashScopeModelMeta

type AliyunDashScopeModelMeta struct {
	Public AliyunDashScopeModelMetaPublic `json:"public,omitempty"`
	Secret AliyunDashScopeModelMetaSecret `json:"secret,omitempty"`
}

type AliyunDashScopeModelMetaPublic

type AliyunDashScopeModelMetaPublic struct {
	ModelName    string                      `json:"model_name,omitempty"`
	RequestType  AliyunDashScopeRequestType  `json:"request_type,omitempty"`
	ResponseType AliyunDashScopeResponseType `json:"response_type,omitempty"`
	CustomURL    string                      `json:"custom_url"` // e.g., https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
}

type AliyunDashScopeModelMetaSecret

type AliyunDashScopeModelMetaSecret struct {
}

type AliyunDashScopeRequestType

type AliyunDashScopeRequestType string
const (
	AliyunDashScopeRequestTypeOpenAI AliyunDashScopeRequestType = "openai"
	AliyunDashScopeRequestTypeDs     AliyunDashScopeRequestType = "ds"
)

func (AliyunDashScopeRequestType) String

func (AliyunDashScopeRequestType) Valid

func (t AliyunDashScopeRequestType) Valid() (bool, error)

type AliyunDashScopeResponseType

type AliyunDashScopeResponseType string
const (
	AliyunDashScopeResponseTypeOpenAI AliyunDashScopeResponseType = "openai"
	AliyunDashScopeResponseTypeDs     AliyunDashScopeResponseType = "ds"
)

func (AliyunDashScopeResponseType) String

func (AliyunDashScopeResponseType) Valid

func (t AliyunDashScopeResponseType) Valid() (bool, error)

type AuditMetadata

type AuditMetadata struct {
	Public AuditMetadataPublic `json:"public,omitempty"`
	Secret AuditMetadataSecret `json:"secret,omitempty"`
}

type AuditMetadataPublic

type AuditMetadataPublic struct {
	FilterName  string `json:"filter.name,omitempty"`
	FilterError string `json:"filter.error,omitempty"`

	RequestContentType      string `json:"request.content_type,omitempty"`
	ActualRequestURL        string `json:"actual.request.url,omitempty"`
	RequestFunctionCallName string `json:"request.function_call.name,omitempty"`
	RequestHeader           string `json:"request.headers,omitempty"`
	ActualRequestHeader     string `json:"actual.request.headers,omitempty"`

	ResponseContentType      string `json:"response.content_type,omitempty"`
	ResponseFunctionCallName string `json:"response.function_call.name,omitempty"`
	ResponseStreamDoneAt     string `json:"response.stream.done_at,omitempty"`
	ResponseHeader           string `json:"response.header,omitempty"`

	TimeCost string `json:"time_cost,omitempty"`

	AudioFileName    string `json:"audio.file.name,omitempty"`
	AudioFileSize    string `json:"audio.file.size,omitempty"`
	AudioFileHeaders string `json:"audio.file.headers,omitempty"`

	ImageQuality string `json:"image.quality,omitempty"`
	ImageSize    string `json:"image.size,omitempty"`
	ImageStyle   string `json:"image.style,omitempty"`
}

type AuditMetadataSecret

type AuditMetadataSecret struct {
	IdentityPhoneNumber string `json:"identity.phone_number,omitempty"`
	IdentityJobNumber   string `json:"identity.job_number,omitempty"`

	DingtalkStaffId   string `json:"dingtalk.staff_id,omitempty"`
	DingtalkChatType  string `json:"dingtalk.chat_type,omitempty"`
	DingtalkChatTitle string `json:"dingtalk.chat_title,omitempty"`
	DingtalkChatId    string `json:"dingtalk.chat_id,omitempty"`
}

type ClientMeta

type ClientMeta struct {
	Public ClientMetaPublic `json:"public,omitempty"`
	Secret ClientMetaSecret `json:"secret,omitempty"`
}

type ClientMetaPublic

type ClientMetaPublic struct {
	DefaultModelIdOfTextGeneration string `json:"default_model_id_of_text_generation,omitempty"`
	DefaultModelIdOfImage          string `json:"default_model_id_of_image,omitempty"`
	DefaultModelIdOfAudio          string `json:"default_model_id_of_audio,omitempty"`
	DefaultModelIdOfEmbedding      string `json:"default_model_id_of_embedding,omitempty"`
	DefaultModelIdOfTextModeration string `json:"default_model_id_of_text_moderation,omitempty"`
	DefaultModelIdOfMultimodal     string `json:"default_model_id_of_multimodal,omitempty"`
	DefaultModelIdOfAssistant      string `json:"default_model_id_of_assistant,omitempty"`
}

func (*ClientMetaPublic) GetDefaultModelIdByModelType

func (p *ClientMetaPublic) GetDefaultModelIdByModelType(modelType modelpb.ModelType) (string, bool)

type ClientMetaSecret

type ClientMetaSecret struct {
}

type Config

type Config struct {
	IgnoreCase   bool   // default: false
	DefaultValue string // default: ""
}

type Metadata

type Metadata struct {
	Public map[string]string `json:"public,omitempty"`
	Secret map[string]string `json:"secret,omitempty"`
}

func FromProtobuf

func FromProtobuf(pb *pb.Metadata) Metadata

func (*Metadata) FromProtobuf

func (m *Metadata) FromProtobuf(pb *pb.Metadata)

func (*Metadata) GetPublicValueByKey

func (m *Metadata) GetPublicValueByKey(key string, ignoreCaseOpt ...bool) (string, bool)

func (*Metadata) GetSecretValueByKey

func (m *Metadata) GetSecretValueByKey(key string, ignoreCaseOpt ...bool) (string, bool)

func (*Metadata) GetValueByKey

func (m *Metadata) GetValueByKey(key string, optionalCfg ...Config) (string, bool)

func (*Metadata) MergeMap

func (m *Metadata) MergeMap() map[string]string

func (*Metadata) MustGetValueByKey

func (m *Metadata) MustGetValueByKey(key string, optionalCfg ...Config) string

func (*Metadata) Scan

func (m *Metadata) Scan(src any) error

func (*Metadata) ToClientMeta

func (m *Metadata) ToClientMeta() (*ClientMeta, error)

func (*Metadata) ToJson

func (m *Metadata) ToJson() (string, error)

func (*Metadata) ToModelProviderMeta

func (m *Metadata) ToModelProviderMeta() (*ModelProviderMeta, error)

func (*Metadata) ToProtobuf

func (m *Metadata) ToProtobuf() *pb.Metadata

func (Metadata) Value

func (m Metadata) Value() (driver.Value, error)

type ModelProviderMeta

type ModelProviderMeta struct {
	Public ModelProviderMetaPublic `json:"public,omitempty"`
	Secret ModelProviderMetaSecret `json:"secret,omitempty"`
}

type ModelProviderMetaPublic

type ModelProviderMetaPublic struct {
	Scheme   string `json:"scheme,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
	Host     string `json:"host,omitempty"`
	Location string `json:"location,omitempty"`
	Region   string `json:"region,omitempty"`
}

type ModelProviderMetaSecret

type ModelProviderMetaSecret struct {
	AnotherAPIKey string `json:"anotherApiKey,omitempty"`
}

Jump to

Keyboard shortcuts

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