feat: add DigitalOcean Gradient AI components#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.
Autofix Details
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.
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
…tput Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
…e knowledge base Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
…etachKnowledgeBase components Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
…ata resolution Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
|
✅ Ephemeral machine has been terminated. |
|
/sp start |
|
✅ Ready. Web: https://pr-3896-ephemeral.superplane.com |
|
/sp stop |
|
✅ Ephemeral machine has been terminated. |
|
@forestileao, I have a few more changes to make — will let you know when it's ready for review! |
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
|
@forestileao changes are done, ready for review! |
|
@gaga1307 please fix eslint and formatting issues |
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Godoc comment attached to wrong function
- Moved the
resolveDisplayNamesgodoc comment to sit directly above its function so it no longer incorrectly documentsmergeCreateKBOutputFromFetchedKB.
- Moved the
Or push these changes by commenting:
@cursor push 89fbf1a3d8
Preview (89fbf1a3d8)
diff --git a/pkg/integrations/digitalocean/create_knowledge_base.go b/pkg/integrations/digitalocean/create_knowledge_base.go
--- a/pkg/integrations/digitalocean/create_knowledge_base.go
+++ b/pkg/integrations/digitalocean/create_knowledge_base.go
@@ -344,9 +344,6 @@
return ctx.Requests.ScheduleActionCall("poll", map[string]any{}, kbPollInterval)
}
-// resolveDisplayNames enriches the output map with human-readable names for
-// the embedding model, project, and OpenSearch database. Failures are ignored
-// so a lookup error never blocks the execution result.
// mergeCreateKBOutputFromFetchedKB updates the Execute-time output map with fields that the create
// response may omit until async provisioning finishes (e.g. databaseId for a newly created OpenSearch cluster).
func mergeCreateKBOutputFromFetchedKB(output map[string]any, kb *KnowledgeBase) {
@@ -358,6 +355,9 @@
}
}
+// resolveDisplayNames enriches the output map with human-readable names for
+// the embedding model, project, and OpenSearch database. Failures are ignored
+// so a lookup error never blocks the execution result.
func resolveDisplayNames(client *Client, spec CreateKnowledgeBaseSpec, output map[string]any) {
if models, err := client.ListEmbeddingModels(); err == nil {
for _, m := range models {This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
|
@forestileao fixed lint and formatting issues. CI is now passing. |
forestileao
left a comment
There was a problem hiding this comment.
Requested changes related more to code consistency.
Please also add frontent tests for the mappers using vitest. It should test if there are no undefined TypeError that might happen. WE have examples in the code base.
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
…Base Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 252bfd8. Configure here.
|
@forestileao I’ve addressed the requested changes regarding code consistency, naming, response structure, and reduced nesting. I also added frontend tests for the mappers using Vitest. |


Summary
Adds five new DigitalOcean Gradient AI components for managing knowledge bases and running agent evaluations.
New Components
Create Knowledge Base (
digitalocean.createKnowledgeBase)Creates a new knowledge base on the Gradient AI Platform for use with AI agents via retrieval-augmented generation (RAG). A knowledge base converts data sources into vector embeddings using the selected embedding model, stored in an OpenSearch database.
Attach Knowledge Base (
digitalocean.attachKnowledgeBase)Connects a knowledge base to a Gradient AI agent, enabling RAG. Useful for wiring up a newly created KB, blue/green KB deployments, or adding additional knowledge bases to an agent. The KB selector dynamically filters to only show knowledge bases not already attached to the selected agent.
Detach Knowledge Base (
digitalocean.detachKnowledgeBase)Removes a knowledge base from a Gradient AI agent. Useful for rollbacks, cleanup before attaching a fresh KB, or rotation as part of a blue/green pipeline. The KB selector dynamically filters to only show knowledge bases currently attached to the selected agent.
Delete Knowledge Base (
digitalocean.deleteKnowledgeBase)Deletes a knowledge base and optionally its associated OpenSearch database. Fetches the database ID before deletion so it can clean up both resources in one step. Deletion is idempotent — already-removed resources are handled gracefully. Output includes confirmation of what was deleted (KB only, or KB + database).
Run Evaluation (
digitalocean.runEvaluation)Runs a pre-configured evaluation test case against an agent, polls every 30s until completion (typically 1–5 minutes), and routes to Passed or Failed output channels based on the result.
UI
evaluation_test_case,agent,embedding_model,project,opensearch_database,knowledge_base,spaces_bucket,agent_knowledge_base, andagent_available_knowledge_baseTests
Unit tests covering Setup validation, Execute, and HandleAction for all components.