diff --git a/client/README.md b/client/README.md index c9022b6cdbd..8e2a4c5324a 100644 --- a/client/README.md +++ b/client/README.md @@ -250,18 +250,21 @@ err = agentSession.Ask(context.Background(), "什么是深度学习?", ### 示例:管理模型 +将模型名、接口地址和密钥替换为实际服务配置。聊天模型类型为 `KnowledgeQA`;HTTP 模型服务使用 `remote` 来源。 + ```go // 创建模型 modelRequest := &client.CreateModelRequest{ - Name: "测试模型", - Type: client.ModelTypeChat, - Source: client.ModelSourceInternal, + Name: "your-chat-model-name", + DisplayName: "聊天模型", + Type: client.ModelTypeKnowledgeQA, + Source: client.ModelSourceRemote, Description: "这是一个测试模型", Parameters: client.ModelParameters{ - "temperature": 0.7, - "top_p": 0.9, + "provider": "generic", + "base_url": "https://your-model-service.example/v1", + "api_key": "your-provider-api-key", }, - IsDefault: true, } model, err := apiClient.CreateModel(context.Background(), modelRequest) if err != nil { diff --git a/client/README_EN.md b/client/README_EN.md index e4913796121..c4fa635e20c 100644 --- a/client/README_EN.md +++ b/client/README_EN.md @@ -147,18 +147,21 @@ if err != nil { ### Example: Managing Models +Replace the model name, endpoint and API key with your service configuration. Chat models use `KnowledgeQA`; HTTP model services use the `remote` source. + ```go // Create model modelRequest := &client.CreateModelRequest{ - Name: "Test Model", - Type: client.ModelTypeChat, - Source: client.ModelSourceInternal, + Name: "your-chat-model-name", + DisplayName: "Chat model", + Type: client.ModelTypeKnowledgeQA, + Source: client.ModelSourceRemote, Description: "This is a test model", Parameters: client.ModelParameters{ - "temperature": 0.7, - "top_p": 0.9, + "provider": "generic", + "base_url": "https://your-model-service.example/v1", + "api_key": "your-provider-api-key", }, - IsDefault: true, } model, err := apiClient.CreateModel(context.Background(), modelRequest) if err != nil {