Create AI Tables based on your Documents
https://cite.petal.org/api/ai/table/create
endpoint. In addition to the bearer token for authorization purposes, you will need to provide the following parameters:
private
or shared
. Determines whether other users in the Workspace can see this Tableid
field, the unique ID of your newly-created Table. Please note this ID now, as it will be needed to create columns within your Table.
https://cite.petal.org/api/ai/table/<id>/column/create
. You will need to fill in the <id>
with the ID of the Table in which you wish to create the column. In addition, when you make the POST request to this API, you will need to provide the following:
id
field, which you will need to note down, as this is the unique ID of the column and will be needed to create cells.
https://cite.petal.org/api/ai/table/<id>/run
endpoint to create cells and generate their contents using AI. In addition to the bearer token and the Table ID, you will need to provide the Document IDs and column IDs you want to generate cells and AI responses for. The IDs should be arranged in pairs, with the Document ID being the first item and the column ID the second.
See the sample code below. Remember to replace <token>
, <id>
, <document_id_#>
, and <column_id_#>
with your own values:
id
field will refer to the unique ID of the cell.
Depending on the number of queries, the AI may several seconds or minutes to generate responses for Table cells, so you should regularly poll the API for updates. Use the https://cite.petal.org/api/ai/table/<id>/cell/list
endpoint to fetch all cells within a given Table:
task_status
is success
, the AI has completed generating the response to the column’s query.