mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-06-04 13:30:32 +08:00
fix type
This commit is contained in:
@@ -90,8 +90,8 @@ func ExampleUsage() {
|
||||
fmt.Println("\n3. Creating model...")
|
||||
modelRequest := &CreateModelRequest{
|
||||
Name: "Test Model",
|
||||
Type: ModelTypeChat,
|
||||
Source: ModelSourceInternal,
|
||||
Type: ModelTypeKnowledgeQA,
|
||||
Source: ModelSourceLocal,
|
||||
Description: "This is a test model",
|
||||
Parameters: ModelParameters{
|
||||
"temperature": 0.7,
|
||||
|
||||
@@ -10,12 +10,40 @@ import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// ModelType model type
|
||||
// ModelType represents the type of AI model
|
||||
type ModelType string
|
||||
|
||||
// ModelSource model source
|
||||
const (
|
||||
ModelTypeEmbedding ModelType = "Embedding" // Embedding model
|
||||
ModelTypeRerank ModelType = "Rerank" // Rerank model
|
||||
ModelTypeKnowledgeQA ModelType = "KnowledgeQA" // KnowledgeQA model
|
||||
ModelTypeVLLM ModelType = "VLLM" // VLLM model
|
||||
ModelTypeASR ModelType = "ASR" // ASR (Automatic Speech Recognition) model
|
||||
)
|
||||
|
||||
// ModelSource represents the source of the model
|
||||
type ModelSource string
|
||||
|
||||
const (
|
||||
ModelSourceLocal ModelSource = "local" // Local model
|
||||
ModelSourceRemote ModelSource = "remote" // Remote model
|
||||
ModelSourceAliyun ModelSource = "aliyun" // Aliyun DashScope model
|
||||
ModelSourceZhipu ModelSource = "zhipu" // Zhipu model
|
||||
ModelSourceVolcengine ModelSource = "volcengine" // Volcengine model
|
||||
ModelSourceDeepseek ModelSource = "deepseek" // Deepseek model
|
||||
ModelSourceHunyuan ModelSource = "hunyuan" // Hunyuan model
|
||||
ModelSourceMinimax ModelSource = "minimax" // Minimax mode
|
||||
ModelSourceOpenAI ModelSource = "openai" // OpenAI model
|
||||
ModelSourceGemini ModelSource = "gemini" // Gemini model
|
||||
ModelSourceMimo ModelSource = "mimo" // Mimo model
|
||||
ModelSourceSiliconFlow ModelSource = "siliconflow" // SiliconFlow model
|
||||
ModelSourceJina ModelSource = "jina" // Jina AI model
|
||||
ModelSourceOpenRouter ModelSource = "openrouter" // OpenRouter model
|
||||
ModelSourceNvidia ModelSource = "nvidia" // NVIDIA model
|
||||
ModelSourceNovita ModelSource = "novita" // Novita AI model
|
||||
ModelSourceAzureOpenAI ModelSource = "azure_openai" // Azure OpenAI model
|
||||
)
|
||||
|
||||
// ModelParameters model parameters
|
||||
type ModelParameters map[string]interface{}
|
||||
|
||||
@@ -63,20 +91,6 @@ type ModelListResponse struct {
|
||||
Data []Model `json:"data"`
|
||||
}
|
||||
|
||||
// Model type constants
|
||||
const (
|
||||
ModelTypeEmbedding ModelType = "embedding"
|
||||
ModelTypeChat ModelType = "chat"
|
||||
ModelTypeRerank ModelType = "rerank"
|
||||
ModelTypeSummary ModelType = "summary"
|
||||
)
|
||||
|
||||
// Model source constants
|
||||
const (
|
||||
ModelSourceInternal ModelSource = "internal"
|
||||
ModelSourceExternal ModelSource = "external"
|
||||
)
|
||||
|
||||
// CreateModel creates a model
|
||||
func (c *Client) CreateModel(ctx context.Context, request *CreateModelRequest) (*Model, error) {
|
||||
resp, err := c.doRequest(ctx, http.MethodPost, "/api/v1/models", request, nil)
|
||||
@@ -190,4 +204,4 @@ func (c *Client) ListModelProviders(ctx context.Context, modelType string) ([]Mo
|
||||
}
|
||||
|
||||
return response.Data, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user