添加拒绝补全的路由

This commit is contained in:
AlanAlanAlanXu
2025-07-21 19:19:39 +08:00
parent 4e0070ede9
commit 8dd1eebf7f
3 changed files with 9 additions and 5 deletions

View File

@@ -6,4 +6,5 @@ const (
ReportActionAccept ReportAction = "accept"
ReportActionSuggest ReportAction = "suggest"
ReportActionFileWritten ReportAction = "file_written"
ReportActionReject ReportAction = "reject"
)

View File

@@ -45,10 +45,13 @@ type AcceptCompletionReq struct {
}
type ReportReq struct {
Action consts.ReportAction `json:"action"`
ID string `json:"id"` // task_id or resp_id
Content string `json:"content"` // 内容
Tool string `json:"tool"` // 工具
Action consts.ReportAction `json:"action"`
ID string `json:"id"` // task_id or resp_id
Content string `json:"content"` // 内容
Tool string `json:"tool"` // 工具
UserInput string `json:"user_input"` // 用户输入的新文本用于reject action
SourceCode string `json:"source_code"` // 当前文件的原文用于reject action
CursorPosition int64 `json:"cursor_position"` // 光标位置用于reject action
}
type RecordParam struct {

View File

@@ -101,7 +101,7 @@ func (h *V1Handler) AcceptCompletion(c *web.Context, req domain.AcceptCompletion
//
// @Tags OpenAIV1
// @Summary 报告
// @Description 报告
// @Description 报告支持多种操作accept接受补全、suggest建议、reject拒绝补全并记录用户输入、file_written文件写入
// @ID report
// @Accept json
// @Produce json