AI -> Agent
Delete AI Chat History
API Documentation
Organization -> Organizations
Organization -> Workspaces
Organization -> Projects
Projects (Deprecated)
Projects -> Api Key
Connections
Data -> Catalogs
Data -> Internal Tables
Data -> Queries
Data -> Semantic Catalogs
Data -> Cache
Embedded Peaka Api
Supported Drivers
Data -> Metadata
- PUTUpdate Metadata
- PUTUpdate Relation From Metadata
- DELDelete Relation From Metadata
- PUTGenerate categorical values from the the column.
- POSTGenerate semantics for the table
- POSTAdd Relation To Metadata
- GETList of golden sqls for the project.
- POSTCreate golden sql for the project
- GETGet Project Metadata
- GETGet Project Catalog Metadata Relations
- GETGenerate sample ai questions for the project
- DELDelete golden sql from the project.
AI -> Agent
Delete AI Chat History
DELETE
/
ai
/
{projectId}
/
agent
/
history
/
{threadId}
Copy
curl --request DELETE \
--url https://partner.peaka.studio/api/v1/ai/{projectId}/agent/history/{threadId} \
--header 'Authorization: Bearer <token>'
Copy
{
"history": [
{
"id": "def9ccc7-a791-42f9-b40f-47679cde3b12",
"aiThreadId": "2183372c-7b72-479a-9eec-dd29aafa255b",
"displayName": "What are the top 3 portfolios ranked by their total market value as of the most recent date recorded?",
"tasks": [
{
"step": [
{
"action": {
"log": "The first example is very similar to the current question. I will use the SQL query from that example and modify it to fit the current question, ensuring it retrieves the top 3 portfolios ranked by their total market value as of the most recent date recorded.\n\nAction: table-name-semantic-search-tool\nAction Input: portfolios, market value, date",
"tool": "table-name-semantic-search-tool",
"toolInput": "portfolios, market value, date"
},
"observation": "supabase.public.portfolios,supabase.public.holdings,supabase.public.currencies,supabase.public.assets,supabase.public.assetclasses,supabase.public.assettypes,supabase.public.exchanges,supabase.public.transactiontypes,supabase.public.transactions,supabase.realtime.schema_migrations"
}
],
"output": {
"data": [
[
{
"name": "portfolio_name",
"order": 0,
"value": "102296_9",
"dataType": "varchar"
},
{
"name": "total_market_value",
"order": 1,
"value": 1887237400,
"dataType": "real"
}
]
],
"text": "The top 3 portfolios ranked by their total market value as of the most recent date recorded are: Portfolio '102296_9' with a total market value of 1,887,237,400, Portfolio '103100_7' with a total market value of 6,269,447.5, and Portfolio '103271_3' with a total market value of 2,563,462.8.",
"query": "WITH LatestDate AS ( SELECT MAX(\"date\") AS \"latest_date\" FROM \"supabase\".\"public\".\"holdings\" ) SELECT h.\"portfolio_name\", SUM(h.\"ending_market_value\") AS \"total_market_value\" FROM \"supabase\".\"public\".\"holdings\" h JOIN LatestDate ld ON h.\"date\" = ld.\"latest_date\" GROUP BY h.\"portfolio_name\" ORDER BY \"total_market_value\" DESC LIMIT 5"
},
"message": "What are the top 3 portfolios ranked by their total market value as of the most recent date recorded?",
"modelParams": {
"modelName": "gpt-4o",
"temperature": 0
}
}
],
"source": "API_KEY"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Response
200 - application/json
Delete AI Chat History
Represents the response containing AI chat history.
The list of AI chat history records.
Represents the chat history associated with a project and AI thread.
Copy
curl --request DELETE \
--url https://partner.peaka.studio/api/v1/ai/{projectId}/agent/history/{threadId} \
--header 'Authorization: Bearer <token>'
Copy
{
"history": [
{
"id": "def9ccc7-a791-42f9-b40f-47679cde3b12",
"aiThreadId": "2183372c-7b72-479a-9eec-dd29aafa255b",
"displayName": "What are the top 3 portfolios ranked by their total market value as of the most recent date recorded?",
"tasks": [
{
"step": [
{
"action": {
"log": "The first example is very similar to the current question. I will use the SQL query from that example and modify it to fit the current question, ensuring it retrieves the top 3 portfolios ranked by their total market value as of the most recent date recorded.\n\nAction: table-name-semantic-search-tool\nAction Input: portfolios, market value, date",
"tool": "table-name-semantic-search-tool",
"toolInput": "portfolios, market value, date"
},
"observation": "supabase.public.portfolios,supabase.public.holdings,supabase.public.currencies,supabase.public.assets,supabase.public.assetclasses,supabase.public.assettypes,supabase.public.exchanges,supabase.public.transactiontypes,supabase.public.transactions,supabase.realtime.schema_migrations"
}
],
"output": {
"data": [
[
{
"name": "portfolio_name",
"order": 0,
"value": "102296_9",
"dataType": "varchar"
},
{
"name": "total_market_value",
"order": 1,
"value": 1887237400,
"dataType": "real"
}
]
],
"text": "The top 3 portfolios ranked by their total market value as of the most recent date recorded are: Portfolio '102296_9' with a total market value of 1,887,237,400, Portfolio '103100_7' with a total market value of 6,269,447.5, and Portfolio '103271_3' with a total market value of 2,563,462.8.",
"query": "WITH LatestDate AS ( SELECT MAX(\"date\") AS \"latest_date\" FROM \"supabase\".\"public\".\"holdings\" ) SELECT h.\"portfolio_name\", SUM(h.\"ending_market_value\") AS \"total_market_value\" FROM \"supabase\".\"public\".\"holdings\" h JOIN LatestDate ld ON h.\"date\" = ld.\"latest_date\" GROUP BY h.\"portfolio_name\" ORDER BY \"total_market_value\" DESC LIMIT 5"
},
"message": "What are the top 3 portfolios ranked by their total market value as of the most recent date recorded?",
"modelParams": {
"modelName": "gpt-4o",
"temperature": 0
}
}
],
"source": "API_KEY"
}
]
}