Documentation
¶
Overview ¶
智谱 Embedding 系列模型 SDK
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Embeddings Client 客户端
type Data ¶
type Data struct {
Index uint32 `json:"index"` // 结果下标
Object string `json:"object"` // 结果类型,目前为 embedding
Embedding []interface{} `json:"embedding"` // embedding 的处理结果,返回向量化表征的数组
}
模型生成的数组结果
type Request ¶
type Request struct {
Model public.Model `json:"model"` // 要调用的模型编码
// 输入需要向量化的文本,支持字符串数组。
// embedding-2 的单条请求最多支持 512 个Tokens,数组总长度不得超过 8K;
// embedding-3 的单条请求最多支持 3072 个Tokens,数组总长度不得超过 8K;
// 且数组最大不得超过 64 条。
Input interface{} `json:"input"`
// 向量维度,默认为 2048。
// Embedding-3 模型支持自定义向量维度,建议选择 256、512、1024、2048 维度
Dimensions public.EmbeddingDimensions `json:"dimensions,omitempty"`
}
请求对象
Click to show internal directories.
Click to hide internal directories.