v1

package
v0.0.0-...-c20d9b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

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 (*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端语义搜索请求

type Query

type Query struct {
	Name        string `json:"name,omitempty"`        // 代码片段名称(可选)
	SnippetType string `json:"snippetType,omitempty"` // 代码片段类型(可选)
	Language    string `json:"language,omitempty"`    // 编程语言(可选)
}

Query 批量查询条件

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL