Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 9 additions & 6 deletions client/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading