feat: 支持向 FAQ 条目添加相似问

This commit is contained in:
wizardchen
2026-01-12 15:02:45 +08:00
parent 14d7d3d995
commit 9338603c20
5 changed files with 240 additions and 0 deletions
+23
View File
@@ -263,6 +263,29 @@ func (c *Client) UpdateFAQEntry(ctx context.Context,
return response.Data, nil
}
// AddSimilarQuestionsPayload is used to add similar questions to a FAQ entry.
type AddSimilarQuestionsPayload struct {
SimilarQuestions []string `json:"similar_questions"`
}
// AddSimilarQuestions adds similar questions to a FAQ entry.
// This will append the new questions to the existing similar questions list.
func (c *Client) AddSimilarQuestions(ctx context.Context,
knowledgeBaseID string, entrySeqID int64, payload *AddSimilarQuestionsPayload,
) (*FAQEntry, error) {
path := fmt.Sprintf("/api/v1/knowledge-bases/%s/faq/entries/%d/similar-questions", knowledgeBaseID, entrySeqID)
resp, err := c.doRequest(ctx, http.MethodPost, path, payload, nil)
if err != nil {
return nil, err
}
var response FAQEntryResponse
if err := parseResponse(resp, &response); err != nil {
return nil, err
}
return response.Data, nil
}
// UpdateFAQEntryFieldsBatch updates multiple fields for FAQ entries in bulk.
// Supports updating is_enabled, is_recommended, tag_id in a single call.
// Supports two modes: