Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeSnippetHandler ¶
type CodeSnippetHandler struct {
// contains filtered or unexported fields
}
func NewCodeSnippetHandler ¶
func NewCodeSnippetHandler( w *web.Web, usecase domain.CodeSnippetUsecase, embeddingService service.EmbeddingService, auth *middleware.AuthMiddleware, active *middleware.ActiveMiddleware, readonly *middleware.ReadOnlyMiddleware, proxy *middleware.ProxyMiddleware, logger *slog.Logger, ) *CodeSnippetHandler
func (*CodeSnippetHandler) GetContext ¶
func (h *CodeSnippetHandler) GetContext(c *web.Context, req GetContextReq) error
GetContext IDE端上下文检索接口
@Tags CodeSnippet @Summary IDE端上下文检索 @Description 为IDE端提供代码片段上下文检索功能,使用API Key认证。支持单个查询和批量查询。 @ID get-context @Accept json @Produce json @Param request body GetContextReq true "检索请求参数" @Success 200 {object} web.Resp{data=[]domain.CodeSnippet} @Router /api/v1/ide/codesnippet/context [post] @Security ApiKeyAuth
func (*CodeSnippetHandler) GetSemanticContext ¶
func (h *CodeSnippetHandler) GetSemanticContext(c *web.Context, req GetSemanticContextReq) error
GetSemanticContext IDE端语义搜索接口
@Tags CodeSnippet @Summary IDE端语义搜索 @Description 为IDE端提供代码片段语义搜索功能,使用API Key认证。通过向量相似性搜索找到相关的代码片段。 @ID get-semantic-context @Accept json @Produce json @Param request body GetSemanticContextReq true "语义搜索请求参数" @Success 200 {object} web.Resp{data=[]domain.CodeSnippet} @Router /api/v1/ide/codesnippet/semantic [post] @Security ApiKeyAuth
type GetContextReq ¶
type GetContextReq struct { // 批量查询参数 Queries []Query `json:"queries,omitempty"` // 批量查询条件 // 单个查询参数 Query Query `json:"query,omitempty"` // 单个查询条件 Limit int `json:"limit"` // 返回结果数量限制,默认10 WorkspacePath string `json:"workspacePath"` // 工作区路径(必填) }
GetContextReq IDE端上下文检索请求
type GetSemanticContextReq ¶
type GetSemanticContextReq struct { Query string `json:"query"` // 搜索查询文本(必填) WorkspacePath string `json:"workspacePath"` // 工作区路径(必填) Limit int `json:"limit"` // 返回结果数量限制,默认10 }
GetSemanticContextReq IDE端语义搜索请求
Click to show internal directories.
Click to hide internal directories.