feat: initial implementation of createAgent component#3832
Draft
feat: initial implementation of createAgent component#3832
Conversation
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
|
👋 Commands for maintainers:
|
…D in Create Agent 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #3766
The component creates and deploys a GradientAI agent as part of a workflow — it handles workspace assignment, optional provider API key registration (Anthropic/OpenAI), agent creation, deployment, and API key generation. It polls until the agent reaches running status and emits the agent object on the default output channel.
Execution Flow
Create workspace (if
workspaceSource = "new")POST /v2/gen-ai/workspacesRegister provider API key (if anthropicKey or openAIKey is set in the integration configuration)
POST /v2/gen-ai/anthropic/keys→ sets anthropic_key_uuidPOST /v2/gen-ai/openai/keys→ sets open_ai_key_uuidCreate agent →
POST /v2/gen-ai/agentsname,instruction,model_uuid,workspace_uuid,region,project_id,tags,knowledge_base_uuid, provider key UUIDUpdate settings (if
useDefaultSettings = false)PUT /v2/gen-ai/agents/{uuid}temperature,max_tokens,top_p,k,retrieval_method,provide_citationsAttach guardrails →
POST /v2/gen-ai/agents/{uuid}/guardrails(for each)Add agent routes →
POST /v2/gen-ai/agents/{uuid}/routes(for each child agent)Poll every 10s (up to 10min timeout)
Running/Active→ creates agent API key, stores in metadata, emits agent on default output channelError→ fails with errorOther→ schedules another pollKnown Issue
Execution fails at step 3 (Create agent) with:
Investigation
The same failure was reproduced with a direct curl call:
curl -X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"
"https://api.digitalocean.com/v2/gen-ai/agents"
-d '{
"name": "api-create",
"model_uuid": "95ea6652-75ed-11ef-bf8f-4e013e2ddde4",
"instruction": "be a weather reporter",
"description": "weather-agent",
"project_id": "37455431-84bd-4fa2-94cf-e8486f8f8c5e",
"tags": [
"tag1"
],
"region": "tor1",
}'
What Was Tried