refactor: Unify /url route and file URL handling
This commit is contained in:
@@ -23,22 +23,13 @@ type KnowledgeService interface {
|
||||
tagID string,
|
||||
) (*types.Knowledge, error)
|
||||
// CreateKnowledgeFromURL creates knowledge from a URL.
|
||||
// When fileName or fileType is provided (or the URL path has a known file extension),
|
||||
// the URL is treated as a direct file download instead of a web page crawl.
|
||||
// tagID is optional - when provided, the knowledge will be assigned to the specified tag/category.
|
||||
CreateKnowledgeFromURL(
|
||||
ctx context.Context,
|
||||
kbID string,
|
||||
url string,
|
||||
enableMultimodel *bool,
|
||||
title string,
|
||||
tagID string,
|
||||
) (*types.Knowledge, error)
|
||||
// CreateKnowledgeFromFileURL creates knowledge by downloading a file from a remote URL.
|
||||
// fileName and fileType are optional - when not provided, they will be inferred from the URL or Content-Disposition header.
|
||||
// tagID is optional - when provided, the knowledge will be assigned to the specified tag/category.
|
||||
CreateKnowledgeFromFileURL(
|
||||
ctx context.Context,
|
||||
kbID string,
|
||||
fileURL string,
|
||||
fileName string,
|
||||
fileType string,
|
||||
enableMultimodel *bool,
|
||||
|
||||
Reference in New Issue
Block a user