feat: add DigitalOcean Create Knowledge Base component#3896
feat: add DigitalOcean Create Knowledge Base component#3896
Conversation
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
|
👋 Commands for maintainers:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Unused
ListKnowledgeBasesfunction is dead code- Removed the unused exported
ListKnowledgeBasesmethod from the DigitalOcean client.
- Removed the unused exported
- ✅ Fixed: Unused
CreateKnowledgeBaseOutputtype is dead code- Removed the unused exported
CreateKnowledgeBaseOutputinterface from the DigitalOcean workflow mapper types.
- Removed the unused exported
Or push these changes by commenting:
@cursor push f4ce97b40e
Preview (f4ce97b40e)
diff --git a/pkg/integrations/digitalocean/client.go b/pkg/integrations/digitalocean/client.go
--- a/pkg/integrations/digitalocean/client.go
+++ b/pkg/integrations/digitalocean/client.go
@@ -2453,25 +2453,6 @@
return &response.KnowledgeBase, nil
}
-// ListKnowledgeBases retrieves all knowledge bases in the account
-func (c *Client) ListKnowledgeBases() ([]KnowledgeBase, error) {
- url := fmt.Sprintf("%s/gen-ai/knowledge_bases?per_page=200", c.BaseURL)
- responseBody, err := c.execRequest(http.MethodGet, url, nil)
- if err != nil {
- return nil, err
- }
-
- var response struct {
- KnowledgeBases []KnowledgeBase `json:"knowledge_bases"`
- }
-
- if err := json.Unmarshal(responseBody, &response); err != nil {
- return nil, fmt.Errorf("error parsing response: %v", err)
- }
-
- return response.KnowledgeBases, nil
-}
-
// AppNodeMetadata stores metadata about an app for display in the UI
type AppNodeMetadata struct {
AppID string `json:"appId" mapstructure:"appId"`
diff --git a/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts b/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts
--- a/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts
+++ b/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts
@@ -255,14 +255,3 @@
parentChunkSize?: number;
childChunkSize?: number;
}
-
-export interface CreateKnowledgeBaseOutput {
- uuid?: string;
- name?: string;
- region?: string;
- embeddingModelUUID?: string;
- projectId?: string;
- databaseId?: string;
- tags?: string[];
- createdAt?: string;
-}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| } | ||
|
|
||
| return response.KnowledgeBases, nil | ||
| } |
There was a problem hiding this comment.
Unused ListKnowledgeBases function is dead code
Low Severity
ListKnowledgeBases is a new exported method added in this PR but has zero callers anywhere in the codebase. It's not referenced in list_resources.go, not used in create_knowledge_base.go, and not called from any other file. This is dead code that adds maintenance burden without providing value.
| databaseId?: string; | ||
| tags?: string[]; | ||
| createdAt?: string; | ||
| } |
There was a problem hiding this comment.
Unused CreateKnowledgeBaseOutput type is dead code
Low Severity
CreateKnowledgeBaseOutput is an exported interface that is never imported or referenced anywhere in the codebase. The mapper in create_knowledge_base.ts accesses output data using Record<string, unknown> casts instead. This is unused dead code.
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>



Description
Adds a Create Knowledge Base component for the DigitalOcean Gradient AI Platform, allowing users to automate knowledge base creation for use with AI agents via RAG.
Component