feat(copilot): move provider configuration to settings
This commit is contained in:
@@ -30,7 +30,7 @@ func NewCaptainTaskHandler(svc *service.CaptainTaskService) *CaptainTaskHandler
|
||||
// ReplySuggestion generates AI-powered reply suggestions for a conversation.
|
||||
// POST /api/v1/accounts/:account_id/captain/tasks/reply_suggestion
|
||||
func (h *CaptainTaskHandler) ReplySuggestion(c *gin.Context) {
|
||||
accountID, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
accountID, err := strconv.ParseUint(c.Param("account_id"), 10, 64)
|
||||
if err != nil {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid account_id")
|
||||
return
|
||||
@@ -55,7 +55,7 @@ func (h *CaptainTaskHandler) ReplySuggestion(c *gin.Context) {
|
||||
// Summarize generates a concise summary of a conversation.
|
||||
// POST /api/v1/accounts/:account_id/captain/tasks/summarize
|
||||
func (h *CaptainTaskHandler) Summarize(c *gin.Context) {
|
||||
accountID, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
accountID, err := strconv.ParseUint(c.Param("account_id"), 10, 64)
|
||||
if err != nil {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid account_id")
|
||||
return
|
||||
@@ -80,7 +80,7 @@ func (h *CaptainTaskHandler) Summarize(c *gin.Context) {
|
||||
// Rewrite rewrites a draft message to improve tone, clarity, or language.
|
||||
// POST /api/v1/accounts/:account_id/captain/tasks/rewrite
|
||||
func (h *CaptainTaskHandler) Rewrite(c *gin.Context) {
|
||||
accountID, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
accountID, err := strconv.ParseUint(c.Param("account_id"), 10, 64)
|
||||
if err != nil {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid account_id")
|
||||
return
|
||||
@@ -107,9 +107,9 @@ func (h *CaptainTaskHandler) Rewrite(c *gin.Context) {
|
||||
// following the same SSE pattern as SSEStreamHandler.StreamCopilotMessage.
|
||||
|
||||
// StreamReplySuggestion streams AI-powered reply suggestions via SSE.
|
||||
// POST /api/v1/accounts/:id/captain/tasks/reply_suggestion/stream
|
||||
// POST /api/v1/accounts/:account_id/captain/tasks/reply_suggestion/stream
|
||||
func (h *CaptainTaskHandler) StreamReplySuggestion(c *gin.Context) {
|
||||
accountID, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
accountID, err := strconv.ParseUint(c.Param("account_id"), 10, 64)
|
||||
if err != nil {
|
||||
captainWriteSSEError(c, http.StatusBadRequest, "invalid account_id")
|
||||
return
|
||||
@@ -149,9 +149,9 @@ func (h *CaptainTaskHandler) StreamReplySuggestion(c *gin.Context) {
|
||||
}
|
||||
|
||||
// StreamSummarize streams a conversation summary via SSE.
|
||||
// POST /api/v1/accounts/:id/captain/tasks/summarize/stream
|
||||
// POST /api/v1/accounts/:account_id/captain/tasks/summarize/stream
|
||||
func (h *CaptainTaskHandler) StreamSummarize(c *gin.Context) {
|
||||
accountID, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
accountID, err := strconv.ParseUint(c.Param("account_id"), 10, 64)
|
||||
if err != nil {
|
||||
captainWriteSSEError(c, http.StatusBadRequest, "invalid account_id")
|
||||
return
|
||||
@@ -191,9 +191,9 @@ func (h *CaptainTaskHandler) StreamSummarize(c *gin.Context) {
|
||||
}
|
||||
|
||||
// StreamRewrite streams a rewritten message via SSE.
|
||||
// POST /api/v1/accounts/:id/captain/tasks/rewrite/stream
|
||||
// POST /api/v1/accounts/:account_id/captain/tasks/rewrite/stream
|
||||
func (h *CaptainTaskHandler) StreamRewrite(c *gin.Context) {
|
||||
accountID, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
accountID, err := strconv.ParseUint(c.Param("account_id"), 10, 64)
|
||||
if err != nil {
|
||||
captainWriteSSEError(c, http.StatusBadRequest, "invalid account_id")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user