Documentation
¶
Index ¶
- func BadRequest(c *web.Context, msg string) error
- type V1Handler
- func (h *V1Handler) AcceptCompletion(c *web.Context, req domain.AcceptCompletionReq) error
- func (h *V1Handler) ChatCompletion(c *web.Context) error
- func (h *V1Handler) Completions(c *web.Context) error
- func (h *V1Handler) CreateSecurityScanning(c *web.Context, req domain.CreateSecurityScanningReq) error
- func (h *V1Handler) Embeddings(c *web.Context) error
- func (h *V1Handler) GetConfig(c *web.Context, req domain.ConfigReq) error
- func (h *V1Handler) HealthCheck(c *web.Context) error
- func (h *V1Handler) ListSecurityScanning(c *web.Context, req domain.ListSecurityScanningReq) error
- func (h *V1Handler) ListSecurityScanningDetail(c *web.Context, req domain.ListSecurityScanningDetailReq) error
- func (h *V1Handler) ModelList(c *web.Context) error
- func (h *V1Handler) Report(c *web.Context, req domain.ReportReq) error
- func (h *V1Handler) Version(c *web.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type V1Handler ¶
type V1Handler struct {
// contains filtered or unexported fields
}
func NewV1Handler ¶
func NewV1Handler( logger *slog.Logger, w *web.Web, proxy *proxy.LLMProxy, proxyUse domain.ProxyUsecase, usecase domain.OpenAIUsecase, euse domain.ExtensionUsecase, uuse domain.UserUsecase, middleware *middleware.ProxyMiddleware, active *middleware.ActiveMiddleware, config *config.Config, ) *V1Handler
func (*V1Handler) AcceptCompletion ¶
AcceptCompletion 接受补全请求
@Tags OpenAIV1 @Summary 接受补全请求 @Description 接受补全请求 @ID accept-completion @Accept json @Produce json @Param param body domain.AcceptCompletionReq true "补全请求" @Success 200 {object} web.Resp{} @Router /v1/completion/accept [post]
func (*V1Handler) ChatCompletion ¶
ChatCompletion 处理聊天补全请求
@Tags OpenAIV1 @Summary 处理聊天补全请求 @Description 处理聊天补全请求 @ID chat-completion @Accept json @Produce json @Success 200 {object} web.Resp{} @Router /v1/chat/completions [post]
func (*V1Handler) Completions ¶
Completions 处理文本补全请求
@Tags OpenAIV1 @Summary 处理文本补全请求 @Description 处理文本补全请求 @ID completions @Accept json @Produce json @Success 200 {object} web.Resp{} @Router /v1/completions [post]
func (*V1Handler) CreateSecurityScanning ¶
func (h *V1Handler) CreateSecurityScanning(c *web.Context, req domain.CreateSecurityScanningReq) error
CreateSecurityScanning 创建扫描任务
@Tags OpenAIV1 @Summary 创建扫描任务 @Description 创建扫描任务 @ID create-security-scanning @Accept json @Produce json @Param param body domain.CreateSecurityScanningReq true "创建扫描任务请求" @Success 200 {object} web.Resp{} @Router /v1/security/scanning [post]
func (*V1Handler) Embeddings ¶
Embeddings 处理嵌入请求
@Tags OpenAIV1 @Summary 处理嵌入请求 @Description 处理嵌入请求 @ID embeddings @Accept json @Produce json @Success 200 {object} web.Resp{} @Router /v1/embeddings [post]
func (*V1Handler) HealthCheck ¶
HealthCheck 健康检查
@Tags OpenAIV1 @Summary 健康检查 @Description 固定回包 `{"code": 0, "data": "MonkeyCode"}` @ID health @Accept json @Produce json @Success 200 {object} web.Resp{} @Router /v1/health [get]
func (*V1Handler) ListSecurityScanning ¶
ListSecurityScanning 扫描任务列表
@Tags OpenAIV1 @Summary 扫描任务列表 @Description 扫描任务列表 @ID list-security-scanning @Accept json @Produce json @Param param body domain.ListSecurityScanningReq true "扫描任务列表请求" @Success 200 {object} web.Resp{data=domain.ListSecurityScanningBriefResp} @Router /v1/security/scanning [get]
func (*V1Handler) ListSecurityScanningDetail ¶
func (h *V1Handler) ListSecurityScanningDetail(c *web.Context, req domain.ListSecurityScanningDetailReq) error
ListSecurityScanningDetail 获取扫描任务风险详情列表
@Tags OpenAIV1 @Summary 获取扫描任务风险详情列表 @Description 分页只支持 next_token; 首页传空,后续判断has_next_page是否为true,传入回包给的next_token @ID list-security-scanning-detail @Accept json @Produce json @Param id query domain.ListSecurityScanningDetailReq true "扫描任务ID" @Success 200 {object} web.Resp{data=domain.ListSecurityScanningDetailResp} @Router /v1/security/scanning/detail [get]
func (*V1Handler) ModelList ¶
ModelList 模型列表
@Tags OpenAIV1 @Summary 模型列表 @Description 模型列表 @ID model-list @Accept json @Produce json @Success 200 {object} web.Resp{data=domain.ModelListResp} @Router /v1/models [get]
Click to show internal directories.
Click to hide internal directories.