Example questions

Question and SQL pairs the agent learns from.

Base URL https://futuresmart.ai/database-agent/api · every request sends X-API-Key. Samples read the key from DATABASE_AGENT_API_KEY. All endpoints

Get All Few Shot Examples For Db

GET/v1/agents/{agent_id}/databases/{db_id}/few-shot-examples

Get all few-shot examples for an agent scoped to a specific database

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.get(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/few-shot-examples",
    headers={"X-API-Key": API_KEY},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Create Few Shot Examples For Db

POST/v1/agents/{agent_id}/databases/{db_id}/few-shot-examples

Upload/Create few-shot examples for an agent scoped to a specific database (bulk)

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Request body · multipart/form-data (optional)

NameTypeDescription
filestring | null
few_shot_examplesstring | null

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.post(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/few-shot-examples",
    headers={"X-API-Key": API_KEY},
    data={"file": "<file>", "few_shot_examples": "<few_shot_examples>"},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Update Few Shot Examples For Db

PUT/v1/agents/{agent_id}/databases/{db_id}/few-shot-examples

Update few-shot examples for an agent scoped to a specific database (bulk)

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Request body · multipart/form-data (optional)

NameTypeDescription
filestring | null
few_shot_examplesstring | null

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.put(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/few-shot-examples",
    headers={"X-API-Key": API_KEY},
    data={"file": "<file>", "few_shot_examples": "<few_shot_examples>"},
    timeout=120,
)
r.raise_for_status()
print(r.json())

Delete Few Shot Examples For Db

DELETE/v1/agents/{agent_id}/databases/{db_id}/few-shot-examples

Delete few-shot examples for an agent scoped to a specific database.

  • One or many: {"nl_queries": ["...", "..."]}
  • All: {"delete_all": true}

Credential Database Agent API key for this agent (X-API-Key)

Path parameters

NameTypeDescription
agent_idrequiredstringAgent ID
db_idrequiredstringDatabase ID

Request body · application/json

NameTypeDescription
nl_queriesarray<string> | nullNatural-language queries of the examples to delete
delete_allbooleanDelete ALL few-shot examples for this databaseDefault: false

Other responses

  • 422 Validation Error
import os
import requests

API_ROOT = "https://futuresmart.ai/database-agent/api"
API_KEY = os.environ["DATABASE_AGENT_API_KEY"]

r = requests.delete(
    f"{API_ROOT}/v1/agents/YOUR_AGENT_ID/databases/YOUR_DB_ID/few-shot-examples",
    headers={"X-API-Key": API_KEY},
    json={
        "delete_all": False,
    },
    timeout=120,
)
r.raise_for_status()
print(r.json())

Example request body

JSON
{
  "delete_all": false
}