Skip to content

Create

Add Function Route to an Agent
post/v2/gen-ai/agents/{agent_uuid}/functions

To create a function route for an agent, send a POST request to /v2/gen-ai/agents/{agent_uuid}/functions.

Path Parameters
agent_uuidstring
Body Parameters
agent_uuidstring
optional
descriptionstring
optional
faas_namestring
optional
faas_namespacestring
optional
function_namestring
optional
input_schemaunknown
optional
output_schemaunknown
optional
Returns
agentanthropic_api_keyAPIAnthropicAPIKeyInfoapi_key_infosarray of APIAgentAPIKeyInfoapi_keysarray of objectchatbotobjectchatbot_identifiersarray of objectchild_agentsarray of APIAgentcreated_atstringdeploymentobjectdescriptionstringfunctionsarray of objectguardrailsarray of objectif_casestringinstructionstringknumberknowledge_basesarray of APIKnowledgeBasemax_tokensnumbermodelAPIAgentModelnamestringopenai_api_keyAPIOpenAIAPIKeyInfoparent_agentsarray of APIAgentproject_idstringprovide_citationsbooleanregionstringretrieval_methodAPIRetrievalMethodroute_created_atstringroute_created_bystringroute_namestringroute_uuidstringtagsarray of stringtemperaturenumbertemplateobjecttop_pnumberupdated_atstringurlstringuser_idstringuuidstringworkspaceAPIWorkspaceAPIAgent
optional
Request example cURL
curl https://api.digitalocean.com//v2/gen-ai/agents/$AGENT_UUID/functions \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $GRADIENTAI_API_KEY" \
    -d '{}'
200 Example
{
  "agent": {
    "anthropic_api_key": {
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": "created_by",
      "deleted_at": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "uuid": "uuid"
    },
    "api_key_infos": [
      {
        "created_at": "2019-12-27T18:11:19.117Z",
        "created_by": "created_by",
        "deleted_at": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "secret_key": "secret_key",
        "uuid": "uuid"
      }
    ],
    "api_keys": [
      {
        "api_key": "api_key"
      }
    ],
    "chatbot": {
      "button_background_color": "button_background_color",
      "logo": "logo",
      "name": "name",
      "primary_color": "primary_color",
      "secondary_color": "secondary_color",
      "starting_message": "starting_message"
    },
    "chatbot_identifiers": [
      {
        "agent_chatbot_identifier": "agent_chatbot_identifier"
      }
    ],
    "child_agents": [],
    "created_at": "2019-12-27T18:11:19.117Z",
    "deployment": {
      "created_at": "2019-12-27T18:11:19.117Z",
      "name": "name",
      "status": "STATUS_UNKNOWN",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "url": "url",
      "uuid": "uuid",
      "visibility": "VISIBILITY_UNKNOWN"
    },
    "description": "description",
    "functions": [
      {
        "api_key": "api_key",
        "created_at": "2019-12-27T18:11:19.117Z",
        "created_by": "created_by",
        "description": "description",
        "faas_name": "faas_name",
        "faas_namespace": "faas_namespace",
        "input_schema": {},
        "name": "name",
        "output_schema": {},
        "updated_at": "2019-12-27T18:11:19.117Z",
        "url": "url",
        "uuid": "uuid"
      }
    ],
    "guardrails": [
      {
        "agent_uuid": "agent_uuid",
        "created_at": "2019-12-27T18:11:19.117Z",
        "default_response": "default_response",
        "description": "description",
        "guardrail_uuid": "guardrail_uuid",
        "is_attached": true,
        "is_default": true,
        "metadata": {},
        "name": "name",
        "priority": 0,
        "type": "GUARDRAIL_TYPE_UNKNOWN",
        "updated_at": "2019-12-27T18:11:19.117Z",
        "uuid": "uuid"
      }
    ],
    "if_case": "if_case",
    "instruction": "instruction",
    "k": 0,
    "knowledge_bases": [
      {
        "added_to_agent_at": "2019-12-27T18:11:19.117Z",
        "created_at": "2019-12-27T18:11:19.117Z",
        "database_id": "database_id",
        "embedding_model_uuid": "embedding_model_uuid",
        "is_public": true,
        "last_indexing_job": {
          "completed_datasources": 0,
          "created_at": "2019-12-27T18:11:19.117Z",
          "data_source_uuids": [
            "string"
          ],
          "finished_at": "2019-12-27T18:11:19.117Z",
          "knowledge_base_uuid": "knowledge_base_uuid",
          "phase": "BATCH_JOB_PHASE_UNKNOWN",
          "started_at": "2019-12-27T18:11:19.117Z",
          "status": "INDEX_JOB_STATUS_UNKNOWN",
          "tokens": 0,
          "total_datasources": 0,
          "updated_at": "2019-12-27T18:11:19.117Z",
          "uuid": "uuid"
        },
        "name": "name",
        "project_id": "project_id",
        "region": "region",
        "tags": [
          "string"
        ],
        "updated_at": "2019-12-27T18:11:19.117Z",
        "user_id": "user_id",
        "uuid": "uuid"
      }
    ],
    "max_tokens": 0,
    "model": {
      "agreement": {
        "description": "description",
        "name": "name",
        "url": "url",
        "uuid": "uuid"
      },
      "created_at": "2019-12-27T18:11:19.117Z",
      "inference_name": "inference_name",
      "inference_version": "inference_version",
      "is_foundational": true,
      "metadata": {},
      "name": "name",
      "parent_uuid": "parent_uuid",
      "provider": "MODEL_PROVIDER_DIGITALOCEAN",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "upload_complete": true,
      "url": "url",
      "usecases": [
        "MODEL_USECASE_UNKNOWN"
      ],
      "uuid": "uuid",
      "version": {
        "major": 0,
        "minor": 0,
        "patch": 0
      }
    },
    "name": "name",
    "openai_api_key": {
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": "created_by",
      "deleted_at": "2019-12-27T18:11:19.117Z",
      "models": [
        {
          "agreement": {
            "description": "description",
            "name": "name",
            "url": "url",
            "uuid": "uuid"
          },
          "created_at": "2019-12-27T18:11:19.117Z",
          "inference_name": "inference_name",
          "inference_version": "inference_version",
          "is_foundational": true,
          "metadata": {},
          "name": "name",
          "parent_uuid": "parent_uuid",
          "provider": "MODEL_PROVIDER_DIGITALOCEAN",
          "updated_at": "2019-12-27T18:11:19.117Z",
          "upload_complete": true,
          "url": "url",
          "usecases": [
            "MODEL_USECASE_UNKNOWN"
          ],
          "uuid": "uuid",
          "version": {
            "major": 0,
            "minor": 0,
            "patch": 0
          }
        }
      ],
      "name": "name",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "uuid": "uuid"
    },
    "parent_agents": [],
    "project_id": "project_id",
    "provide_citations": true,
    "region": "region",
    "retrieval_method": "RETRIEVAL_METHOD_UNKNOWN",
    "route_created_at": "2019-12-27T18:11:19.117Z",
    "route_created_by": "route_created_by",
    "route_name": "route_name",
    "route_uuid": "route_uuid",
    "tags": [
      "string"
    ],
    "temperature": 0,
    "template": {
      "created_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "guardrails": [
        {
          "priority": 0,
          "uuid": "uuid"
        }
      ],
      "instruction": "instruction",
      "k": 0,
      "knowledge_bases": [
        {
          "added_to_agent_at": "2019-12-27T18:11:19.117Z",
          "created_at": "2019-12-27T18:11:19.117Z",
          "database_id": "database_id",
          "embedding_model_uuid": "embedding_model_uuid",
          "is_public": true,
          "last_indexing_job": {
            "completed_datasources": 0,
            "created_at": "2019-12-27T18:11:19.117Z",
            "data_source_uuids": [
              "string"
            ],
            "finished_at": "2019-12-27T18:11:19.117Z",
            "knowledge_base_uuid": "knowledge_base_uuid",
            "phase": "BATCH_JOB_PHASE_UNKNOWN",
            "started_at": "2019-12-27T18:11:19.117Z",
            "status": "INDEX_JOB_STATUS_UNKNOWN",
            "tokens": 0,
            "total_datasources": 0,
            "updated_at": "2019-12-27T18:11:19.117Z",
            "uuid": "uuid"
          },
          "name": "name",
          "project_id": "project_id",
          "region": "region",
          "tags": [
            "string"
          ],
          "updated_at": "2019-12-27T18:11:19.117Z",
          "user_id": "user_id",
          "uuid": "uuid"
        }
      ],
      "long_description": "long_description",
      "max_tokens": 0,
      "model": {
        "agreement": {
          "description": "description",
          "name": "name",
          "url": "url",
          "uuid": "uuid"
        },
        "created_at": "2019-12-27T18:11:19.117Z",
        "inference_name": "inference_name",
        "inference_version": "inference_version",
        "is_foundational": true,
        "metadata": {},
        "name": "name",
        "parent_uuid": "parent_uuid",
        "provider": "MODEL_PROVIDER_DIGITALOCEAN",
        "updated_at": "2019-12-27T18:11:19.117Z",
        "upload_complete": true,
        "url": "url",
        "usecases": [
          "MODEL_USECASE_UNKNOWN"
        ],
        "uuid": "uuid",
        "version": {
          "major": 0,
          "minor": 0,
          "patch": 0
        }
      },
      "name": "name",
      "short_description": "short_description",
      "summary": "summary",
      "tags": [
        "string"
      ],
      "temperature": 0,
      "template_type": "AGENT_TEMPLATE_TYPE_STANDARD",
      "top_p": 0,
      "updated_at": "2019-12-27T18:11:19.117Z",
      "uuid": "uuid"
    },
    "top_p": 0,
    "updated_at": "2019-12-27T18:11:19.117Z",
    "url": "url",
    "user_id": "user_id",
    "uuid": "uuid"
  }
}