57 lines
1.5 KiB
Go
57 lines
1.5 KiB
Go
package dto
|
|
|
|
import (
|
|
"rag-local/kb/model/entity"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
type ListModelConfigReq struct {
|
|
g.Meta `path:"/list" method:"get" tags:"模型配置" summary:"模型配置列表"`
|
|
ModelType string `json:"model_type"`
|
|
}
|
|
|
|
type ListModelConfigRes struct {
|
|
List []*entity.ModelConfig `json:"list"`
|
|
}
|
|
|
|
type SaveModelConfigReq struct {
|
|
g.Meta `path:"/save" method:"post" tags:"模型配置" summary:"保存模型配置"`
|
|
Id int64 `json:"id"`
|
|
Name string `v:"required" json:"name"`
|
|
ModelType string `v:"required|in:chat,embedding" json:"model_type"`
|
|
ModelName string `v:"required" json:"model_name"`
|
|
EndpointUrl string `json:"endpoint_url"`
|
|
ApiKey string `json:"api_key"`
|
|
Dimension int `json:"dimension"`
|
|
Extra string `json:"extra"`
|
|
}
|
|
|
|
type SaveModelConfigRes struct {
|
|
Id int64 `json:"id"`
|
|
}
|
|
|
|
type DeleteModelConfigReq struct {
|
|
g.Meta `path:"/delete" method:"post" tags:"模型配置" summary:"删除模型配置"`
|
|
Id int64 `v:"required" json:"id"`
|
|
}
|
|
|
|
type DeleteModelConfigRes struct{}
|
|
|
|
type SetDefaultModelConfigReq struct {
|
|
g.Meta `path:"/set-default" method:"post" tags:"模型配置" summary:"设为默认模型"`
|
|
Id int64 `v:"required" json:"id"`
|
|
}
|
|
|
|
type SetDefaultModelConfigRes struct{}
|
|
|
|
type TestModelConfigReq struct {
|
|
g.Meta `path:"/test" method:"post" tags:"模型配置" summary:"连通性测试"`
|
|
Id int64 `v:"required" json:"id"`
|
|
}
|
|
|
|
type TestModelConfigRes struct {
|
|
Ok bool `json:"ok"`
|
|
Msg string `json:"msg"`
|
|
}
|