From a503b36011d67cf17d6e706bcb2a6eb16277e8d7 Mon Sep 17 00:00:00 2001 From: sarthak Date: Sat, 4 Apr 2026 12:49:56 +0530 Subject: [PATCH 1/3] wip --- src/lib/api-navigation.ts | 19 +- src/lib/navigation.ts | 65 +++++ .../api/dataset-evals/add-dataset-eval.mdx | 248 +++++++++++++++++ .../create-custom-eval-template.mdx | 233 ++++++++++++++++ .../api/dataset-evals/delete-dataset-eval.mdx | 142 ++++++++++ .../api/dataset-evals/edit-and-run-eval.mdx | 232 ++++++++++++++++ .../api/dataset-evals/get-eval-metrics.mdx | 160 +++++++++++ .../api/dataset-evals/get-eval-structure.mdx | 166 ++++++++++++ .../dataset-evals/get-eval-template-names.mdx | 133 ++++++++++ .../api/dataset-evals/list-dataset-evals.mdx | 154 +++++++++++ .../api/dataset-evals/start-evals-process.mdx | 154 +++++++++++ src/pages/docs/api/datasets/add-as-new.mdx | 172 ++++++++++++ .../docs/api/datasets/add-empty-rows.mdx | 144 ++++++++++ .../api/datasets/add-rows-from-existing.mdx | 178 +++++++++++++ .../docs/api/datasets/add-rows-from-file.mdx | 139 ++++++++++ .../datasets/add-rows-from-huggingface.mdx | 176 ++++++++++++ .../datasets/analytics/annotation-summary.mdx | 134 ++++++++++ .../api/datasets/analytics/eval-stats.mdx | 139 ++++++++++ .../analytics/explanation-summary.mdx | 166 ++++++++++++ .../datasets/analytics/run-prompt-stats.mdx | 131 +++++++++ src/pages/docs/api/datasets/clone-dataset.mdx | 144 ++++++++++ .../docs/api/datasets/columns/add-columns.mdx | 184 +++++++++++++ .../columns/add-multiple-static-columns.mdx | 180 +++++++++++++ .../datasets/columns/add-static-column.mdx | 150 +++++++++++ .../api/datasets/columns/delete-column.mdx | 104 ++++++++ .../datasets/columns/get-column-config.mdx | 148 +++++++++++ .../datasets/columns/get-column-details.mdx | 132 +++++++++ .../datasets/columns/update-column-name.mdx | 136 ++++++++++ .../datasets/columns/update-column-type.mdx | 205 ++++++++++++++ .../create-dataset-from-huggingface.mdx | 177 ++++++++++++ .../api/datasets/create-empty-dataset.mdx | 152 +++++++++++ .../docs/api/datasets/delete-dataset.mdx | 135 ++++++++++ src/pages/docs/api/datasets/delete-rows.mdx | 151 +++++++++++ .../docs/api/datasets/duplicate-dataset.mdx | 166 ++++++++++++ .../docs/api/datasets/duplicate-rows.mdx | 166 ++++++++++++ src/pages/docs/api/datasets/get-dataset.mdx | 122 +++++++++ src/pages/docs/api/datasets/list-datasets.mdx | 150 +++++++++++ src/pages/docs/api/datasets/merge-dataset.mdx | 163 ++++++++++++ .../run-prompt/add-run-prompt-column.mdx | 251 ++++++++++++++++++ .../run-prompt/edit-run-prompt-column.mdx | 191 +++++++++++++ .../datasets/run-prompt/get-column-values.mdx | 182 +++++++++++++ .../datasets/run-prompt/get-model-voices.mdx | 130 +++++++++ .../retrieve-run-prompt-column-config.mdx | 153 +++++++++++ .../retrieve-run-prompt-options.mdx | 139 ++++++++++ .../api/datasets/run-prompt/tts-voices.mdx | 207 +++++++++++++++ .../docs/api/datasets/update-cell-value.mdx | 166 ++++++++++++ .../docs/api/datasets/update-dataset.mdx | 139 ++++++++++ .../docs/api/evals-list/getevalslist.mdx | 95 ++++--- 48 files changed, 7466 insertions(+), 37 deletions(-) create mode 100644 src/pages/docs/api/dataset-evals/add-dataset-eval.mdx create mode 100644 src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx create mode 100644 src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx create mode 100644 src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx create mode 100644 src/pages/docs/api/dataset-evals/get-eval-metrics.mdx create mode 100644 src/pages/docs/api/dataset-evals/get-eval-structure.mdx create mode 100644 src/pages/docs/api/dataset-evals/get-eval-template-names.mdx create mode 100644 src/pages/docs/api/dataset-evals/list-dataset-evals.mdx create mode 100644 src/pages/docs/api/dataset-evals/start-evals-process.mdx create mode 100644 src/pages/docs/api/datasets/add-as-new.mdx create mode 100644 src/pages/docs/api/datasets/add-empty-rows.mdx create mode 100644 src/pages/docs/api/datasets/add-rows-from-existing.mdx create mode 100644 src/pages/docs/api/datasets/add-rows-from-file.mdx create mode 100644 src/pages/docs/api/datasets/add-rows-from-huggingface.mdx create mode 100644 src/pages/docs/api/datasets/analytics/annotation-summary.mdx create mode 100644 src/pages/docs/api/datasets/analytics/eval-stats.mdx create mode 100644 src/pages/docs/api/datasets/analytics/explanation-summary.mdx create mode 100644 src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx create mode 100644 src/pages/docs/api/datasets/clone-dataset.mdx create mode 100644 src/pages/docs/api/datasets/columns/add-columns.mdx create mode 100644 src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx create mode 100644 src/pages/docs/api/datasets/columns/add-static-column.mdx create mode 100644 src/pages/docs/api/datasets/columns/delete-column.mdx create mode 100644 src/pages/docs/api/datasets/columns/get-column-config.mdx create mode 100644 src/pages/docs/api/datasets/columns/get-column-details.mdx create mode 100644 src/pages/docs/api/datasets/columns/update-column-name.mdx create mode 100644 src/pages/docs/api/datasets/columns/update-column-type.mdx create mode 100644 src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx create mode 100644 src/pages/docs/api/datasets/create-empty-dataset.mdx create mode 100644 src/pages/docs/api/datasets/delete-dataset.mdx create mode 100644 src/pages/docs/api/datasets/delete-rows.mdx create mode 100644 src/pages/docs/api/datasets/duplicate-dataset.mdx create mode 100644 src/pages/docs/api/datasets/duplicate-rows.mdx create mode 100644 src/pages/docs/api/datasets/get-dataset.mdx create mode 100644 src/pages/docs/api/datasets/list-datasets.mdx create mode 100644 src/pages/docs/api/datasets/merge-dataset.mdx create mode 100644 src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx create mode 100644 src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx create mode 100644 src/pages/docs/api/datasets/run-prompt/get-column-values.mdx create mode 100644 src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx create mode 100644 src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx create mode 100644 src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx create mode 100644 src/pages/docs/api/datasets/run-prompt/tts-voices.mdx create mode 100644 src/pages/docs/api/datasets/update-cell-value.mdx create mode 100644 src/pages/docs/api/datasets/update-dataset.mdx diff --git a/src/lib/api-navigation.ts b/src/lib/api-navigation.ts index 494bc69f..33c5d655 100644 --- a/src/lib/api-navigation.ts +++ b/src/lib/api-navigation.ts @@ -411,8 +411,25 @@ export const apiNavigation: ApiNavGroup[] = [ { "title": "Datasets", "items": [ + { "title": "Get Dataset", "href": "/docs/api/datasets/get-dataset", "method": "GET" }, + { "title": "List Datasets", "href": "/docs/api/datasets/list-datasets", "method": "GET" }, { "title": "Create Dataset", "href": "/docs/api/datasets/create-dataset", "method": "POST" }, - { "title": "Upload Dataset from File", "href": "/docs/api/datasets/upload-dataset", "method": "POST" } + { "title": "Create Empty Dataset", "href": "/docs/api/datasets/create-empty-dataset", "method": "POST" }, + { "title": "Upload Dataset from File", "href": "/docs/api/datasets/upload-dataset", "method": "POST" }, + { "title": "Create from HuggingFace", "href": "/docs/api/datasets/create-dataset-from-huggingface", "method": "POST" }, + { "title": "Clone Dataset", "href": "/docs/api/datasets/clone-dataset", "method": "POST" }, + { "title": "Duplicate Dataset", "href": "/docs/api/datasets/duplicate-dataset", "method": "POST" }, + { "title": "Add as New Dataset", "href": "/docs/api/datasets/add-as-new", "method": "POST" }, + { "title": "Update Dataset", "href": "/docs/api/datasets/update-dataset", "method": "POST" }, + { "title": "Merge Dataset", "href": "/docs/api/datasets/merge-dataset", "method": "POST" }, + { "title": "Delete Dataset", "href": "/docs/api/datasets/delete-dataset", "method": "DELETE" }, + { "title": "Add Rows from File", "href": "/docs/api/datasets/add-rows-from-file", "method": "POST" }, + { "title": "Add Empty Rows", "href": "/docs/api/datasets/add-empty-rows", "method": "POST" }, + { "title": "Add Rows from Existing", "href": "/docs/api/datasets/add-rows-from-existing", "method": "POST" }, + { "title": "Add Rows from HuggingFace", "href": "/docs/api/datasets/add-rows-from-huggingface", "method": "POST" }, + { "title": "Duplicate Rows", "href": "/docs/api/datasets/duplicate-rows", "method": "POST" }, + { "title": "Delete Rows", "href": "/docs/api/datasets/delete-rows", "method": "DELETE" }, + { "title": "Update Cell Value", "href": "/docs/api/datasets/update-cell-value", "method": "PUT" } ] }, { diff --git a/src/lib/navigation.ts b/src/lib/navigation.ts index 17fe8a89..4619f030 100644 --- a/src/lib/navigation.ts +++ b/src/lib/navigation.ts @@ -915,6 +915,20 @@ export const tabNavigation: NavTab[] = [ { title: 'Get Eval Log Details', href: '/docs/api/eval-logs-metrics/getevallogdetails' }, ] }, + { + title: 'Dataset Evals', + items: [ + { title: 'Get Eval Template Names', href: '/docs/api/dataset-evals/get-eval-template-names' }, + { title: 'Create Custom Eval Template', href: '/docs/api/dataset-evals/create-custom-eval-template' }, + { title: 'List Dataset Evals', href: '/docs/api/dataset-evals/list-dataset-evals' }, + { title: 'Get Eval Structure', href: '/docs/api/dataset-evals/get-eval-structure' }, + { title: 'Add Dataset Eval', href: '/docs/api/dataset-evals/add-dataset-eval' }, + { title: 'Start Evals Process', href: '/docs/api/dataset-evals/start-evals-process' }, + { title: 'Delete Dataset Eval', href: '/docs/api/dataset-evals/delete-dataset-eval' }, + { title: 'Edit and Run Eval', href: '/docs/api/dataset-evals/edit-and-run-eval' }, + { title: 'Get Eval Metrics', href: '/docs/api/dataset-evals/get-eval-metrics' }, + ] + }, { title: 'Scenarios', items: [ @@ -1010,8 +1024,59 @@ export const tabNavigation: NavTab[] = [ { title: 'Datasets', items: [ + { title: 'Get Dataset', href: '/docs/api/datasets/get-dataset' }, + { title: 'List Datasets', href: '/docs/api/datasets/list-datasets' }, { title: 'Create Dataset', href: '/docs/api/datasets/create-dataset' }, + { title: 'Create Empty Dataset', href: '/docs/api/datasets/create-empty-dataset' }, { title: 'Upload Dataset from File', href: '/docs/api/datasets/upload-dataset' }, + { title: 'Create from HuggingFace', href: '/docs/api/datasets/create-dataset-from-huggingface' }, + { title: 'Clone Dataset', href: '/docs/api/datasets/clone-dataset' }, + { title: 'Duplicate Dataset', href: '/docs/api/datasets/duplicate-dataset' }, + { title: 'Add as New Dataset', href: '/docs/api/datasets/add-as-new' }, + { title: 'Update Dataset', href: '/docs/api/datasets/update-dataset' }, + { title: 'Merge Dataset', href: '/docs/api/datasets/merge-dataset' }, + { title: 'Delete Dataset', href: '/docs/api/datasets/delete-dataset' }, + { title: 'Add Rows from File', href: '/docs/api/datasets/add-rows-from-file' }, + { title: 'Add Empty Rows', href: '/docs/api/datasets/add-empty-rows' }, + { title: 'Add Rows from Existing', href: '/docs/api/datasets/add-rows-from-existing' }, + { title: 'Add Rows from HuggingFace', href: '/docs/api/datasets/add-rows-from-huggingface' }, + { title: 'Duplicate Rows', href: '/docs/api/datasets/duplicate-rows' }, + { title: 'Delete Rows', href: '/docs/api/datasets/delete-rows' }, + { title: 'Update Cell Value', href: '/docs/api/datasets/update-cell-value' }, + ] + }, + { + title: 'Dataset Columns', + items: [ + { title: 'Get Column Details', href: '/docs/api/datasets/columns/get-column-details' }, + { title: 'Get Column Config', href: '/docs/api/datasets/columns/get-column-config' }, + { title: 'Add Static Column', href: '/docs/api/datasets/columns/add-static-column' }, + { title: 'Add Multiple Static Columns', href: '/docs/api/datasets/columns/add-multiple-static-columns' }, + { title: 'Add Columns', href: '/docs/api/datasets/columns/add-columns' }, + { title: 'Update Column Name', href: '/docs/api/datasets/columns/update-column-name' }, + { title: 'Update Column Type', href: '/docs/api/datasets/columns/update-column-type' }, + { title: 'Delete Column', href: '/docs/api/datasets/columns/delete-column' }, + ] + }, + { + title: 'Dataset Run Prompt', + items: [ + { title: 'Add Run Prompt Column', href: '/docs/api/datasets/run-prompt/add-run-prompt-column' }, + { title: 'Edit Run Prompt Column', href: '/docs/api/datasets/run-prompt/edit-run-prompt-column' }, + { title: 'Get Run Prompt Config', href: '/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config' }, + { title: 'Get Run Prompt Options', href: '/docs/api/datasets/run-prompt/retrieve-run-prompt-options' }, + { title: 'Get Model Voices', href: '/docs/api/datasets/run-prompt/get-model-voices' }, + { title: 'TTS Voices', href: '/docs/api/datasets/run-prompt/tts-voices' }, + { title: 'Get Column Values', href: '/docs/api/datasets/run-prompt/get-column-values' }, + ] + }, + { + title: 'Dataset Analytics', + items: [ + { title: 'Run Prompt Stats', href: '/docs/api/datasets/analytics/run-prompt-stats' }, + { title: 'Eval Stats', href: '/docs/api/datasets/analytics/eval-stats' }, + { title: 'Annotation Summary', href: '/docs/api/datasets/analytics/annotation-summary' }, + { title: 'Explanation Summary', href: '/docs/api/datasets/analytics/explanation-summary' }, ] }, { diff --git a/src/pages/docs/api/dataset-evals/add-dataset-eval.mdx b/src/pages/docs/api/dataset-evals/add-dataset-eval.mdx new file mode 100644 index 00000000..b441050d --- /dev/null +++ b/src/pages/docs/api/dataset-evals/add-dataset-eval.mdx @@ -0,0 +1,248 @@ +--- +title: "Add Dataset Eval" +description: "Add an evaluation to a dataset by selecting a template and configuring the key mapping." +--- + +# Add Dataset Eval + +Adds a new evaluation to a dataset by associating an eval template, configuring the variable-to-column mapping, and optionally running it immediately. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset to add the eval to. Must belong to your organization. | + +## Request Body + + + Name for the evaluation. Maximum 50 characters. Must be unique within the dataset for your organization. + + + + UUID of the eval template to use. Maximum 500 characters. The template must be accessible by your organization. + + + + Configuration object for the evaluation. + + - **config** (`object`): Template-specific configuration parameters. + - **params** (`object`): Runtime parameters. + - **mapping** (`object`): Maps template variable keys to dataset column names. All required keys from the template must be mapped. + - **reason_column** (`boolean`): Whether to create a reason column alongside the eval result column. + + + + UUID of a knowledge base to use with this eval. The knowledge base must exist within your organization. + + + + Whether to enable error localization. Default: `false`. + + + + Model to use for evaluation. Maximum 100 characters. Default: `turing_large`. + + + + Whether to immediately run the evaluation after adding it. Default: `false`. When `true`, creates the eval column and queues processing. + + + + Whether to save this configuration as a new reusable eval template. Default: `false`. When `true`, the `name` must be unique across all templates. + + +### Example + +```json +{ + "name": "Hallucination Check", + "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", + "config": { + "config": {}, + "params": {}, + "mapping": { + "input": "question_column", + "output": "response_column" + }, + "reason_column": true + }, + "model": "turing_large", + "run": true, + "save_as_template": false +} +``` + +## Response + +Success message. +Whether the request was successful. + +### Example Response + +```json +{ + "data": "success", + "success": true +} +``` + +## Responses + +### 200 + +Eval successfully added to the dataset. + +### 400 + +Bad request. Possible reasons: + +- **Dataset not in organization** — The dataset does not belong to your organization. +- **Duplicate name** — An eval with this name already exists in the dataset. +- **Missing required mapping** — All required keys from the template must be present in the `mapping` object. +- **Name validation failed** — The eval name does not meet naming requirements. +- **Template not found** — The specified `template_id` does not exist or is not accessible. +- **Failed to create template** — Error occurred when `save_as_template` is `true` and the template name already exists. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +The specified dataset was not found. + +### 429 + +Resource limit reached. Your organization has exceeded the eval addition quota. + +### 500 + +Internal server error. Failed to add the evaluation. + +## Code Examples + + +```python Python +import requests + +dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/add_user_eval/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "name": "Hallucination Check", + "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", + "config": { + "config": {}, + "params": {}, + "mapping": { + "input": "question_column", + "output": "response_column" + }, + "reason_column": True + }, + "model": "turing_large", + "run": True, + "save_as_template": False +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; + +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/${datasetId}/add_user_eval/`, + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + name: "Hallucination Check", + template_id: "d4e5f6a7-b8c9-0123-def0-123456789abc", + config: { + config: {}, + params: {}, + mapping: { + input: "question_column", + output: "response_column" + }, + reason_column: true + }, + model: "turing_large", + run: true, + save_as_template: false + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_user_eval/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "Hallucination Check", + "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", + "config": { + "config": {}, + "params": {}, + "mapping": { + "input": "question_column", + "output": "response_column" + }, + "reason_column": true + }, + "model": "turing_large", + "run": true, + "save_as_template": false + }' +``` + diff --git a/src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx b/src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx new file mode 100644 index 00000000..e6244802 --- /dev/null +++ b/src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx @@ -0,0 +1,233 @@ +--- +title: "Create Custom Eval Template" +description: "Create a custom evaluation template with criteria, output type, and model configuration." +--- + +# Create Custom Eval Template + +Creates a new custom evaluation template that can be used to evaluate dataset rows. The template defines evaluation criteria using template variables. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + Name of the eval template. Maximum 255 characters. Must be unique across both user-owned and system-owned templates. + + + + Optional description of the eval template. + + + + The evaluation criteria text. Maximum 100,000 characters. Must contain at least one template variable using `{{variable_name}}` syntax (e.g., `{{input}}`, `{{output}}`). + + + + The type of evaluation output. One of: `Pass/Fail`, `score`, `choices`. Default: `Pass/Fail`. + + + + List of required template variable names that must be mapped when using this eval. + + + + Configuration object for the eval template. + + - **model** (`string`): Model to use for evaluation. Default: `turing_small`. + - **proxy_agi** (`boolean`): Whether to use the AGI proxy. Default: `true`. + - **visible_ui** (`boolean`): Whether the eval is visible in the UI. Default: `true`. + - **reverse_output** (`boolean`): Whether to reverse the output logic. + + Only these keys are allowed: `model`, `proxy_agi`, `visible_ui`, `reverse_output`, `config`. + + + + Optional list of tag strings to categorize the eval template. + + + + Required when `output_type` is `choices`. A key-value mapping of choice options (e.g., `{"A": "Good", "B": "Bad"}`). + + + + Whether the eval should check internet sources. Default: `false`. + + + + Whether multiple choices can be selected (only relevant when `output_type` is `choices`). Default: `false`. + + + + Optional UUID of an existing template to base this template on. + + +### Example + +```json +{ + "name": "My Custom Eval", + "description": "Evaluates response quality", + "criteria": "Evaluate the {{output}} based on the {{input}} for correctness and completeness.", + "output_type": "Pass/Fail", + "required_keys": ["input", "output"], + "config": { + "model": "turing_small", + "proxy_agi": true, + "visible_ui": true + }, + "tags": ["quality"], + "check_internet": false +} +``` + +## Response + +UUID of the newly created eval template. +Whether the request was successful. + +### Example Response + +```json +{ + "data": { + "eval_template_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + }, + "success": true +} +``` + +## Responses + +### 200 + +Eval template created successfully. + +### 400 + +Bad request. Possible reasons: + +- **Duplicate name** — An eval template with this name already exists. +- **Missing criteria variables** — `criteria` must contain at least one `{{variable}}` placeholder. +- **Missing choices** — `choices` object is required when `output_type` is `choices`. +- **Invalid config keys** — Only `model`, `proxy_agi`, `visible_ui`, `reverse_output`, and `config` are allowed. +- **Name validation failed** — Template name does not meet naming requirements. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 500 + +Internal server error. Failed to create the eval template. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/create_custom_evals/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "name": "My Custom Eval", + "description": "Evaluates response quality", + "criteria": "Evaluate the {{output}} based on the {{input}} for correctness.", + "output_type": "Pass/Fail", + "required_keys": ["input", "output"], + "config": { + "model": "turing_small", + "proxy_agi": True, + "visible_ui": True + }, + "tags": ["quality"], + "check_internet": False +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/create_custom_evals/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + name: "My Custom Eval", + description: "Evaluates response quality", + criteria: "Evaluate the {{output}} based on the {{input}} for correctness.", + output_type: "Pass/Fail", + required_keys: ["input", "output"], + config: { + model: "turing_small", + proxy_agi: true, + visible_ui: true + }, + tags: ["quality"], + check_internet: false + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/create_custom_evals/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "My Custom Eval", + "description": "Evaluates response quality", + "criteria": "Evaluate the {{output}} based on the {{input}} for correctness.", + "output_type": "Pass/Fail", + "required_keys": ["input", "output"], + "config": { + "model": "turing_small", + "proxy_agi": true, + "visible_ui": true + }, + "tags": ["quality"], + "check_internet": false + }' +``` + diff --git a/src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx b/src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx new file mode 100644 index 00000000..6333c9fa --- /dev/null +++ b/src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx @@ -0,0 +1,142 @@ +--- +title: "Delete Dataset Eval" +description: "Remove an evaluation from a dataset, with an option to delete the associated column." +--- + +# Delete Dataset Eval + +Deletes a user evaluation from a dataset. You can choose to either hide the eval from the sidebar or permanently delete the eval along with its associated column and cell data. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset containing the eval. | +| `eval_id` | string (UUID) | Yes | The UUID of the user eval metric to delete. | + +## Request Body + + + Whether to permanently delete the eval's associated column and all its cell data. Default: `false`. + + - When `true`: Soft-deletes the eval column, reason column, and all associated cell data. Removes the column from the dataset's column order. This action cannot be undone. + - When `false`: Hides the eval from the sidebar without deleting any data. + + +### Example + +```json +{ + "delete_column": true +} +``` + +## Response + +Confirmation message. +Whether the request was successful. + +### Example Response + +```json +{ + "data": "Eval deleted successfully", + "success": true +} +``` + +## Responses + +### 200 + +Eval successfully deleted or hidden. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +The specified eval was not found. It may not exist, not belong to the dataset, or has already been deleted. + +### 500 + +Internal server error. Failed to delete the evaluation. + +## Code Examples + + +```python Python +import requests + +dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +eval_id = "d4e5f6a7-b8c9-0123-def0-123456789abc" +url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_user_eval/{eval_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "delete_column": True +} + +response = requests.delete(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; +const evalId = "d4e5f6a7-b8c9-0123-def0-123456789abc"; + +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/${datasetId}/delete_user_eval/${evalId}/`, + { + method: "DELETE", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + delete_column: true + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X DELETE "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_user_eval/d4e5f6a7-b8c9-0123-def0-123456789abc/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "delete_column": true + }' +``` + diff --git a/src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx b/src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx new file mode 100644 index 00000000..7530afee --- /dev/null +++ b/src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx @@ -0,0 +1,232 @@ +--- +title: "Edit and Run Eval" +description: "Update an evaluation's configuration and optionally re-run it on the dataset." +--- + +# Edit and Run Eval + +Updates the configuration of an existing evaluation on a dataset and optionally triggers a re-run. You can modify the variable mapping, model, and configuration, and optionally save the configuration as a reusable template. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset containing the eval. | +| `eval_id` | string (UUID) | Yes | The UUID of the user eval metric to edit. | + +## Request Body + + + Updated configuration for the evaluation. + + - **config** (`object`): Template-specific configuration parameters. + - **params** (`object`): Runtime parameters. + - **mapping** (`object`): Maps template variable keys to dataset column names. All required keys must be mapped. + - **reason_column** (`boolean`): Whether to create or keep a reason column alongside the eval result. + + + + UUID of a knowledge base to associate with this eval. + + + + Whether to enable error localization. + + + + Model to use for evaluation. + + + + Whether to re-run the evaluation after updating. Default: `false`. When `true`, resets all cell statuses to running and queues processing. + + + + Whether to save this updated configuration as a new eval template. Default: `false`. + + + + Name for the new template. Required when `save_as_template` is `true`. Must be unique across all templates. + + +### Example + +```json +{ + "config": { + "config": {}, + "params": {}, + "mapping": { + "input": "question_column", + "output": "response_column" + }, + "reason_column": true + }, + "model": "turing_large", + "run": true, + "save_as_template": false +} +``` + +## Response + +Confirmation message. +Whether the request was successful. + +### Example Response + +```json +{ + "data": "Column evaluation updated and queued for processing", + "success": true +} +``` + +## Responses + +### 200 + +Eval configuration updated (and optionally re-run started) successfully. + +### 400 + +Bad request. Possible reasons: + +- **Column deleted** — The eval's associated column has been deleted and the eval cannot be edited. +- **Duplicate template name** — When `save_as_template` is `true`, the name already exists. +- **Name validation failed** — The template name does not meet naming requirements. +- **Missing required mapping** — All required keys from the template must be present in the `mapping` object. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +The specified eval was not found. It may not exist, not belong to the dataset, or has been deleted. + +### 500 + +Internal server error. Failed to update or run the evaluation. + +## Code Examples + + +```python Python +import requests + +dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +eval_id = "d4e5f6a7-b8c9-0123-def0-123456789abc" +url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/edit_and_run_user_eval/{eval_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "config": { + "config": {}, + "params": {}, + "mapping": { + "input": "question_column", + "output": "response_column" + }, + "reason_column": True + }, + "model": "turing_large", + "run": True, + "save_as_template": False +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; +const evalId = "d4e5f6a7-b8c9-0123-def0-123456789abc"; + +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/${datasetId}/edit_and_run_user_eval/${evalId}/`, + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + config: { + config: {}, + params: {}, + mapping: { + input: "question_column", + output: "response_column" + }, + reason_column: true + }, + model: "turing_large", + run: true, + save_as_template: false + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/edit_and_run_user_eval/d4e5f6a7-b8c9-0123-def0-123456789abc/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "config": { + "config": {}, + "params": {}, + "mapping": { + "input": "question_column", + "output": "response_column" + }, + "reason_column": true + }, + "model": "turing_large", + "run": true, + "save_as_template": false + }' +``` + diff --git a/src/pages/docs/api/dataset-evals/get-eval-metrics.mdx b/src/pages/docs/api/dataset-evals/get-eval-metrics.mdx new file mode 100644 index 00000000..e35e3b93 --- /dev/null +++ b/src/pages/docs/api/dataset-evals/get-eval-metrics.mdx @@ -0,0 +1,160 @@ +--- +title: "Get Eval Metrics" +description: "Retrieve evaluation metrics for a specific eval template with optional filtering." +--- + +# Get Eval Metrics + +Retrieves aggregated evaluation metrics for a specific eval template. Supports both GET and POST methods, with optional filters to scope the results. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +This endpoint supports both GET (query parameters) and POST (request body) methods. + +### GET — Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `eval_template_id` | string (UUID) | Yes | The UUID of the eval template to retrieve metrics for. | +| `filters` | string (JSON) | No | JSON-encoded array of filter objects. Default: `[]`. | + +### POST — Request Body + + + UUID of the eval template to retrieve metrics for. + + + + Optional array of filter objects to scope which evaluation results are included. Default: `[]`. Only results with `SUCCESS` status are included. + + +### Example (POST) + +```json +{ + "eval_template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", + "filters": [] +} +``` + +## Response + +Evaluation metrics data. Structure depends on the eval template configuration and output type. +Whether the request was successful. + +### Example Response + +```json +{ + "data": { + "total_evaluations": 150, + "pass_rate": 0.85, + "fail_rate": 0.15 + }, + "success": true +} +``` + +## Responses + +### 200 + +Successfully retrieved evaluation metrics. + +### 400 + +Bad request. Possible reasons: + +- **Missing template ID** — `eval_template_id` is required. +- **Invalid filters** — The `filters` value could not be parsed as valid JSON. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 500 + +Internal server error. Failed to calculate evaluation metrics. + +## Code Examples + + +```python Python +import requests + +# Using POST +url = "https://api.futureagi.com/model-hub/get-eval-metrics" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "eval_template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", + "filters": [] +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +// Using POST +const response = await fetch( + "https://api.futureagi.com/model-hub/get-eval-metrics", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + eval_template_id: "d4e5f6a7-b8c9-0123-def0-123456789abc", + filters: [] + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +# Using GET +curl -X GET "https://api.futureagi.com/model-hub/get-eval-metrics?eval_template_id=d4e5f6a7-b8c9-0123-def0-123456789abc" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" + +# Using POST +curl -X POST "https://api.futureagi.com/model-hub/get-eval-metrics" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "eval_template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", + "filters": [] + }' +``` + diff --git a/src/pages/docs/api/dataset-evals/get-eval-structure.mdx b/src/pages/docs/api/dataset-evals/get-eval-structure.mdx new file mode 100644 index 00000000..bdf89ea0 --- /dev/null +++ b/src/pages/docs/api/dataset-evals/get-eval-structure.mdx @@ -0,0 +1,166 @@ +--- +title: "Get Eval Structure" +description: "Retrieve the configuration structure of a specific evaluation, including required keys, mapping, and model settings." +--- + +# Get Eval Structure + +Retrieves the full configuration structure of an evaluation, including its template details, required/optional keys, variable mappings, and model configuration. Supports preset, user-created, and previously configured eval types. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. Required when `eval_type` is `user`. | +| `eval_id` | string (UUID) | Yes | The UUID of the evaluation template or user eval metric. | + +### Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `eval_type` | string | Yes | The type of evaluation. One of: `preset`, `user`, `previously_configured`. | + +## Response + +The evaluation structure object. +UUID of the eval. +UUID of the underlying eval template. +Display name of the eval. +Description of the eval. +List of required variable keys that must be mapped to dataset columns. +List of optional variable keys. +All template variable keys. +Current key-to-column mapping configuration. +Eval configuration parameters. +Eval runtime parameters. +Output type of the eval. +Choice options (for choice-type evals). +Available models for this eval. +Associated knowledge base UUID, if any. +Whether error localization is enabled. +Whether the required API key is configured. +Whether the request was successful. + +### Example Response + +```json +{ + "data": { + "eval": { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", + "name": "Hallucination Detection", + "description": "Detects hallucinated content", + "required_keys": ["input", "output"], + "optional_keys": ["context"], + "variable_keys": ["input", "output", "context"], + "mapping": {}, + "config": {}, + "params": {}, + "output": "Pass/Fail", + "choices": null, + "models": "turing_small", + "kb_id": null, + "error_localizer": false, + "api_key_available": true + } + }, + "success": true +} +``` + +## Responses + +### 200 + +Successfully retrieved the eval structure. + +### 400 + +Bad request. Possible reasons: + +- **Invalid or missing eval type** — `eval_type` query parameter is required and must be `preset`, `user`, or `previously_configured`. +- **Missing dataset ID** — `dataset_id` is required when `eval_type` is `user`. +- **Eval stack updated** — The eval template has been updated since it was last configured. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +The specified eval template or user eval was not found. + +### 500 + +Internal server error. Failed to retrieve the eval structure. + +## Code Examples + + +```python Python +import requests + +dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +eval_id = "d4e5f6a7-b8c9-0123-def0-123456789abc" +url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/get_eval_structure/{eval_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +params = { + "eval_type": "preset" +} + +response = requests.get(url, headers=headers, params=params) +print(response.json()) +``` +```typescript TypeScript +const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; +const evalId = "d4e5f6a7-b8c9-0123-def0-123456789abc"; + +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/${datasetId}/get_eval_structure/${evalId}/?eval_type=preset`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/get_eval_structure/d4e5f6a7-b8c9-0123-def0-123456789abc/?eval_type=preset" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" +``` + diff --git a/src/pages/docs/api/dataset-evals/get-eval-template-names.mdx b/src/pages/docs/api/dataset-evals/get-eval-template-names.mdx new file mode 100644 index 00000000..4da81ae7 --- /dev/null +++ b/src/pages/docs/api/dataset-evals/get-eval-template-names.mdx @@ -0,0 +1,133 @@ +--- +title: "Get Eval Template Names" +description: "Search and retrieve a list of evaluation template names available in your organization." +--- + +# Get Eval Template Names + +Retrieves a list of evaluation templates accessible to the authenticated user, with optional text search filtering. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + Optional text to filter eval template names. Performs a case-insensitive search on template names. + + +### Example + +```json +{ + "search_text": "hallucination" +} +``` + +## Response + +Returns a list of eval templates matching the search criteria. + + + Array of eval template objects. + + +UUID of the eval template. +Name of the eval template. +Description of the eval template. + +Whether the request was successful. + +### Example Response + +```json +{ + "data": [ + { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "Hallucination Detection", + "description": "Detects hallucinated content in LLM responses" + } + ], + "success": true +} +``` + +## Responses + +### 200 + +Successfully retrieved eval template names. + +### 400 + +Bad request. An error occurred while processing the request. + +### 401 + +Authentication credentials were not provided or are invalid. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/get-eval-template-names" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "search_text": "hallucination" +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/get-eval-template-names", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + search_text: "hallucination" + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/get-eval-template-names" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "search_text": "hallucination" + }' +``` + diff --git a/src/pages/docs/api/dataset-evals/list-dataset-evals.mdx b/src/pages/docs/api/dataset-evals/list-dataset-evals.mdx new file mode 100644 index 00000000..3bb664ca --- /dev/null +++ b/src/pages/docs/api/dataset-evals/list-dataset-evals.mdx @@ -0,0 +1,154 @@ +--- +title: "List Dataset Evals" +description: "Retrieve a list of available evaluations for a dataset with filtering and search options." +--- + +# List Dataset Evals + +Retrieves a list of evaluations available for a given dataset, including built-in and user-created evals, with support for filtering by category, type, tags, and use cases. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset to retrieve evaluations for. | + +### Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `search_text` | string | No | Text to search for in evaluation names (case-insensitive). | +| `eval_categories` | string | No | Filter by category. One of: `futureagi_built`, `user_built`. | +| `eval_type` | string | No | Filter by type. One of: `preset`, `user`, `previously_configured`. | +| `eval_tags[]` | array | No | Filter by one or more eval tags. | +| `use_cases[]` | array | No | Filter by one or more use cases. | +| `experiment_id` | string (UUID) | No | Scope results to a specific experiment. The experiment must exist and belong to the dataset. | +| `order` | string | No | Ordering mode. Use `simulate` for simulation-specific ordering. | + +## Response + +Array of evaluation objects with id, name, description, and tags. +List of recommended evaluation categories (e.g., `["Deterministic Evals"]`). +Whether the request was successful. + +### Example Response + +```json +{ + "data": { + "evals": [ + { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "Hallucination Detection", + "description": "Detects hallucinated content in LLM responses", + "eval_template_tags": ["hallucination", "quality"] + } + ], + "eval_recommendations": ["Deterministic Evals"] + }, + "success": true +} +``` + +## Responses + +### 200 + +Successfully retrieved the evaluations list. + +### 400 + +Bad request. Possible reasons: + +- **Missing dataset ID** — `dataset_id` path parameter is required. +- **Experiment not found** — The specified `experiment_id` does not exist. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +The requested dataset does not exist. + +### 500 + +Internal server error. Failed to fetch the evaluations list. + +## Code Examples + + +```python Python +import requests + +dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/get_evals_list/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +params = { + "search_text": "hallucination", + "eval_categories": "futureagi_built" +} + +response = requests.get(url, headers=headers, params=params) +print(response.json()) +``` +```typescript TypeScript +const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; +const params = new URLSearchParams({ + search_text: "hallucination", + eval_categories: "futureagi_built" +}); + +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/${datasetId}/get_evals_list/?${params}`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/get_evals_list/?search_text=hallucination&eval_categories=futureagi_built" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" +``` + diff --git a/src/pages/docs/api/dataset-evals/start-evals-process.mdx b/src/pages/docs/api/dataset-evals/start-evals-process.mdx new file mode 100644 index 00000000..1d412047 --- /dev/null +++ b/src/pages/docs/api/dataset-evals/start-evals-process.mdx @@ -0,0 +1,154 @@ +--- +title: "Start Evals Process" +description: "Start running one or more evaluations on a dataset." +--- + +# Start Evals Process + +Triggers the evaluation process for one or more previously configured evaluations on a dataset. This creates the necessary columns and queues all rows for processing. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset to run evaluations on. | + +## Request Body + + + List of user eval metric UUIDs to run. Must not be empty. Each eval must: + - Exist and belong to the specified dataset and your organization. + - Not have been deleted. + - Not have its associated column deleted (`column_deleted` must be `false`). + + +### Example + +```json +{ + "user_eval_ids": [ + "d4e5f6a7-b8c9-0123-def0-123456789abc", + "e5f6a7b8-c9d0-1234-ef01-23456789abcd" + ] +} +``` + +## Response + +Success message indicating how many evals were started. +Whether the request was successful. + +### Example Response + +```json +{ + "data": "Successfully updated 2 eval(s) status", + "success": true +} +``` + +## Responses + +### 200 + +Evaluation process started successfully. Eval columns are created and rows are queued for processing. + +### 400 + +Bad request. Possible reasons: + +- **Missing eval IDs** — `user_eval_ids` must not be empty. +- **Column deleted** — One or more evals have their associated column deleted and cannot be re-run. +- **Evals not found** — One or more eval IDs do not exist, do not belong to the dataset, or have been deleted. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 500 + +Internal server error. Failed to start the evaluation process. + +## Code Examples + + +```python Python +import requests + +dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/start_evals_process/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "user_eval_ids": [ + "d4e5f6a7-b8c9-0123-def0-123456789abc", + "e5f6a7b8-c9d0-1234-ef01-23456789abcd" + ] +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; + +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/${datasetId}/start_evals_process/`, + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + user_eval_ids: [ + "d4e5f6a7-b8c9-0123-def0-123456789abc", + "e5f6a7b8-c9d0-1234-ef01-23456789abcd" + ] + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/start_evals_process/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "user_eval_ids": [ + "d4e5f6a7-b8c9-0123-def0-123456789abc", + "e5f6a7b8-c9d0-1234-ef01-23456789abcd" + ] + }' +``` + diff --git a/src/pages/docs/api/datasets/add-as-new.mdx b/src/pages/docs/api/datasets/add-as-new.mdx new file mode 100644 index 00000000..453e994c --- /dev/null +++ b/src/pages/docs/api/datasets/add-as-new.mdx @@ -0,0 +1,172 @@ +--- +title: "Add as New Dataset" +description: "Create a new dataset from selected columns of an existing dataset or experiment." +--- + +# Add as New Dataset + +Create a new dataset by selecting and optionally renaming columns from an existing dataset or experiment table. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + UUID of the source dataset or experiment table. + + + + Name for the new dataset. Must be unique within your organization. + + + + Mapping of source column IDs to new column names. At least one column mapping is required. No duplicate column names allowed. + + Format: `{ "source_column_id": "new_column_name" }` + + +### Example + +```json +{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "My New Dataset", + "columns": { + "col-uuid-1": "input_text", + "col-uuid-2": "expected_output" + } +} +``` + +## Response + +Returns the created dataset details. + +Confirmation message. +UUID of the newly created dataset. + +### Example Response + +```json +{ + "message": "Dataset created successfully", + "dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" +} +``` + +## Responses + +### 200 + +Dataset created successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing fields** - `dataset_id`, `name`, and `columns` are all required. +- **Duplicate column names** - Column name mapping contains duplicates. +- **Empty columns** - At least one column mapping must be provided. +- **Duplicate name** - A dataset with this name already exists in your organization. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Source dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/add-as-new/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "My New Dataset", + "columns": { + "col-uuid-1": "input_text", + "col-uuid-2": "expected_output" + } +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/add-as-new/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + name: "My New Dataset", + columns: { + "col-uuid-1": "input_text", + "col-uuid-2": "expected_output" + } + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/add-as-new/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "My New Dataset", + "columns": { + "col-uuid-1": "input_text", + "col-uuid-2": "expected_output" + } + }' +``` + diff --git a/src/pages/docs/api/datasets/add-empty-rows.mdx b/src/pages/docs/api/datasets/add-empty-rows.mdx new file mode 100644 index 00000000..53ba39a0 --- /dev/null +++ b/src/pages/docs/api/datasets/add-empty-rows.mdx @@ -0,0 +1,144 @@ +--- +title: "Add Empty Rows" +description: "Add empty rows to an existing dataset." +--- + +# Add Empty Rows + +Add a specified number of empty rows to an existing dataset. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the target dataset. + + +## Request Body + + + Number of empty rows to add. Must be between 1 and 100. + + +### Example + +```json +{ + "num_rows": 5 +} +``` + +## Response + +Returns confirmation of added rows. + +Confirmation message with count of rows added. +Status indicator. Example: `success`. + +### Example Response + +```json +{ + "data": "Successfully added 5 empty row(s)", + "status": "success" +} +``` + +## Responses + +### 200 + +Empty rows added successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing num_rows** - The `num_rows` field is required. +- **Invalid range** - `num_rows` must be between 1 and 100. +- **Invalid type** - `num_rows` must be a valid integer. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_empty_rows/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "num_rows": 5 +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_empty_rows/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + num_rows: 5 + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_empty_rows/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "num_rows": 5 + }' +``` + diff --git a/src/pages/docs/api/datasets/add-rows-from-existing.mdx b/src/pages/docs/api/datasets/add-rows-from-existing.mdx new file mode 100644 index 00000000..288bca5b --- /dev/null +++ b/src/pages/docs/api/datasets/add-rows-from-existing.mdx @@ -0,0 +1,178 @@ +--- +title: "Add Rows from Existing Dataset" +description: "Add rows from one dataset to another using column mapping." +--- + +# Add Rows from Existing Dataset + +Import rows from a source dataset into a target dataset by mapping source columns to target columns. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the target dataset to add rows to. + + +## Request Body + + + UUID of the source dataset to copy rows from. Cannot be the same as the target dataset. + + + + Mapping of source column IDs to target column IDs. At least one mapping is required. No duplicate target columns allowed. + + Format: `{ "source_column_id": "target_column_id" }` + + +### Example + +```json +{ + "source_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "column_mapping": { + "src-col-uuid-1": "tgt-col-uuid-1", + "src-col-uuid-2": "tgt-col-uuid-2" + } +} +``` + +## Response + +Returns confirmation of imported rows. + + + Object containing: + - `message` (string) - Confirmation message + - `rows_added` (integer) - Number of rows imported + +Status indicator. Example: `success`. + +### Example Response + +```json +{ + "data": { + "message": "Rows Imported successfully", + "rows_added": 50 + }, + "status": "success" +} +``` + +## Responses + +### 200 + +Rows imported successfully. + +### 400 + +Bad request. Possible reasons: + +- **Same dataset** - Source and target datasets cannot be the same. +- **Empty mapping** - At least one column mapping is required. +- **Duplicate targets** - Column mapping contains duplicate target columns. +- **Invalid columns** - No valid column mappings found. Check column names. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Source or target dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_existing_dataset/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "source_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "column_mapping": { + "src-col-uuid-1": "tgt-col-uuid-1", + "src-col-uuid-2": "tgt-col-uuid-2" + } +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_existing_dataset/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + source_dataset_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + column_mapping: { + "src-col-uuid-1": "tgt-col-uuid-1", + "src-col-uuid-2": "tgt-col-uuid-2" + } + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_existing_dataset/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "source_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "column_mapping": { + "src-col-uuid-1": "tgt-col-uuid-1", + "src-col-uuid-2": "tgt-col-uuid-2" + } + }' +``` + diff --git a/src/pages/docs/api/datasets/add-rows-from-file.mdx b/src/pages/docs/api/datasets/add-rows-from-file.mdx new file mode 100644 index 00000000..f3c7cde0 --- /dev/null +++ b/src/pages/docs/api/datasets/add-rows-from-file.mdx @@ -0,0 +1,139 @@ +--- +title: "Add Rows from File" +description: "Add rows to an existing dataset by uploading a file." +--- + +# Add Rows from File + +Add rows to an existing dataset by uploading a CSV, Excel, JSON, or JSONL file. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + +This endpoint accepts `multipart/form-data`. + + + The file to upload. Supported formats: `.csv`, `.xls`, `.xlsx`, `.json`, `.jsonl`. Maximum file size is **10 MB**. + + + + UUID of the target dataset to add rows to. + + +## Response + +Returns confirmation of added rows. + +Confirmation message with count of rows added. +Status indicator. Example: `success`. + +### Example Response + +```json +{ + "data": "50 Row(s) added successfully", + "status": "success" +} +``` + +## Responses + +### 200 + +Rows added successfully. + +### 400 + +Bad request. Possible reasons: + +- **No file uploaded** - The `file` field is required. +- **File too large** - File size exceeds the 10 MB limit. +- **Unsupported format** - Only `.csv`, `.xls`, `.xlsx`, `.json`, and `.jsonl` files are supported. +- **Missing dataset_id** - The `dataset_id` field is required. +- **File processing error** - The file could not be parsed. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/add_rows_from_file/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} +files = { + "file": ("data.csv", open("data.csv", "rb"), "text/csv") +} +data = { + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +} + +response = requests.post(url, headers=headers, files=files, data=data) +print(response.json()) +``` +```typescript TypeScript +const formData = new FormData(); +formData.append("file", fileInput.files[0]); +formData.append("dataset_id", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"); + +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/add_rows_from_file/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + }, + body: formData + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/add_rows_from_file/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -F "file=@data.csv" \ + -F "dataset_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890" +``` + diff --git a/src/pages/docs/api/datasets/add-rows-from-huggingface.mdx b/src/pages/docs/api/datasets/add-rows-from-huggingface.mdx new file mode 100644 index 00000000..e3d3db32 --- /dev/null +++ b/src/pages/docs/api/datasets/add-rows-from-huggingface.mdx @@ -0,0 +1,176 @@ +--- +title: "Add Rows from HuggingFace" +description: "Add rows to an existing dataset by importing from a HuggingFace dataset." +--- + +# Add Rows from HuggingFace + +Import rows from a HuggingFace dataset into an existing dataset. The data is processed in the background. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the target dataset to add rows to. + + +## Request Body + + + HuggingFace dataset path (e.g., `squad`, `glue`, `username/dataset-name`). + + + + Dataset configuration/subset name (e.g., `plain_text`, `mnli`). + + + + Dataset split to import (e.g., `train`, `test`, `validation`). + + + + Maximum number of rows to import. If not provided, all rows from the split are imported. + + +### Example + +```json +{ + "huggingface_dataset_name": "squad", + "huggingface_dataset_config": "plain_text", + "huggingface_dataset_split": "train", + "num_rows": 50 +} +``` + +## Response + +Returns confirmation of the import. + + + Object containing: + - `message` (string) - Confirmation message with count of rows imported + +Status indicator. Example: `success`. + +### Example Response + +```json +{ + "data": { + "message": "50 Row(s) imported Successfully" + }, + "status": "success" +} +``` + +## Responses + +### 200 + +Rows imported successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing fields** - `huggingface_dataset_config` and `huggingface_dataset_split` are required. +- **Invalid dataset** - The HuggingFace dataset could not be found or accessed. +- **Invalid config/split** - The specified configuration or split does not exist. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Target dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_huggingface/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "huggingface_dataset_name": "squad", + "huggingface_dataset_config": "plain_text", + "huggingface_dataset_split": "train", + "num_rows": 50 +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_huggingface/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + huggingface_dataset_name: "squad", + huggingface_dataset_config: "plain_text", + huggingface_dataset_split: "train", + num_rows: 50 + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_huggingface/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "huggingface_dataset_name": "squad", + "huggingface_dataset_config": "plain_text", + "huggingface_dataset_split": "train", + "num_rows": 50 + }' +``` + diff --git a/src/pages/docs/api/datasets/analytics/annotation-summary.mdx b/src/pages/docs/api/datasets/analytics/annotation-summary.mdx new file mode 100644 index 00000000..532318a3 --- /dev/null +++ b/src/pages/docs/api/datasets/analytics/annotation-summary.mdx @@ -0,0 +1,134 @@ +--- +title: "Annotation Summary" +description: "Get a summary of annotations for a dataset, including label distributions and annotator statistics." +--- + +# Annotation Summary + +Retrieve an aggregated summary of all annotations applied to a dataset, including label distributions and annotation progress. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +## Response + +Status message. Example: `success`. +Annotation summary data. + +### Example Response + +```json +{ + "message": "success", + "data": { + "total_annotations": 150, + "total_rows": 50, + "annotated_rows": 45, + "annotation_coverage": 0.9, + "labels": [ + { + "label_name": "Correct", + "count": 90, + "percentage": 0.6 + }, + { + "label_name": "Incorrect", + "count": 35, + "percentage": 0.23 + }, + { + "label_name": "Partially Correct", + "count": 25, + "percentage": 0.17 + } + ] + } +} +``` + +## Responses + +### 200 + +Annotation summary retrieved successfully. + +- **message**: string — `success` +- **data**: object + - **total_annotations**: integer — Total number of annotations. + - **total_rows**: integer — Total rows in the dataset. + - **annotated_rows**: integer — Number of rows with at least one annotation. + - **annotation_coverage**: number — Ratio of annotated rows to total rows. + - **labels**: array — Distribution of annotation labels. + - **label_name**: string — Label display name. + - **count**: integer — Number of times this label was applied. + - **percentage**: number — Proportion of total annotations. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/dataset/{dataset_id}/annotation-summary/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} + +response = requests.get(url, headers=headers) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/dataset/{dataset_id}/annotation-summary/", + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/dataset/{dataset_id}/annotation-summary/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/analytics/eval-stats.mdx b/src/pages/docs/api/datasets/analytics/eval-stats.mdx new file mode 100644 index 00000000..f3019d52 --- /dev/null +++ b/src/pages/docs/api/datasets/analytics/eval-stats.mdx @@ -0,0 +1,139 @@ +--- +title: "Eval Stats" +description: "Get evaluation statistics for a dataset, including metrics by column." +--- + +# Eval Stats + +Retrieve evaluation statistics for a dataset. Returns aggregated metrics for evaluation columns, optionally filtered by specific column IDs. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +### Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `column_ids` | string | No | Comma-separated list of column UUIDs to filter. If omitted, stats for all evaluation columns are returned. | + +## Response + +Returns an array of evaluation statistics objects. + +### Example Response + +```json +[ + { + "template_name": "Relevance", + "metric_count": 50, + "average_score": 0.85, + "min_score": 0.2, + "max_score": 1.0, + "pass_count": 42, + "fail_count": 8, + "pass_rate": 0.84 + }, + { + "template_name": "Faithfulness", + "metric_count": 50, + "average_score": 0.92, + "min_score": 0.5, + "max_score": 1.0, + "pass_count": 47, + "fail_count": 3, + "pass_rate": 0.94 + } +] +``` + +## Responses + +### 200 + +Evaluation statistics retrieved successfully. Each object contains: + +- **template_name**: string — Name of the evaluation template. +- **metric_count**: integer — Total number of evaluated items. +- **average_score**: number — Mean evaluation score. +- **min_score**: number — Minimum score. +- **max_score**: number — Maximum score. +- **pass_count**: integer — Number of items that passed. +- **fail_count**: integer — Number of items that failed. +- **pass_rate**: number — Ratio of passed to total items. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/dataset/{dataset_id}/eval-stats/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} +params = { + "column_ids": "col-uuid-1,col-uuid-2" +} + +response = requests.get(url, headers=headers, params=params) +print(response.json()) +``` +```typescript TypeScript +const params = new URLSearchParams({ + column_ids: "col-uuid-1,col-uuid-2" +}); +const response = await fetch( + `https://api.futureagi.com/model-hub/dataset/{dataset_id}/eval-stats/?${params}`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/dataset/{dataset_id}/eval-stats/?column_ids=col-uuid-1,col-uuid-2" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/analytics/explanation-summary.mdx b/src/pages/docs/api/datasets/analytics/explanation-summary.mdx new file mode 100644 index 00000000..79663e08 --- /dev/null +++ b/src/pages/docs/api/datasets/analytics/explanation-summary.mdx @@ -0,0 +1,166 @@ +--- +title: "Explanation Summary" +description: "Get an AI-generated explanation summary for a dataset's content and patterns." +--- + +# Explanation Summary + +Retrieve an AI-generated summary that explains the dataset's content, patterns, and key insights. The summary is generated asynchronously and cached. If the summary has not been generated yet, a background task is triggered automatically. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +## Response + +Status message. Example: `success`. +Explanation summary data and generation status. + +### Example Response (Completed) + +```json +{ + "message": "success", + "data": { + "response": { + "summary": "This dataset contains customer support interactions...", + "key_patterns": ["High correlation between response length and satisfaction"], + "critical_issues": ["15% of responses contain hallucinated information"] + }, + "last_updated": "2024-01-15T10:30:00Z", + "status": "COMPLETED", + "row_count": 500, + "min_rows_required": 10 + } +} +``` + +### Example Response (Pending) + +```json +{ + "message": "success", + "data": { + "response": null, + "last_updated": null, + "status": "PENDING", + "row_count": 500, + "min_rows_required": 10 + } +} +``` + +### Example Response (Insufficient Data) + +```json +{ + "message": "success", + "data": { + "response": null, + "last_updated": null, + "status": "INSUFFICIENT_DATA", + "row_count": 3, + "min_rows_required": 10 + } +} +``` + +## Responses + +### 200 + +Summary data returned. Check the `status` field: + +- **message**: string — `success` +- **data**: object + - **response**: object or null — The explanation summary content. `null` if not yet generated. + - **last_updated**: string (ISO 8601) or null — Timestamp of the last summary generation. + - **status**: string — Generation status: + - `COMPLETED` — Summary is available. + - `PENDING` — Summary generation is in progress. + - `INSUFFICIENT_DATA` — Not enough rows to generate a summary. + - **row_count**: integer — Current number of rows in the dataset. + - **min_rows_required**: integer — Minimum rows needed to generate a summary. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/datasets/explanation-summary/{dataset_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} + +response = requests.get(url, headers=headers) +result = response.json() + +if result["data"]["status"] == "COMPLETED": + print("Summary:", result["data"]["response"]) +elif result["data"]["status"] == "PENDING": + print("Summary is being generated, check back later.") +else: + print("Insufficient data:", result["data"]["row_count"], "rows") +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/datasets/explanation-summary/{dataset_id}/", + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const result = await response.json(); + +if (result.data.status === "COMPLETED") { + console.log("Summary:", result.data.response); +} else if (result.data.status === "PENDING") { + console.log("Summary is being generated, check back later."); +} else { + console.log("Insufficient data:", result.data.row_count, "rows"); +} +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/datasets/explanation-summary/{dataset_id}/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx b/src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx new file mode 100644 index 00000000..ab2b38fd --- /dev/null +++ b/src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx @@ -0,0 +1,131 @@ +--- +title: "Run Prompt Stats" +description: "Get aggregated statistics for run prompt columns in a dataset." +--- + +# Run Prompt Stats + +Retrieve aggregated statistics for run prompt columns in a dataset, including average token usage, cost, and response time. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +### Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `prompt_ids` | string | No | Comma-separated list of RunPrompter UUIDs to filter. If omitted, stats for all run prompt columns are returned. | + +## Response + +Status message. Example: `success`. +Aggregated run prompt statistics. + +### Example Response + +```json +{ + "message": "success", + "data": { + "avg_tokens": 245.8, + "avg_cost": 0.0032, + "avg_time": 1.45, + "prompts": [ + { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "gpt_response", + "model": "gpt-4o", + "avg_tokens": 245.8, + "avg_cost": 0.0032, + "avg_time": 1.45, + "total_rows": 50, + "completed_rows": 48, + "failed_rows": 2 + } + ] + } +} +``` + +## Responses + +### 200 + +Statistics retrieved successfully. + +- **message**: string — `success` +- **data**: object + - **avg_tokens**: number — Average token count across all prompts. + - **avg_cost**: number — Average cost per request (USD). + - **avg_time**: number — Average response time in seconds. + - **prompts**: array — Per-prompt breakdown. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/dataset/{dataset_id}/run-prompt-stats/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} + +response = requests.get(url, headers=headers) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/dataset/{dataset_id}/run-prompt-stats/", + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/dataset/{dataset_id}/run-prompt-stats/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/clone-dataset.mdx b/src/pages/docs/api/datasets/clone-dataset.mdx new file mode 100644 index 00000000..79c36ec9 --- /dev/null +++ b/src/pages/docs/api/datasets/clone-dataset.mdx @@ -0,0 +1,144 @@ +--- +title: "Clone Dataset" +description: "Create a copy of an existing dataset with all its columns and rows." +--- + +# Clone Dataset + +Create a full copy of an existing dataset including all columns (user-created) and rows. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the source dataset to clone. + + +## Request Body + + + Name for the cloned dataset. If not provided, defaults to `Copy of {source_dataset_name}`. Must be unique within your organization. + + +### Example + +```json +{ + "new_dataset_name": "Copy of My Dataset" +} +``` + +## Response + +Returns the cloned dataset details. + +Confirmation message. +UUID of the newly cloned dataset. +Name of the cloned dataset. + +### Example Response + +```json +{ + "message": "Dataset cloned successfully", + "dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "dataset_name": "Copy of My Dataset" +} +``` + +## Responses + +### 200 + +Dataset cloned successfully. + +### 400 + +Bad request. Possible reasons: + +- **Duplicate name** - A dataset with this name already exists in your organization. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Source dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/clone-dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "new_dataset_name": "Copy of My Dataset" +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/clone-dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + new_dataset_name: "Copy of My Dataset" + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/clone-dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "new_dataset_name": "Copy of My Dataset" + }' +``` + diff --git a/src/pages/docs/api/datasets/columns/add-columns.mdx b/src/pages/docs/api/datasets/columns/add-columns.mdx new file mode 100644 index 00000000..3183eda4 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/add-columns.mdx @@ -0,0 +1,184 @@ +--- +title: "Add Columns" +description: "Add one or more columns to a dataset with specified names and data types." +--- + +# Add Columns + +Add one or more columns to a dataset. Returns the created column objects with their generated UUIDs. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +## Request Body + + + Array of column definitions. Each object must include `name` and `data_type`. + + +Each column object: + + + Name for the column. Must be unique within the dataset. + + + + Data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + Optional source type for the column. + + +### Example + +```json +{ + "new_columns_data": [ + { + "name": "context", + "data_type": "text" + }, + { + "name": "rating", + "data_type": "number" + } + ] +} +``` + +## Response + +Confirmation message. Example: `2 Columns added successfully`. +Array of created column objects with their UUIDs. + +### Example Response + +```json +{ + "message": "2 Columns added successfully", + "data": [ + { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "context", + "data_type": "text" + }, + { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "name": "rating", + "data_type": "number" + } + ] +} +``` + +## Responses + +### 200 + +Columns added successfully. Returns the created column objects. + +### 400 + +Bad request. Possible reasons: + +- **Invalid format** — `new_columns_data` must be a list. +- **Missing fields** — Each column must have `name` and `data_type`. +- **Duplicate name** — A column with this name already exists in the dataset. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_columns/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "new_columns_data": [ + {"name": "context", "data_type": "text"}, + {"name": "rating", "data_type": "number"} + ] +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_columns/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + new_columns_data: [ + { name: "context", data_type: "text" }, + { name: "rating", data_type: "number" } + ] + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_columns/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "new_columns_data": [ + {"name": "context", "data_type": "text"}, + {"name": "rating", "data_type": "number"} + ] + }' +``` + diff --git a/src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx b/src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx new file mode 100644 index 00000000..da033ca0 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx @@ -0,0 +1,180 @@ +--- +title: "Add Multiple Static Columns" +description: "Add multiple static columns to a dataset in a single request." +--- + +# Add Multiple Static Columns + +Add multiple static columns to a dataset in a single atomic operation. All columns are created together — if any column fails validation, none are added. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +## Request Body + + + Array of column definitions to add. Each object must contain `new_column_name` and `column_type`. + + +Each column object: + + + Name for the column. Must be unique within the dataset and within the request. + + + + Data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + Optional source type for the column. + + +### Example + +```json +{ + "columns": [ + { + "new_column_name": "input", + "column_type": "text" + }, + { + "new_column_name": "score", + "column_type": "number" + }, + { + "new_column_name": "metadata", + "column_type": "json" + } + ] +} +``` + +## Response + +Confirmation message indicating success. + +### Example Response + +```json +{ + "message": "3 columns added successfully" +} +``` + +## Responses + +### 200 + +All columns added successfully. Empty cells are created for each new column across all existing rows. + +### 400 + +Bad request. Possible reasons: + +- **Empty columns array** — At least one column must be provided. +- **Missing name or type** — Each column must have `new_column_name` and `column_type`. +- **Duplicate names in request** — Column names within the request must be unique. +- **Duplicate names in dataset** — A column with one of the provided names already exists in the dataset. +- **Invalid data type** — One or more `column_type` values are not valid. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_multiple_static_columns/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "columns": [ + {"new_column_name": "input", "column_type": "text"}, + {"new_column_name": "score", "column_type": "number"}, + {"new_column_name": "metadata", "column_type": "json"} + ] +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_multiple_static_columns/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + columns: [ + { new_column_name: "input", column_type: "text" }, + { new_column_name: "score", column_type: "number" }, + { new_column_name: "metadata", column_type: "json" } + ] + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_multiple_static_columns/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "columns": [ + {"new_column_name": "input", "column_type": "text"}, + {"new_column_name": "score", "column_type": "number"}, + {"new_column_name": "metadata", "column_type": "json"} + ] + }' +``` + diff --git a/src/pages/docs/api/datasets/columns/add-static-column.mdx b/src/pages/docs/api/datasets/columns/add-static-column.mdx new file mode 100644 index 00000000..5a5aeea0 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/add-static-column.mdx @@ -0,0 +1,150 @@ +--- +title: "Add Static Column" +description: "Add a single static column to an existing dataset." +--- + +# Add Static Column + +Add a new static column to a dataset. The column is created with the specified name and data type, and empty cells are added for all existing rows. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +## Request Body + + + Name for the new column. Must be unique within the dataset. + + + + Data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + Optional source type for the column. + + +### Example + +```json +{ + "new_column_name": "score", + "column_type": "number" +} +``` + +## Response + +Confirmation message. Example: `Column added successfully`. + +### Example Response + +```json +{ + "message": "Column added successfully" +} +``` + +## Responses + +### 200 + +Column added successfully. Empty cells are created for all existing rows in the dataset. + +### 400 + +Bad request. Possible reasons: + +- **Missing column name** — `new_column_name` is required. +- **Missing column type** — `column_type` is required. +- **Duplicate name** — A column with this name already exists in the dataset. +- **Invalid data type** — The provided `column_type` is not a valid data type. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_static_column/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "new_column_name": "score", + "column_type": "number" +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_static_column/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + new_column_name: "score", + column_type: "number" + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_static_column/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "new_column_name": "score", + "column_type": "number" + }' +``` + diff --git a/src/pages/docs/api/datasets/columns/delete-column.mdx b/src/pages/docs/api/datasets/columns/delete-column.mdx new file mode 100644 index 00000000..6a8ad2c9 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/delete-column.mdx @@ -0,0 +1,104 @@ +--- +title: "Delete Column" +description: "Delete a column and its associated data from a dataset." +--- + +# Delete Column + +Delete a column from a dataset. This removes the column, all associated cell data, and any linked resources (e.g., run prompt configurations or evaluation metrics). + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | +| `column_id` | string (UUID) | Yes | The UUID of the column to delete. | + +## Response + +Confirmation message indicating the column was deleted. + +### Example Response + +```json +{ + "message": "Column deleted successfully" +} +``` + +## Responses + +### 200 + +Column deleted successfully. The following cleanup is performed automatically: + +- All cell data in the column is deleted. +- The column is removed from the dataset's column order. +- If the column has a source (e.g., RUN_PROMPT, EVALUATION), the associated configuration is also deleted. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Column or dataset not found, or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_column/{column_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} + +response = requests.delete(url, headers=headers) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_column/{column_id}/", + { + method: "DELETE", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X DELETE "https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_column/{column_id}/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/columns/get-column-config.mdx b/src/pages/docs/api/datasets/columns/get-column-config.mdx new file mode 100644 index 00000000..2d3ac239 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/get-column-config.mdx @@ -0,0 +1,148 @@ +--- +title: "Get Column Config" +description: "Retrieve the configuration details for a specific column, including source-specific settings." +--- + +# Get Column Config + +Retrieve the full configuration for a specific column. The response varies based on the column's source type (e.g., RUN_PROMPT, EVALUATION, EXPERIMENT, OPTIMISATION). + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `column_id` | string (UUID) | Yes | The UUID of the column. | + +## Response + +The response structure depends on the column source type. + +### RUN_PROMPT Column + +```json +{ + "name": "gpt_output", + "model": "gpt-4o", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Summarize: {{input}}" + } + ], + "output_format": "string", + "temperature": 0.7, + "frequency_penalty": 0, + "presence_penalty": 0, + "max_tokens": 1024, + "top_p": 1, + "response_format": null, + "tool_choice": null, + "tools": [] +} +``` + +### EVALUATION Column + +```json +{ + "name": "relevance_eval", + "template": "Relevance", + "template_config": {}, + "description": "Evaluates relevance of the response", + "config": {}, + "status": "COMPLETED" +} +``` + +### EXPERIMENT Column + +```json +{ + "name": "experiment_v1", + "prompt_config": {}, + "status": "COMPLETED", + "user_eval_template_ids": [] +} +``` + +## Responses + +### 200 + +Column configuration retrieved successfully. Response fields vary by source type: + +- **RUN_PROMPT**: `name`, `model`, `messages`, `output_format`, `temperature`, `frequency_penalty`, `presence_penalty`, `max_tokens`, `top_p`, `response_format`, `tool_choice`, `tools` +- **EVALUATION**: `name`, `template`, `template_config`, `description`, `config`, `status` +- **EXPERIMENT**: `name`, `prompt_config`, `status`, `user_eval_template_ids` +- **OPTIMISATION**: `name`, `optimize_type`, `optimized_k_prompts`, `messages`, `status`, `model_config`, `user_eval_template_ids` + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Column not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/column-config/{column_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} + +response = requests.get(url, headers=headers) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/column-config/{column_id}/", + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/column-config/{column_id}/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/columns/get-column-details.mdx b/src/pages/docs/api/datasets/columns/get-column-details.mdx new file mode 100644 index 00000000..2700b1f6 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/get-column-details.mdx @@ -0,0 +1,132 @@ +--- +title: "Get Column Details" +description: "Retrieve column metadata for a dataset, including column names, types, and IDs." +--- + +# Get Column Details + +Retrieve the column metadata for a specific dataset. Returns a list of all columns with their IDs, names, and data types. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | + +### Query Parameters + +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| `include_prompt` | boolean | No | `false` | Whether to include RUN_PROMPT source columns. | +| `source` | string | No | - | Filter columns by source type (e.g., `STATIC`, `RUN_PROMPT`, `EVALUATION`). | + +## Response + +Status message. Example: `success`. +Response payload containing column configuration. + +### Example Response + +```json +{ + "message": "success", + "data": { + "column_config": [ + { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "input", + "data_type": "text" + }, + { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "name": "expected_output", + "data_type": "text" + } + ] + } +} +``` + +## Responses + +### 200 + +Column details retrieved successfully. Returns an array of column objects. + +- **message**: string — `success` +- **data**: object + - **column_config**: array of objects + - **id**: string (UUID) — Unique column identifier. + - **name**: string — Column name. + - **data_type**: string — Column data type (`text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`). + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/dataset/columns/{dataset_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} +params = { + "include_prompt": True +} + +response = requests.get(url, headers=headers, params=params) +print(response.json()) +``` +```typescript TypeScript +const params = new URLSearchParams({ include_prompt: "true" }); +const response = await fetch( + `https://api.futureagi.com/model-hub/dataset/columns/{dataset_id}/?${params}`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/dataset/columns/{dataset_id}/?include_prompt=true" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/columns/update-column-name.mdx b/src/pages/docs/api/datasets/columns/update-column-name.mdx new file mode 100644 index 00000000..66729051 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/update-column-name.mdx @@ -0,0 +1,136 @@ +--- +title: "Update Column Name" +description: "Rename an existing column in a dataset." +--- + +# Update Column Name + +Rename a column in a dataset. The new name must be unique within the dataset. Any derived variable references in run prompt or prompt version configurations are automatically updated. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | +| `column_id` | string (UUID) | Yes | The UUID of the column to rename. | + +## Request Body + + + The new name for the column. Must be unique within the dataset and cannot be empty. + + +### Example + +```json +{ + "new_column_name": "updated_name" +} +``` + +## Response + +Confirmation message. Example: `Column name updated successfully`. + +### Example Response + +```json +{ + "message": "Column name updated successfully" +} +``` + +## Responses + +### 200 + +Column name updated successfully. Any derived variable references are automatically updated. + +### 400 + +Bad request. Possible reasons: + +- **Empty name** — `new_column_name` cannot be empty. +- **Duplicate name** — A column with this name already exists in the dataset. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Column or dataset not found, or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_name/{column_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "new_column_name": "updated_name" +} + +response = requests.put(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_name/{column_id}/", + { + method: "PUT", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + new_column_name: "updated_name" + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X PUT "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_name/{column_id}/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "new_column_name": "updated_name" + }' +``` + diff --git a/src/pages/docs/api/datasets/columns/update-column-type.mdx b/src/pages/docs/api/datasets/columns/update-column-type.mdx new file mode 100644 index 00000000..6cd33838 --- /dev/null +++ b/src/pages/docs/api/datasets/columns/update-column-type.mdx @@ -0,0 +1,205 @@ +--- +title: "Update Column Type" +description: "Change the data type of an existing column with preview and conversion support." +--- + +# Update Column Type + +Change the data type of a column in a dataset. Supports a preview mode to validate conversion compatibility before applying changes. Only static columns (without a source) can be converted. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | +| `column_id` | string (UUID) | Yes | The UUID of the column. | + +## Request Body + + + Target data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + When `true` (default), returns a preview of the conversion without applying changes. Set to `false` to execute the conversion. + + + + When `true`, forces the conversion even if some values cannot be converted. Default: `false`. + + +### Example (Preview) + +```json +{ + "new_column_type": "number", + "preview": true +} +``` + +### Example (Execute) + +```json +{ + "new_column_type": "number", + "preview": false +} +``` + +## Response + +### Preview Response + +Status message. Example: `success`. +Preview data including invalid counts and sample conversions. + +```json +{ + "message": "success", + "data": { + "invalid_count": 2, + "invalid_values": ["abc", "N/A"], + "valid_conversion_samples": { + "42": 42, + "3.14": 3.14 + }, + "new_data_type": "number" + } +} +``` + +### Execution Response + +```json +{ + "message": "Column type conversion started", + "column_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "new_data_type": "number", + "status": "RUNNING" +} +``` + +## Responses + +### 200 + +- **Preview mode**: Returns conversion compatibility analysis. +- **Execution mode**: Conversion task started asynchronously. + +### 400 + +Bad request. Possible reasons: + +- **Source column** — Columns with a source (e.g., RUN_PROMPT, EVALUATION) cannot be type-converted. +- **Invalid data type** — The provided `new_column_type` is not valid. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Column or dataset not found, or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +# Preview conversion +url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} + +# Step 1: Preview +data = { + "new_column_type": "number", + "preview": True +} +response = requests.put(url, headers=headers, json=data) +print("Preview:", response.json()) + +# Step 2: Execute +data = { + "new_column_type": "number", + "preview": False +} +response = requests.put(url, headers=headers, json=data) +print("Execute:", response.json()) +``` +```typescript TypeScript +const url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/"; +const headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +}; + +// Step 1: Preview +const preview = await fetch(url, { + method: "PUT", + headers, + body: JSON.stringify({ new_column_type: "number", preview: true }) +}); +console.log("Preview:", await preview.json()); + +// Step 2: Execute +const execute = await fetch(url, { + method: "PUT", + headers, + body: JSON.stringify({ new_column_type: "number", preview: false }) +}); +console.log("Execute:", await execute.json()); +``` +```bash cURL +# Preview conversion +curl -X PUT "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "new_column_type": "number", + "preview": true + }' + +# Execute conversion +curl -X PUT "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "new_column_type": "number", + "preview": false + }' +``` + diff --git a/src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx b/src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx new file mode 100644 index 00000000..0eac73de --- /dev/null +++ b/src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx @@ -0,0 +1,177 @@ +--- +title: "Create Dataset from HuggingFace" +description: "Create a new dataset by importing data from a HuggingFace dataset." +--- + +# Create Dataset from HuggingFace + +Create a new dataset by importing data from a HuggingFace dataset. The dataset is processed in the background after creation. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + HuggingFace dataset path (e.g., `squad`, `glue`, `username/dataset-name`). + + + + Dataset configuration/subset name (e.g., `plain_text`, `mnli`). + + + + Dataset split to import (e.g., `train`, `test`, `validation`). + + + + Name for the dataset. If not provided, defaults to the HuggingFace dataset name with `/` replaced by `_`. Must be unique within your organization. + + + + Model type for the dataset (e.g., `GenerativeLLM`). + + + + Maximum number of rows to import. If not provided, all rows from the split are imported. + + +### Example + +```json +{ + "huggingface_dataset_name": "squad", + "huggingface_dataset_config": "plain_text", + "huggingface_dataset_split": "train", + "name": "My HuggingFace Dataset", + "num_rows": 100 +} +``` + +## Response + +Returns the created dataset details. Data import is processed in the background. + +Confirmation message. +UUID of the newly created dataset. +Name of the created dataset. +Model type of the created dataset. + +### Example Response + +```json +{ + "message": "Dataset creation started successfully. Please check in some time", + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "dataset_name": "My HuggingFace Dataset", + "dataset_model_type": "GenerativeLLM" +} +``` + +## Responses + +### 200 + +Dataset creation started. Data is being imported from HuggingFace in the background. + +### 400 + +Bad request. Possible reasons: + +- **Invalid dataset** - The HuggingFace dataset could not be found or accessed. +- **Invalid config/split** - The specified configuration or split does not exist. +- **Duplicate name** - A dataset with this name already exists in your organization. +- **Invalid num_rows** - Must be a non-negative integer. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 429 + +Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/create-dataset-from-huggingface/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "huggingface_dataset_name": "squad", + "huggingface_dataset_config": "plain_text", + "huggingface_dataset_split": "train", + "name": "My HuggingFace Dataset", + "num_rows": 100 +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/create-dataset-from-huggingface/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + huggingface_dataset_name: "squad", + huggingface_dataset_config: "plain_text", + huggingface_dataset_split: "train", + name: "My HuggingFace Dataset", + num_rows: 100 + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/create-dataset-from-huggingface/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "huggingface_dataset_name": "squad", + "huggingface_dataset_config": "plain_text", + "huggingface_dataset_split": "train", + "name": "My HuggingFace Dataset", + "num_rows": 100 + }' +``` + diff --git a/src/pages/docs/api/datasets/create-empty-dataset.mdx b/src/pages/docs/api/datasets/create-empty-dataset.mdx new file mode 100644 index 00000000..37e74195 --- /dev/null +++ b/src/pages/docs/api/datasets/create-empty-dataset.mdx @@ -0,0 +1,152 @@ +--- +title: "Create Empty Dataset" +description: "Create a new empty dataset with optional pre-created rows." +--- + +# Create Empty Dataset + +Create a new empty dataset. Optionally pre-populate with a small number of empty rows. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + Name for the dataset. Must be unique within your organization. + + + + Model type for the dataset (e.g., `GenerativeLLM`). + + + + Number of empty rows to pre-create. Maximum: 10. + + +### Example + +```json +{ + "new_dataset_name": "My Empty Dataset", + "model_type": "GenerativeLLM", + "row": 5 +} +``` + +## Response + +Returns the created dataset details. + +Confirmation message. +UUID of the newly created dataset. +Name of the created dataset. +Model type of the created dataset. + +### Example Response + +```json +{ + "message": "Empty dataset created successfully", + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "dataset_name": "My Empty Dataset", + "dataset_model_type": "GenerativeLLM" +} +``` + +## Responses + +### 200 + +Dataset created successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing name** - `new_dataset_name` is required. +- **Duplicate name** - A dataset with this name already exists in your organization. +- **Invalid row count** - `row` must be between 0 and 10. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 429 + +Resource limit reached. Your organization has exceeded the dataset creation quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/create-empty-dataset/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "new_dataset_name": "My Empty Dataset", + "model_type": "GenerativeLLM", + "row": 5 +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/create-empty-dataset/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + new_dataset_name: "My Empty Dataset", + model_type: "GenerativeLLM", + row: 5 + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/create-empty-dataset/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "new_dataset_name": "My Empty Dataset", + "model_type": "GenerativeLLM", + "row": 5 + }' +``` + diff --git a/src/pages/docs/api/datasets/delete-dataset.mdx b/src/pages/docs/api/datasets/delete-dataset.mdx new file mode 100644 index 00000000..22910d33 --- /dev/null +++ b/src/pages/docs/api/datasets/delete-dataset.mdx @@ -0,0 +1,135 @@ +--- +title: "Delete Dataset" +description: "Delete one or more datasets by their IDs." +--- + +# Delete Dataset + +Delete one or more datasets. This is a soft delete operation. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + Array of dataset UUIDs to delete. Must contain at least 1 and at most 50 items. All IDs must be valid UUIDs. + + +### Example + +```json +{ + "dataset_ids": [ + "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "b2c3d4e5-f6a7-8901-bcde-f12345678901" + ] +} +``` + +## Response + +Returns confirmation of deleted datasets. + +Confirmation message with count of deleted datasets. +Status indicator. Example: `success`. + +### Example Response + +```json +{ + "data": "2 datasets deleted successfully", + "status": "success" +} +``` + +## Responses + +### 200 + +Datasets deleted successfully. + +### 400 + +Bad request. Possible reasons: + +- **Empty list** - `dataset_ids` must contain at least one ID. +- **Too many IDs** - Maximum of 50 dataset IDs per request. +- **Invalid UUID** - One or more IDs are not valid UUIDs. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +One or more datasets not found in your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/delete_dataset/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "dataset_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"] +} + +response = requests.delete(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/delete_dataset/", + { + method: "DELETE", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + dataset_ids: ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"] + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X DELETE "https://api.futureagi.com/model-hub/develops/delete_dataset/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "dataset_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"] + }' +``` + diff --git a/src/pages/docs/api/datasets/delete-rows.mdx b/src/pages/docs/api/datasets/delete-rows.mdx new file mode 100644 index 00000000..4a633423 --- /dev/null +++ b/src/pages/docs/api/datasets/delete-rows.mdx @@ -0,0 +1,151 @@ +--- +title: "Delete Rows" +description: "Delete one or more rows from a dataset." +--- + +# Delete Rows + +Delete specific rows from a dataset by their IDs, or delete all rows. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the dataset containing the rows to delete. + + +## Request Body + + + Array of row UUIDs to delete. Required if `selected_all_rows` is `false`. + + + + Set to `true` to delete all rows in the dataset. When `true`, `row_ids` is ignored. Default: `false`. + + +### Example + +```json +{ + "row_ids": [ + "row-uuid-1", + "row-uuid-2" + ], + "selected_all_rows": false +} +``` + +## Response + +Returns confirmation of deleted rows. + +Confirmation message. +Status indicator. Example: `success`. + +### Example Response + +```json +{ + "data": "Row deleted successfully", + "status": "success" +} +``` + +## Responses + +### 200 + +Rows deleted successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing rows** - Either `row_ids` or `selected_all_rows` must be provided. +- **No matching rows** - The provided row IDs do not exist in the dataset. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_row/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "row_ids": ["row-uuid-1", "row-uuid-2"], + "selected_all_rows": False +} + +response = requests.delete(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_row/", + { + method: "DELETE", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + row_ids: ["row-uuid-1", "row-uuid-2"], + selected_all_rows: false + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X DELETE "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_row/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "row_ids": ["row-uuid-1", "row-uuid-2"], + "selected_all_rows": false + }' +``` + diff --git a/src/pages/docs/api/datasets/duplicate-dataset.mdx b/src/pages/docs/api/datasets/duplicate-dataset.mdx new file mode 100644 index 00000000..607a8132 --- /dev/null +++ b/src/pages/docs/api/datasets/duplicate-dataset.mdx @@ -0,0 +1,166 @@ +--- +title: "Duplicate Dataset" +description: "Create a new dataset from selected rows of an existing dataset." +--- + +# Duplicate Dataset + +Create a new dataset by duplicating an existing dataset. Optionally select specific rows to include. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the source dataset to duplicate. + + +## Request Body + + + Name for the new dataset. Must be unique within your organization. + + + + Array of row UUIDs to include in the new dataset. If not provided, all rows are included. + + + + Set to `true` to include all rows. Default: `false`. + + +### Example + +```json +{ + "name": "Duplicated Dataset", + "row_ids": ["row-uuid-1", "row-uuid-2"], + "selected_all_rows": false +} +``` + +## Response + +Returns the new dataset details. + +Confirmation message. +UUID of the newly created dataset. +Name of the new dataset. +Number of columns copied. +Number of rows copied. + +### Example Response + +```json +{ + "data": { + "message": "Dataset duplicated successfully", + "new_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "new_dataset_name": "Duplicated Dataset", + "columns_copied": 5, + "rows_copied": 100 + }, + "status": "success" +} +``` + +## Responses + +### 200 + +Dataset duplicated successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing name** - The `name` field is required. +- **Duplicate name** - A dataset with this name already exists. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Source dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "name": "Duplicated Dataset", + "selected_all_rows": True +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + name: "Duplicated Dataset", + selected_all_rows: true + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "Duplicated Dataset", + "selected_all_rows": true + }' +``` + diff --git a/src/pages/docs/api/datasets/duplicate-rows.mdx b/src/pages/docs/api/datasets/duplicate-rows.mdx new file mode 100644 index 00000000..fb6fbd66 --- /dev/null +++ b/src/pages/docs/api/datasets/duplicate-rows.mdx @@ -0,0 +1,166 @@ +--- +title: "Duplicate Rows" +description: "Create copies of specific rows within a dataset." +--- + +# Duplicate Rows + +Create one or more copies of selected rows within the same dataset. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the dataset containing the rows to duplicate. + + +## Request Body + + + Array of row UUIDs to duplicate. Required if `selected_all_rows` is `false`. + + + + Set to `true` to duplicate all rows. Default: `false`. + + + + Number of copies to create per row. Must be a positive integer. Default: `1`. + + +### Example + +```json +{ + "row_ids": ["row-uuid-1", "row-uuid-2"], + "num_copies": 2 +} +``` + +## Response + +Returns details of the duplication. + +Confirmation message. +Number of source rows duplicated. +Number of copies created per row. +Total number of new rows created. +Array of UUIDs for the newly created rows. + +### Example Response + +```json +{ + "data": { + "message": "Rows duplicated successfully", + "source_rows": 2, + "copies_per_row": 2, + "total_new_rows": 4, + "new_row_ids": ["new-row-1", "new-row-2", "new-row-3", "new-row-4"] + }, + "status": "success" +} +``` + +## Responses + +### 200 + +Rows duplicated successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing rows** - Either `row_ids` or `selected_all_rows` must be provided. +- **Invalid num_copies** - Must be a positive integer. +- **No matching rows** - The provided row IDs do not exist in the dataset. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate-rows/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "row_ids": ["row-uuid-1", "row-uuid-2"], + "num_copies": 2 +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate-rows/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + row_ids: ["row-uuid-1", "row-uuid-2"], + num_copies: 2 + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate-rows/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "row_ids": ["row-uuid-1", "row-uuid-2"], + "num_copies": 2 + }' +``` + diff --git a/src/pages/docs/api/datasets/get-dataset.mdx b/src/pages/docs/api/datasets/get-dataset.mdx new file mode 100644 index 00000000..268a0e1d --- /dev/null +++ b/src/pages/docs/api/datasets/get-dataset.mdx @@ -0,0 +1,122 @@ +--- +title: "Get Dataset" +description: "Retrieve details of a specific dataset by ID." +--- + +# Get Dataset + +Retrieve details of a specific dataset including its name, columns, row count, and metadata. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the dataset to retrieve. + + +## Response + +Returns the dataset details. + +UUID of the dataset. +Name of the dataset. +List of column objects, each containing `id`, `name`, and `data_type`. +Total number of rows in the dataset. +ISO 8601 timestamp of when the dataset was created. +Type of the dataset. + +### Example Response + +```json +{ + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "My Evaluation Dataset", + "columns": [ + { + "id": "col-uuid-1", + "name": "input", + "data_type": "text" + }, + { + "id": "col-uuid-2", + "name": "expected_output", + "data_type": "text" + } + ], + "number_of_datapoints": 150, + "created_at": "2025-01-15T10:30:00Z", + "dataset_type": "GenerativeLLM" +} +``` + +## Responses + +### 200 + +Dataset retrieved successfully. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found. The provided ID does not match any dataset in your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} + +response = requests.get(url, headers=headers) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/", + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/list-datasets.mdx b/src/pages/docs/api/datasets/list-datasets.mdx new file mode 100644 index 00000000..e3b00a03 --- /dev/null +++ b/src/pages/docs/api/datasets/list-datasets.mdx @@ -0,0 +1,150 @@ +--- +title: "List Datasets" +description: "Retrieve a paginated list of datasets in your organization." +--- + +# List Datasets + +Retrieve a paginated list of datasets with optional search and sorting. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Query Parameters + + + Page number (zero-indexed). Default: `0`. + + + + Number of items per page. Must be between 1 and 100. Default: `10`. + + + + Case-insensitive search filter by dataset name. + + + + JSON array of sort objects. Each object contains: + - `column_id` - One of: `name`, `numberOfDatapoints`, `numberOfExperiments`, `numberOfOptimisations`, `derivedDatasets`, `createdAt` + - `type` - `ascending` or `descending` + + +## Response + +Returns a paginated list of datasets. + + + Array of dataset objects, each containing: + - `id` (string) - Dataset UUID + - `name` (string) - Dataset name + - `number_of_datapoints` (integer) - Number of rows + - `number_of_experiments` (integer) - Number of linked experiments + - `number_of_optimisations` (integer) - Number of linked optimisations + - `derived_datasets` (integer) - Number of derived datasets + - `created_at` (string) - Creation timestamp in `YYYY-MM-DD HH:MM` format + - `dataset_type` (string) - Type of the dataset + +Total number of pages. +Total number of datasets matching the query. + +### Example Response + +```json +{ + "data": { + "datasets": [ + { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "My Evaluation Dataset", + "number_of_datapoints": 150, + "number_of_experiments": 3, + "number_of_optimisations": 1, + "derived_datasets": 0, + "created_at": "2025-01-15 10:30", + "dataset_type": "GenerativeLLM" + } + ], + "total_pages": 5, + "total_count": 42 + }, + "status": "success" +} +``` + +## Responses + +### 200 + +Datasets listed successfully. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/get-datasets/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} +params = { + "page": 0, + "page_size": 10, + "search_text": "evaluation" +} + +response = requests.get(url, headers=headers, params=params) +print(response.json()) +``` +```typescript TypeScript +const params = new URLSearchParams({ + page: "0", + page_size: "10", + search_text: "evaluation" +}); + +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/get-datasets/?${params}`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/develops/get-datasets/?page=0&page_size=10&search_text=evaluation" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/merge-dataset.mdx b/src/pages/docs/api/datasets/merge-dataset.mdx new file mode 100644 index 00000000..6cb50b9a --- /dev/null +++ b/src/pages/docs/api/datasets/merge-dataset.mdx @@ -0,0 +1,163 @@ +--- +title: "Merge Dataset" +description: "Merge rows from one dataset into another dataset." +--- + +# Merge Dataset + +Merge rows from a source dataset into a target dataset. Columns are matched by name and data type. New columns are created in the target for any unmatched source columns. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the source dataset to merge rows from. + + +## Request Body + + + UUID of the target dataset to merge rows into. Cannot be the same as the source dataset. + + + + Array of row UUIDs from the source dataset to merge. If not provided, all rows are merged. + + + + Set to `true` to merge all rows from the source dataset. Default: `false`. + + +### Example + +```json +{ + "target_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "row_ids": ["row-uuid-1", "row-uuid-2"], + "selected_all_rows": false +} +``` + +## Response + +Returns details of the merge operation. + +Confirmation message. +Number of rows merged into the target dataset. +Number of new columns created in the target dataset for unmatched source columns. + +### Example Response + +```json +{ + "data": { + "message": "Dataset merged successfully", + "rows_merged": 50, + "new_columns_created": 2 + }, + "status": "success" +} +``` + +## Responses + +### 200 + +Datasets merged successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing target** - `target_dataset_id` is required. +- **Same dataset** - Source and target datasets cannot be the same. +- **No rows** - No rows to merge from the source dataset. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Source or target dataset not found. + +### 429 + +Resource limit reached. Your organization has exceeded the row addition quota. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/merge/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "target_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "selected_all_rows": True +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/merge/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + target_dataset_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + selected_all_rows: true + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/merge/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "target_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "selected_all_rows": true + }' +``` + diff --git a/src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx b/src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx new file mode 100644 index 00000000..5147f8c5 --- /dev/null +++ b/src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx @@ -0,0 +1,251 @@ +--- +title: "Add Run Prompt Column" +description: "Add a new run prompt column to a dataset that generates LLM responses for each row." +--- + +# Add Run Prompt Column + +Add a new run prompt column to a dataset. This creates a column that executes an LLM prompt for each row, populating cells with the model's responses. The prompt can reference other column values using template variables. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + The UUID of the dataset to add the column to. + + + + Name for the new column. Must be unique within the dataset. Minimum 1 character. + + + + Prompt configuration object. + + +### Config Object + + + The model to use (e.g., `gpt-4o`, `gpt-4o-mini`, `claude-3-5-sonnet`). + + + + Array of message objects defining the prompt. Use `{{column_name}}` syntax to reference column values. + + + + Output format. Values: `string` (default), `audio`, `json`. + + + + Sampling temperature (0-2). Default: `1`. + + + + Maximum tokens in the response. + + + + Nucleus sampling parameter (0-1). Default: `1`. + + + + Frequency penalty (-2 to 2). Default: `0`. + + + + Presence penalty (-2 to 2). Default: `0`. + + + + Response format constraint (e.g., `json_object`). + + + + Tool selection strategy (e.g., `auto`, `none`, `required`). + + + + Array of tool definitions. Each tool has `id`, `name`, and `config`. + + + + Number of concurrent requests. Controls how many rows are processed simultaneously. + + +### Example + +```json +{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "gpt_response", + "config": { + "model": "gpt-4o", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Summarize the following text:\n\n{{input}}" + } + ], + "output_format": "string", + "temperature": 0.7, + "max_tokens": 1024, + "top_p": 1, + "frequency_penalty": 0, + "presence_penalty": 0 + } +} +``` + +## Response + +Confirmation message. Example: `Run prompt column added successfully`. + +### Example Response + +```json +{ + "message": "Run prompt column added successfully" +} +``` + +## Responses + +### 200 + +Column created and prompt execution started. Rows are processed asynchronously in the background. + +### 400 + +Bad request. Possible reasons: + +- **Missing dataset_id** — `dataset_id` is required. +- **Missing name** — Column `name` is required and must be at least 1 character. +- **Duplicate name** — A column with this name already exists in the dataset. +- **Invalid config** — The prompt configuration is invalid. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/add_run_prompt_column/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "gpt_response", + "config": { + "model": "gpt-4o", + "messages": [ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Summarize: {{input}}"} + ], + "output_format": "string", + "temperature": 0.7, + "max_tokens": 1024 + } +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/add_run_prompt_column/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + name: "gpt_response", + config: { + model: "gpt-4o", + messages: [ + { role: "system", content: "You are a helpful assistant." }, + { role: "user", content: "Summarize: {{input}}" } + ], + output_format: "string", + temperature: 0.7, + max_tokens: 1024 + } + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/add_run_prompt_column/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "gpt_response", + "config": { + "model": "gpt-4o", + "messages": [ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Summarize: {{input}}"} + ], + "output_format": "string", + "temperature": 0.7, + "max_tokens": 1024 + } + }' +``` + diff --git a/src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx b/src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx new file mode 100644 index 00000000..686b16ac --- /dev/null +++ b/src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx @@ -0,0 +1,191 @@ +--- +title: "Edit Run Prompt Column" +description: "Update the configuration of an existing run prompt column and re-execute the prompt." +--- + +# Edit Run Prompt Column + +Update the configuration of an existing run prompt column. This clears all existing cell values and re-executes the prompt with the new configuration for all rows. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + The UUID of the dataset. + + + + The UUID of the run prompt column to edit. + + + + New name for the column. If not provided, the existing name is kept. + + + + Updated prompt configuration. See [Add Run Prompt Column](/docs/api/datasets/run-prompt/add-run-prompt-column) for the full config schema. + + +### Example + +```json +{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "name": "gpt_response_v2", + "config": { + "model": "gpt-4o-mini", + "messages": [ + { + "role": "user", + "content": "Answer the following question:\n\n{{question}}" + } + ], + "temperature": 0.5, + "max_tokens": 512 + } +} +``` + +## Response + +Confirmation message indicating the column was updated. + +### Example Response + +```json +{ + "message": "Run prompt column updated successfully" +} +``` + +## Responses + +### 200 + +Column updated and prompt re-execution started. All existing cell values are cleared and regenerated asynchronously. + +### 400 + +Bad request. Possible reasons: + +- **Invalid column** — The specified column is not a RUN_PROMPT column. +- **Invalid config** — The prompt configuration is invalid. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset or column not found, or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/edit_run_prompt_column/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "name": "gpt_response_v2", + "config": { + "model": "gpt-4o-mini", + "messages": [ + {"role": "user", "content": "Answer: {{question}}"} + ], + "temperature": 0.5, + "max_tokens": 512 + } +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/edit_run_prompt_column/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + column_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + name: "gpt_response_v2", + config: { + model: "gpt-4o-mini", + messages: [ + { role: "user", content: "Answer: {{question}}" } + ], + temperature: 0.5, + max_tokens: 512 + } + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/develops/edit_run_prompt_column/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "name": "gpt_response_v2", + "config": { + "model": "gpt-4o-mini", + "messages": [ + {"role": "user", "content": "Answer: {{question}}"} + ], + "temperature": 0.5, + "max_tokens": 512 + } + }' +``` + diff --git a/src/pages/docs/api/datasets/run-prompt/get-column-values.mdx b/src/pages/docs/api/datasets/run-prompt/get-column-values.mdx new file mode 100644 index 00000000..9c72c8b9 --- /dev/null +++ b/src/pages/docs/api/datasets/run-prompt/get-column-values.mdx @@ -0,0 +1,182 @@ +--- +title: "Get Column Values" +description: "Retrieve sample values from specified columns in a dataset for prompt preview." +--- + +# Get Column Values + +Retrieve sample values from specified dataset columns. Useful for previewing template variable values before configuring a run prompt column. Returns the first 10 rows of data for each requested column. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Request Body + + + The UUID of the dataset. + + + + A mapping of placeholder names to column UUIDs. Keys are the placeholder names used in prompt templates, values are column UUIDs. + + +### Example + +```json +{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "column_placeholders": { + "input": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "context": "c3d4e5f6-a7b8-9012-cdef-123456789012" + } +} +``` + +## Response + +Status message. Example: `success`. +Column values organized by placeholder name. + +### Example Response + +```json +{ + "message": "success", + "data": { + "result": { + "input": { + "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "column_name": "input", + "values": [ + "What is machine learning?", + "Explain neural networks", + "How does backpropagation work?" + ] + }, + "context": { + "column_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", + "column_name": "context", + "values": [ + "ML textbook chapter 1", + "Deep learning reference", + "Optimization theory notes" + ] + } + } + } +} +``` + +## Responses + +### 200 + +Column values retrieved successfully. Returns up to 10 sample values per column. + +- **message**: string — `success` +- **data**: object + - **result**: object — Keyed by placeholder name. + - **column_id**: string (UUID) — Column identifier. + - **column_name**: string — Column display name. + - **values**: array — Sample values from the column (up to 10). + +### 400 + +Bad request. Possible reasons: + +- **Missing dataset_id** — `dataset_id` is required. +- **Missing column_placeholders** — `column_placeholders` is required. +- **Invalid column** — One or more column UUIDs do not exist in the dataset. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/get-column-values/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "column_placeholders": { + "input": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "context": "c3d4e5f6-a7b8-9012-cdef-123456789012" + } +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/get-column-values/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + column_placeholders: { + input: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + context: "c3d4e5f6-a7b8-9012-cdef-123456789012" + } + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/get-column-values/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "column_placeholders": { + "input": "b2c3d4e5-f6a7-8901-bcde-f12345678901", + "context": "c3d4e5f6-a7b8-9012-cdef-123456789012" + } + }' +``` + diff --git a/src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx b/src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx new file mode 100644 index 00000000..6f6a88cf --- /dev/null +++ b/src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx @@ -0,0 +1,130 @@ +--- +title: "Get Model Voices" +description: "Retrieve available voice options for a specific model's audio output." +--- + +# Get Model Voices + +Retrieve the available voice options, supported audio formats, and defaults for a specific model's audio output capabilities. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `model` | string | Yes | The model name to retrieve voice options for (e.g., `gpt-4o-audio-preview`). | + +## Response + +Status message. Example: `success`. +Voice configuration for the specified model. + +### Example Response + +```json +{ + "message": "success", + "data": { + "model_name": "gpt-4o-audio-preview", + "provider": "openai", + "custom_voice_supported": true, + "supported_voices": [ + { "id": "alloy", "name": "Alloy", "type": "system" }, + { "id": "echo", "name": "Echo", "type": "system" }, + { "id": "custom-voice-id", "name": "My Custom Voice", "type": "custom" } + ], + "supported_formats": ["mp3", "wav", "opus", "flac"], + "default_voice": "alloy", + "default_format": "mp3" + } +} +``` + +## Responses + +### 200 + +Voice options retrieved successfully. + +- **message**: string — `success` +- **data**: object + - **model_name**: string — Model identifier. + - **provider**: string — Model provider. + - **custom_voice_supported**: boolean — Whether custom voices are supported. + - **supported_voices**: array — Available voices. + - **id**: string — Voice identifier. + - **name**: string — Display name. + - **type**: string — `system` or `custom`. + - **supported_formats**: array of strings — Supported audio formats. + - **default_voice**: string — Default voice ID. + - **default_format**: string — Default audio format. + +### 400 + +Bad request. The `model` query parameter is required. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/api/model_voices/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} +params = { + "model": "gpt-4o-audio-preview" +} + +response = requests.get(url, headers=headers, params=params) +print(response.json()) +``` +```typescript TypeScript +const params = new URLSearchParams({ model: "gpt-4o-audio-preview" }); +const response = await fetch( + `https://api.futureagi.com/model-hub/api/model_voices/?${params}`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/api/model_voices/?model=gpt-4o-audio-preview" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx new file mode 100644 index 00000000..bf05bee0 --- /dev/null +++ b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx @@ -0,0 +1,153 @@ +--- +title: "Retrieve Run Prompt Column Config" +description: "Get the full configuration of an existing run prompt column." +--- + +# Retrieve Run Prompt Column Config + +Retrieve the complete configuration of a run prompt column, including model settings, messages, tools, and output format. Column UUID references in messages are resolved back to column names. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Query Parameters + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `column_id` | string (UUID) | Yes | The UUID of the run prompt column. | + +## Response + +Status message. Example: `success`. +Configuration object for the run prompt column. + +### Example Response + +```json +{ + "message": "success", + "data": { + "config": { + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "gpt_response", + "model": "gpt-4o", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Summarize: {{input}}" + } + ], + "temperature": 0.7, + "frequency_penalty": 0, + "presence_penalty": 0, + "max_tokens": 1024, + "top_p": 1, + "response_format": null, + "tool_choice": null, + "tools": [], + "output_format": "string", + "concurrency": 5, + "run_prompt_config": {} + } + } +} +``` + +## Responses + +### 200 + +Configuration retrieved successfully. + +- **message**: string — `success` +- **data**: object + - **config**: object + - **dataset_id**: string (UUID) — Dataset identifier. + - **name**: string — Column name. + - **model**: string — Model used for generation. + - **messages**: array — Prompt messages with column variable references. + - **temperature**: number — Sampling temperature. + - **frequency_penalty**: number — Frequency penalty. + - **presence_penalty**: number — Presence penalty. + - **max_tokens**: integer — Maximum response tokens. + - **top_p**: number — Nucleus sampling parameter. + - **response_format**: string or null — Response format constraint. + - **tool_choice**: string or null — Tool selection strategy. + - **tools**: array — Tool definitions with `id`, `name`, `config`. + - **output_format**: string — Output format (`string`, `audio`, `json`). + - **concurrency**: integer — Concurrent request count. + - **run_prompt_config**: object — Additional run prompt settings. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Column not found or is not a run prompt column. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_column_config/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} +params = { + "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" +} + +response = requests.get(url, headers=headers, params=params) +print(response.json()) +``` +```typescript TypeScript +const params = new URLSearchParams({ + column_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901" +}); +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_column_config/?${params}`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_column_config/?column_id=b2c3d4e5-f6a7-8901-bcde-f12345678901" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx new file mode 100644 index 00000000..72edb4ca --- /dev/null +++ b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx @@ -0,0 +1,139 @@ +--- +title: "Retrieve Run Prompt Options" +description: "Get available models, tools, output formats, and tool choices for run prompt configuration." +--- + +# Retrieve Run Prompt Options + +Retrieve the available options for configuring a run prompt column, including supported models, tools, output formats, and tool choice strategies. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Response + +Status message. Example: `success`. +Available options for run prompt configuration. + +### Example Response + +```json +{ + "message": "success", + "data": { + "models": [ + { + "model_name": "gpt-4o", + "providers": ["openai"], + "is_available": true + }, + { + "model_name": "claude-3-5-sonnet", + "providers": ["anthropic"], + "is_available": true + } + ], + "tool_config": {}, + "available_tools": [ + { + "id": "tool-uuid", + "name": "web_search", + "yaml_config": "...", + "config": {}, + "config_type": "function", + "description": "Search the web for information" + } + ], + "output_formats": [ + { "value": "string", "label": "String" }, + { "value": "audio", "label": "Audio" }, + { "value": "json", "label": "JSON" } + ], + "tool_choices": [ + { "value": "auto", "label": "Auto" }, + { "value": "none", "label": "None" }, + { "value": "required", "label": "Required" } + ] + } +} +``` + +## Responses + +### 200 + +Options retrieved successfully. + +- **message**: string — `success` +- **data**: object + - **models**: array — Available LLM models. + - **model_name**: string — Model identifier. + - **providers**: array of strings — Available providers. + - **is_available**: boolean — Whether the model is currently available. + - **tool_config**: object — Tool configuration schema. + - **available_tools**: array — Organization's available tools. + - **id**: string (UUID) — Tool identifier. + - **name**: string — Tool name. + - **config**: object — Tool configuration. + - **config_type**: string — Configuration type. + - **description**: string — Tool description. + - **output_formats**: array — Supported output formats with `value` and `label`. + - **tool_choices**: array — Supported tool choice strategies with `value` and `label`. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_options/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" +} + +response = requests.get(url, headers=headers) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_options/", + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY" + } + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_options/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" +``` + diff --git a/src/pages/docs/api/datasets/run-prompt/tts-voices.mdx b/src/pages/docs/api/datasets/run-prompt/tts-voices.mdx new file mode 100644 index 00000000..cef7d9ac --- /dev/null +++ b/src/pages/docs/api/datasets/run-prompt/tts-voices.mdx @@ -0,0 +1,207 @@ +--- +title: "TTS Voices" +description: "Manage custom text-to-speech voices for your organization." +--- + +# TTS Voices + +Create, list, retrieve, update, and delete custom text-to-speech (TTS) voices for your organization. Custom voices can be used with audio output in run prompt columns. + +## List Voices + + + +### Response + +```json +[ + { + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "Customer Support Voice", + "voice_id": "custom_voice_123", + "provider": "openai", + "model": "tts-1", + "description": "Warm, professional tone for customer support", + "created_at": "2024-01-15T10:30:00Z" + } +] +``` + +## Create Voice + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Endpoints + +| Method | Endpoint | Description | +|--------|----------|-------------| +| GET | `/model-hub/tts-voices/` | List all TTS voices | +| POST | `/model-hub/tts-voices/` | Create a new TTS voice | +| GET | `/model-hub/tts-voices/{id}/` | Retrieve a specific voice | +| PATCH | `/model-hub/tts-voices/{id}/` | Update a voice | +| DELETE | `/model-hub/tts-voices/{id}/` | Delete a voice | + +## Request Body (Create / Update) + + + Display name for the TTS voice. + + + + Provider-specific voice identifier. + + + + TTS provider (e.g., `openai`, `elevenlabs`). + + + + TTS model to use (e.g., `tts-1`, `tts-1-hd`). + + + + Description of the voice characteristics. + + +### Example + +```json +{ + "name": "Customer Support Voice", + "voice_id": "custom_voice_123", + "provider": "openai", + "model": "tts-1", + "description": "Warm, professional tone for customer support" +} +``` + +## Responses + +### 200 / 201 + +Voice operation completed successfully. Returns the voice object. + +- **id**: string (UUID) — Voice identifier. +- **name**: string — Display name. +- **voice_id**: string — Provider-specific voice ID. +- **provider**: string — TTS provider. +- **model**: string — TTS model. +- **description**: string — Voice description. +- **created_at**: string (datetime) — Creation timestamp. + +### 400 + +Bad request. Missing required fields or invalid data. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Voice not found or does not belong to your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +base_url = "https://api.futureagi.com/model-hub/tts-voices/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} + +# List voices +response = requests.get(base_url, headers=headers) +print("List:", response.json()) + +# Create voice +data = { + "name": "Customer Support Voice", + "voice_id": "custom_voice_123", + "provider": "openai", + "model": "tts-1", + "description": "Warm, professional tone" +} +response = requests.post(base_url, headers=headers, json=data) +print("Created:", response.json()) +``` +```typescript TypeScript +const baseUrl = "https://api.futureagi.com/model-hub/tts-voices/"; +const headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +}; + +// List voices +const listRes = await fetch(baseUrl, { headers }); +console.log("List:", await listRes.json()); + +// Create voice +const createRes = await fetch(baseUrl, { + method: "POST", + headers, + body: JSON.stringify({ + name: "Customer Support Voice", + voice_id: "custom_voice_123", + provider: "openai", + model: "tts-1", + description: "Warm, professional tone" + }) +}); +console.log("Created:", await createRes.json()); +``` +```bash cURL +# List voices +curl -X GET "https://api.futureagi.com/model-hub/tts-voices/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" + +# Create voice +curl -X POST "https://api.futureagi.com/model-hub/tts-voices/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "Customer Support Voice", + "voice_id": "custom_voice_123", + "provider": "openai", + "model": "tts-1", + "description": "Warm, professional tone" + }' +``` + diff --git a/src/pages/docs/api/datasets/update-cell-value.mdx b/src/pages/docs/api/datasets/update-cell-value.mdx new file mode 100644 index 00000000..410f9bd9 --- /dev/null +++ b/src/pages/docs/api/datasets/update-cell-value.mdx @@ -0,0 +1,166 @@ +--- +title: "Update Cell Value" +description: "Update the value of a specific cell in a dataset." +--- + +# Update Cell Value + +Update the value of a single cell in a dataset, identified by row ID and column ID. Supports text, boolean, and file uploads. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the dataset containing the cell. + + +## Request Body + +Accepts `application/json` for text/boolean values or `multipart/form-data` for file uploads. + + + UUID of the row containing the cell. + + + + UUID of the column containing the cell. + + + + The new value for the cell. The accepted format depends on the column data type: + - **text** - Any string value + - **boolean** - `"true"` or `"false"` + - **image/audio/document** - File upload (use `multipart/form-data`) + + +### Example (JSON) + +```json +{ + "row_id": "row-uuid-1", + "column_id": "col-uuid-1", + "new_value": "Updated text value" +} +``` + +## Response + +Returns confirmation of the update. + +Confirmation message. +Status indicator. Example: `success`. + +### Example Response + +```json +{ + "data": "Cell value updated successfully", + "status": "success" +} +``` + +## Responses + +### 200 + +Cell value updated successfully. + +### 400 + +Bad request. Possible reasons: + +- **Missing fields** - Both `row_id` and `column_id` are required. +- **Cell not found** - The specified row/column combination does not exist in the dataset. +- **Non-editable column** - The column is a system-generated column and cannot be edited. +- **Invalid boolean** - For boolean columns, value must be `"true"` or `"false"`. +- **Value too long** - The value exceeds the maximum allowed character length. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +# Text value update +url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update_cell_value/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "row_id": "row-uuid-1", + "column_id": "col-uuid-1", + "new_value": "Updated text value" +} + +response = requests.put(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update_cell_value/", + { + method: "PUT", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + row_id: "row-uuid-1", + column_id: "col-uuid-1", + new_value: "Updated text value" + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X PUT "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update_cell_value/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "row_id": "row-uuid-1", + "column_id": "col-uuid-1", + "new_value": "Updated text value" + }' +``` + diff --git a/src/pages/docs/api/datasets/update-dataset.mdx b/src/pages/docs/api/datasets/update-dataset.mdx new file mode 100644 index 00000000..775098d6 --- /dev/null +++ b/src/pages/docs/api/datasets/update-dataset.mdx @@ -0,0 +1,139 @@ +--- +title: "Update Dataset" +description: "Update dataset properties such as name." +--- + +# Update Dataset + +Update the properties of an existing dataset. Currently supports renaming a dataset. + + + +## Authentication + +All requests require authentication via API keys: + +| Header | Description | +|--------|-------------| +| `X-Api-Key` | Your API key | +| `X-Secret-Key` | Your secret key | + +## Parameters + +### Path Parameters + + + UUID of the dataset to update. + + +## Request Body + + + New name for the dataset. Must be unique within your organization. + + +### Example + +```json +{ + "name": "Updated Dataset Name" +} +``` + +## Response + +Returns the updated dataset details. + +UUID of the updated dataset. +Updated name of the dataset. + +### Example Response + +```json +{ + "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "name": "Updated Dataset Name" +} +``` + +## Responses + +### 200 + +Dataset updated successfully. + +### 400 + +Bad request. Possible reasons: + +- **Duplicate name** - A dataset with this name already exists in your organization. +- **Missing name** - The `name` field is required. + +### 401 + +Authentication credentials were not provided or are invalid. + +### 404 + +Dataset not found. The provided ID does not match any dataset in your organization. + +### 500 + +Internal server error. + +## Code Examples + + +```python Python +import requests + +url = "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" +headers = { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" +} +data = { + "name": "Updated Dataset Name" +} + +response = requests.post(url, headers=headers, json=data) +print(response.json()) +``` +```typescript TypeScript +const response = await fetch( + "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/", + { + method: "POST", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + }, + body: JSON.stringify({ + name: "Updated Dataset Name" + }) + } +); + +const data = await response.json(); +console.log(data); +``` +```bash cURL +curl -X POST "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "Updated Dataset Name" + }' +``` + diff --git a/src/pages/docs/api/evals-list/getevalslist.mdx b/src/pages/docs/api/evals-list/getevalslist.mdx index 83681658..19b43d81 100644 --- a/src/pages/docs/api/evals-list/getevalslist.mdx +++ b/src/pages/docs/api/evals-list/getevalslist.mdx @@ -5,14 +5,22 @@ description: "Retrieves a list of evaluations for a given dataset, with options # Get Evals List -Retrieves a list of evaluations for a given dataset, with options for filtering and ordering. +Retrieves a list of evaluations available for a given dataset, including built-in and user-created evals, with support for filtering by category, type, tags, and use cases. ## Authentication @@ -30,13 +38,19 @@ All requests require authentication via API keys: | Parameter | Type | Required | Description | |-----------|------|----------|-------------| -| `dataset_id` | string | Yes | The UUID of the dataset for which to retrieve the evaluations. | +| `dataset_id` | string (UUID) | Yes | The UUID of the dataset to retrieve evaluations for. | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| -| `search_text` | string | No | Text to search for in the evaluation names. | +| `search_text` | string | No | Text to search for in evaluation names (case-insensitive). | +| `eval_categories` | string | No | Filter by category. One of: `futureagi_built`, `user_built`. | +| `eval_type` | string | No | Filter by type. One of: `preset`, `user`, `previously_configured`. | +| `eval_tags[]` | array | No | Filter by one or more eval tags. | +| `use_cases[]` | array | No | Filter by one or more use cases. | +| `experiment_id` | string (UUID) | No | Scope results to a specific experiment. The experiment must exist and belong to the dataset. | +| `order` | string | No | Ordering mode. Use `simulate` for simulation-specific ordering. | ## Responses @@ -44,13 +58,15 @@ All requests require authentication via API keys: A list of evaluations and recommendations. -- **evals**: array of any -- **eval_recommendations**: array of string - A list of recommended evaluation categories. +- **evals**: array of evaluation objects with id, name, description, and tags. +- **eval_recommendations**: array of string — recommended evaluation categories. ### 400 -Bad Request. Invalid parameters provided, such as a non-existent experiment ID. +Bad request. Possible reasons: + +- **Missing dataset ID** — `dataset_id` path parameter is required. +- **Experiment not found** — The specified `experiment_id` does not exist. ### 401 @@ -66,44 +82,51 @@ Internal Server Error. An unexpected error occurred while fetching the evaluatio ## Code Examples -### cURL - -```bash -curl -X GET "https://api.futureagi.com/model-hub/eval-groups/get_evals_list/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" -``` - -### Python - -```python + +```python Python import requests -url = "https://api.futureagi.com/model-hub/eval-groups/get_evals_list/" +dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/get_evals_list/" headers = { "X-Api-Key": "YOUR_API_KEY", "X-Secret-Key": "YOUR_SECRET_KEY", "Content-Type": "application/json" } +params = { + "search_text": "hallucination", + "eval_categories": "futureagi_built" +} -response = requests.get(url, headers=headers) +response = requests.get(url, headers=headers, params=params) print(response.json()) ``` - -### JavaScript - -```javascript -const response = await fetch("https://api.futureagi.com/model-hub/eval-groups/get_evals_list/", { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, +```typescript TypeScript +const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; +const params = new URLSearchParams({ + search_text: "hallucination", + eval_categories: "futureagi_built" }); +const response = await fetch( + `https://api.futureagi.com/model-hub/develops/${datasetId}/get_evals_list/?${params}`, + { + method: "GET", + headers: { + "X-Api-Key": "YOUR_API_KEY", + "X-Secret-Key": "YOUR_SECRET_KEY", + "Content-Type": "application/json" + } + } +); + const data = await response.json(); console.log(data); ``` - +```bash cURL +curl -X GET "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/get_evals_list/?search_text=hallucination&eval_categories=futureagi_built" \ + -H "X-Api-Key: YOUR_API_KEY" \ + -H "X-Secret-Key: YOUR_SECRET_KEY" \ + -H "Content-Type: application/json" +``` + From 20e27bb66f8bd56f45597267e76df92094fe0d83 Mon Sep 17 00:00:00 2001 From: sarthak Date: Sun, 5 Apr 2026 16:03:24 +0530 Subject: [PATCH 2/3] updated according to the new design --- src/components/docs/ApiCollapsible.astro | 54 +-- .../api/dataset-evals/add-dataset-eval.mdx | 322 ++++++----------- .../create-custom-eval-template.mdx | 317 ++++++----------- .../api/dataset-evals/delete-dataset-eval.mdx | 178 +++------- .../api/dataset-evals/edit-and-run-eval.mdx | 303 ++++++---------- .../api/dataset-evals/get-eval-metrics.mdx | 208 ++++------- .../api/dataset-evals/get-eval-structure.mdx | 299 ++++++++-------- .../dataset-evals/get-eval-template-names.mdx | 179 ++++------ .../api/dataset-evals/list-dataset-evals.mdx | 249 +++++++------ .../api/dataset-evals/start-evals-process.mdx | 187 +++------- src/pages/docs/api/datasets/add-as-new.mdx | 206 +++-------- .../docs/api/datasets/add-empty-rows.mdx | 182 +++------- .../api/datasets/add-rows-from-existing.mdx | 226 ++++-------- .../docs/api/datasets/add-rows-from-file.mdx | 173 +++------ .../datasets/add-rows-from-huggingface.mdx | 227 ++++-------- .../datasets/analytics/annotation-summary.mdx | 216 +++++------- .../api/datasets/analytics/eval-stats.mdx | 221 +++++------- .../analytics/explanation-summary.mdx | 236 +++++-------- .../datasets/analytics/run-prompt-stats.mdx | 229 ++++++------ src/pages/docs/api/datasets/clone-dataset.mdx | 196 ++++------- .../docs/api/datasets/columns/add-columns.mdx | 255 +++++--------- .../columns/add-multiple-static-columns.mdx | 222 ++++-------- .../datasets/columns/add-static-column.mdx | 191 +++------- .../api/datasets/columns/delete-column.mdx | 134 +++---- .../datasets/columns/get-column-config.mdx | 281 +++++++-------- .../datasets/columns/get-column-details.mdx | 203 +++++------ .../datasets/columns/update-column-name.mdx | 173 +++------ .../datasets/columns/update-column-type.mdx | 290 ++++++---------- .../create-dataset-from-huggingface.mdx | 237 +++++-------- .../docs/api/datasets/create-dataset.mdx | 205 ++++------- .../api/datasets/create-empty-dataset.mdx | 208 ++++------- .../docs/api/datasets/delete-dataset.mdx | 169 +++------ src/pages/docs/api/datasets/delete-rows.mdx | 188 +++------- .../docs/api/datasets/duplicate-dataset.mdx | 243 +++++-------- .../docs/api/datasets/duplicate-rows.mdx | 232 +++++-------- src/pages/docs/api/datasets/get-dataset.mdx | 200 +++++------ src/pages/docs/api/datasets/list-datasets.mdx | 249 ++++++------- src/pages/docs/api/datasets/merge-dataset.mdx | 221 ++++-------- .../run-prompt/add-run-prompt-column.mdx | 327 ++++++------------ .../run-prompt/edit-run-prompt-column.mdx | 223 +++--------- .../datasets/run-prompt/get-column-values.mdx | 255 +++++--------- .../datasets/run-prompt/get-model-voices.mdx | 222 ++++++------ .../retrieve-run-prompt-column-config.mdx | 278 ++++++++------- .../retrieve-run-prompt-options.mdx | 254 +++++++------- .../api/datasets/run-prompt/tts-voices.mdx | 287 +++++---------- .../docs/api/datasets/update-cell-value.mdx | 205 +++-------- .../docs/api/datasets/update-dataset.mdx | 182 +++------- .../docs/api/datasets/upload-dataset.mdx | 199 ++++------- 48 files changed, 3854 insertions(+), 6887 deletions(-) diff --git a/src/components/docs/ApiCollapsible.astro b/src/components/docs/ApiCollapsible.astro index 957dcc84..b238d5ec 100644 --- a/src/components/docs/ApiCollapsible.astro +++ b/src/components/docs/ApiCollapsible.astro @@ -4,6 +4,7 @@ * * Used inside API reference pages to collapse nested object properties. * Renders as a pill/button that toggles visibility of child content. + * Supports nesting (collapsible inside collapsible). * * Usage: * @@ -15,15 +16,14 @@ interface Props { } const { title = 'Show properties' } = Astro.props; -const cid = `apic-${Math.random().toString(36).slice(2, 8)}`; --- -
- -
+
@@ -34,21 +34,33 @@ function initApiCollapsibles() { if (el._apicBound) return; el._apicBound = true; - var trigger = el.querySelector('[data-apic-trigger]'); - var icon = el.querySelector('[data-apic-icon]'); - var label = el.querySelector('[data-apic-label]'); + // Use direct children only — not nested collapsible triggers + var children = el.children; + var trigger = null; + var content = null; + for (var c = 0; c < children.length; c++) { + if (children[c].classList.contains('api-collapsible-trigger')) trigger = children[c]; + if (children[c].classList.contains('api-collapsible-content')) content = children[c]; + } + if (!trigger || !content) return; + + var icon = trigger.querySelector('.api-collapsible-icon'); + var label = trigger.querySelector('.api-collapsible-label'); var isOpen = false; var showTitle = label ? label.textContent : 'Show properties'; var hideTitle = showTitle.replace(/^Show\b/, 'Hide'); - if (trigger) { - trigger.addEventListener('click', function() { - isOpen = !isOpen; - el.classList.toggle('api-collapsible-open', isOpen); - if (icon) icon.textContent = isOpen ? '\u00d7' : '+'; - if (label) label.textContent = isOpen ? hideTitle : showTitle; - }); - } + trigger.addEventListener('click', function(e) { + e.stopPropagation(); + isOpen = !isOpen; + if (isOpen) { + content.style.display = 'block'; + } else { + content.style.display = 'none'; + } + if (icon) icon.textContent = isOpen ? '\u00d7' : '+'; + if (label) label.textContent = isOpen ? hideTitle : showTitle; + }); }); } initApiCollapsibles(); @@ -98,10 +110,6 @@ document.addEventListener('astro:page-load', initApiCollapsibles); flex-shrink: 0; } -.api-collapsible-open .api-collapsible-icon { - color: #a1a1aa; -} - .api-collapsible-label { font-size: 13px; font-weight: 500; @@ -111,8 +119,4 @@ document.addEventListener('astro:page-load', initApiCollapsibles); display: none; padding-top: 12px; } - -.api-collapsible-open .api-collapsible-content { - display: block; -} diff --git a/src/pages/docs/api/dataset-evals/add-dataset-eval.mdx b/src/pages/docs/api/dataset-evals/add-dataset-eval.mdx index b441050d..57d143e9 100644 --- a/src/pages/docs/api/dataset-evals/add-dataset-eval.mdx +++ b/src/pages/docs/api/dataset-evals/add-dataset-eval.mdx @@ -3,10 +3,6 @@ title: "Add Dataset Eval" description: "Add an evaluation to a dataset by selecting a template and configuring the key mapping." --- -# Add Dataset Eval - -Adds a new evaluation to a dataset by associating an eval template, configuring the variable-to-column mapping, and optionally running it immediately. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset to add the eval to. Must belong to your organization. | - -## Request Body - - - Name for the evaluation. Maximum 50 characters. Must be unique within the dataset for your organization. - - - - UUID of the eval template to use. Maximum 500 characters. The template must be accessible by your organization. - - - - Configuration object for the evaluation. - - - **config** (`object`): Template-specific configuration parameters. - - **params** (`object`): Runtime parameters. - - **mapping** (`object`): Maps template variable keys to dataset column names. All required keys from the template must be mapped. - - **reason_column** (`boolean`): Whether to create a reason column alongside the eval result column. - - - - UUID of a knowledge base to use with this eval. The knowledge base must exist within your organization. - - - - Whether to enable error localization. Default: `false`. - - - - Model to use for evaluation. Maximum 100 characters. Default: `turing_large`. - - - - Whether to immediately run the evaluation after adding it. Default: `false`. When `true`, creates the eval column and queues processing. - - - - Whether to save this configuration as a new reusable eval template. Default: `false`. When `true`, the `name` must be unique across all templates. - - -### Example - -```json -{ - "name": "Hallucination Check", - "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", - "config": { - "config": {}, - "params": {}, - "mapping": { - "input": "question_column", - "output": "response_column" - }, - "reason_column": true - }, - "model": "turing_large", - "run": true, - "save_as_template": false -} -``` - -## Response - -Success message. -Whether the request was successful. - -### Example Response - -```json -{ - "data": "success", - "success": true -} -``` - -## Responses - -### 200 - -Eval successfully added to the dataset. - -### 400 - -Bad request. Possible reasons: - -- **Dataset not in organization** — The dataset does not belong to your organization. -- **Duplicate name** — An eval with this name already exists in the dataset. -- **Missing required mapping** — All required keys from the template must be present in the `mapping` object. -- **Name validation failed** — The eval name does not meet naming requirements. -- **Template not found** — The specified `template_id` does not exist or is not accessible. -- **Failed to create template** — Error occurred when `save_as_template` is `true` and the template name already exists. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -The specified dataset was not found. - -### 429 - -Resource limit reached. Your organization has exceeded the eval addition quota. - -### 500 - -Internal server error. Failed to add the evaluation. - -## Code Examples - - -```python Python -import requests - -dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/add_user_eval/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "name": "Hallucination Check", - "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", - "config": { - "config": {}, - "params": {}, - "mapping": { - "input": "question_column", - "output": "response_column" - }, - "reason_column": True - }, - "model": "turing_large", - "run": True, - "save_as_template": False -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; - -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/${datasetId}/add_user_eval/`, - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - name: "Hallucination Check", - template_id: "d4e5f6a7-b8c9-0123-def0-123456789abc", - config: { - config: {}, - params: {}, - mapping: { - input: "question_column", - output: "response_column" - }, - reason_column: true - }, - model: "turing_large", - run: true, - save_as_template: false - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_user_eval/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "Hallucination Check", - "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", - "config": { - "config": {}, - "params": {}, - "mapping": { - "input": "question_column", - "output": "response_column" - }, - "reason_column": true - }, - "model": "turing_large", - "run": true, - "save_as_template": false - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset to which the evaluation will be added. The dataset must exist within your organization and be accessible with your current API credentials. + + + + + + The human-readable name for the evaluation. Maximum 50 characters. This name is displayed in the dataset's eval sidebar and must be unique within the dataset for your organization. + + + + The universally unique identifier (UUID) of the eval template to use for this evaluation. Maximum 500 characters. The template defines the evaluation criteria, required variable keys, and output type. It must be accessible by your organization (either a built-in template or one you created). + + + + The configuration object that controls how the evaluation is executed against dataset rows. This includes template-specific settings, runtime parameters, and the variable-to-column mapping. + + + + Template-specific configuration parameters that customize the evaluation behavior. The available options depend on the eval template being used. + + + + Runtime parameters passed to the evaluation engine during processing. These may include thresholds, weights, or other execution-time settings. + + + + A key-value mapping that connects the eval template's variable keys to actual dataset column names. All required keys defined by the template must be present in this mapping. For example, `{"input": "question_column", "output": "response_column"}` maps the template's `input` variable to the `question_column` in the dataset. + + + + Whether to create an additional reason column alongside the eval result column. When `true`, the evaluation engine generates an explanation for each evaluation outcome, stored in a separate column. + + + + + + The universally unique identifier (UUID) of a knowledge base to associate with this evaluation. The knowledge base must exist within your organization and provides reference data that the evaluation can use to assess responses. + + + + Whether to enable error localization for this evaluation. When `true`, the evaluation engine identifies and highlights the specific portions of the output that caused evaluation failures. Default is `false`. + + + + The model to use for running the evaluation. Maximum 100 characters. This determines which LLM-based evaluation engine processes each row. Default is `turing_large`. + + + + Whether to immediately start running the evaluation after adding it to the dataset. When `true`, the eval column is created and all rows are queued for processing. When `false`, the evaluation is configured but not executed until explicitly triggered. Default is `false`. + + + + Whether to save this evaluation configuration as a new reusable eval template. When `true`, a new template is created with the provided `name`, which must be unique across all templates in your organization. Default is `false`. + + + + + + A confirmation message indicating the evaluation was successfully added to the dataset. Typically returns `success`. + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the evaluation is added without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the dataset does not belong to your organization; an eval with the same name already exists in the dataset; required mapping keys from the template are missing; the eval name does not meet naming requirements; the specified template does not exist or is not accessible; or `save_as_template` is `true` but the template name already exists. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found. Verify that the `dataset_id` in the path is correct and that your API credentials have access to the target dataset. + + + + Resource limit reached. Your organization has exceeded the evaluation addition quota. Contact support or upgrade your plan to increase limits. + + + + An unexpected error occurred on the server while adding the evaluation. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx b/src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx index e6244802..64eb5890 100644 --- a/src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx +++ b/src/pages/docs/api/dataset-evals/create-custom-eval-template.mdx @@ -3,15 +3,10 @@ title: "Create Custom Eval Template" description: "Create a custom evaluation template with criteria, output type, and model configuration." --- -# Create Custom Eval Template - -Creates a new custom evaluation template that can be used to evaluate dataset rows. The template defines evaluation criteria using template variables. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - Name of the eval template. Maximum 255 characters. Must be unique across both user-owned and system-owned templates. - - - - Optional description of the eval template. - - - - The evaluation criteria text. Maximum 100,000 characters. Must contain at least one template variable using `{{variable_name}}` syntax (e.g., `{{input}}`, `{{output}}`). - - - - The type of evaluation output. One of: `Pass/Fail`, `score`, `choices`. Default: `Pass/Fail`. - - - - List of required template variable names that must be mapped when using this eval. - - - - Configuration object for the eval template. - - - **model** (`string`): Model to use for evaluation. Default: `turing_small`. - - **proxy_agi** (`boolean`): Whether to use the AGI proxy. Default: `true`. - - **visible_ui** (`boolean`): Whether the eval is visible in the UI. Default: `true`. - - **reverse_output** (`boolean`): Whether to reverse the output logic. - - Only these keys are allowed: `model`, `proxy_agi`, `visible_ui`, `reverse_output`, `config`. - - - - Optional list of tag strings to categorize the eval template. - - - - Required when `output_type` is `choices`. A key-value mapping of choice options (e.g., `{"A": "Good", "B": "Bad"}`). - - - - Whether the eval should check internet sources. Default: `false`. - - - - Whether multiple choices can be selected (only relevant when `output_type` is `choices`). Default: `false`. - - - - Optional UUID of an existing template to base this template on. - - -### Example - -```json -{ - "name": "My Custom Eval", - "description": "Evaluates response quality", - "criteria": "Evaluate the {{output}} based on the {{input}} for correctness and completeness.", - "output_type": "Pass/Fail", - "required_keys": ["input", "output"], - "config": { - "model": "turing_small", - "proxy_agi": true, - "visible_ui": true - }, - "tags": ["quality"], - "check_internet": false -} -``` - -## Response - -UUID of the newly created eval template. -Whether the request was successful. - -### Example Response - -```json -{ - "data": { - "eval_template_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - }, - "success": true -} -``` - -## Responses - -### 200 - -Eval template created successfully. - -### 400 - -Bad request. Possible reasons: - -- **Duplicate name** — An eval template with this name already exists. -- **Missing criteria variables** — `criteria` must contain at least one `{{variable}}` placeholder. -- **Missing choices** — `choices` object is required when `output_type` is `choices`. -- **Invalid config keys** — Only `model`, `proxy_agi`, `visible_ui`, `reverse_output`, and `config` are allowed. -- **Name validation failed** — Template name does not meet naming requirements. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 500 - -Internal server error. Failed to create the eval template. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/create_custom_evals/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "name": "My Custom Eval", - "description": "Evaluates response quality", - "criteria": "Evaluate the {{output}} based on the {{input}} for correctness.", - "output_type": "Pass/Fail", - "required_keys": ["input", "output"], - "config": { - "model": "turing_small", - "proxy_agi": True, - "visible_ui": True - }, - "tags": ["quality"], - "check_internet": False -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/create_custom_evals/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - name: "My Custom Eval", - description: "Evaluates response quality", - criteria: "Evaluate the {{output}} based on the {{input}} for correctness.", - output_type: "Pass/Fail", - required_keys: ["input", "output"], - config: { - model: "turing_small", - proxy_agi: true, - visible_ui: true - }, - tags: ["quality"], - check_internet: false - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/create_custom_evals/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "My Custom Eval", - "description": "Evaluates response quality", - "criteria": "Evaluate the {{output}} based on the {{input}} for correctness.", - "output_type": "Pass/Fail", - "required_keys": ["input", "output"], - "config": { - "model": "turing_small", - "proxy_agi": true, - "visible_ui": true - }, - "tags": ["quality"], - "check_internet": false - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The human-readable name for the eval template. Maximum 255 characters. This name is used to identify the template throughout the Future AGI platform and must be unique across both user-owned and system-owned templates. + + + + An optional description of what the eval template assesses and how it works. This description is displayed in the template selection UI to help users understand the purpose of the evaluation. + + + + The evaluation criteria text that the LLM evaluator uses to assess each row. Maximum 100,000 characters. Must contain at least one template variable using `{{variable_name}}` syntax (e.g., `{{input}}`, `{{output}}`). These variables are replaced with actual column values at evaluation time. + + + + The type of evaluation output produced by the template. Determines how evaluation results are categorized and displayed. Accepted values are `Pass/Fail` (binary pass or fail outcome, the default), `score` (numeric score), and `choices` (selection from predefined options). + + + + An array of template variable names that must be mapped to dataset columns when using this eval. These correspond to the `{{variable_name}}` placeholders in the criteria text. Every key listed here must be provided in the `mapping` object when the template is applied to a dataset. + + + + The configuration object controlling evaluation behavior and visibility settings. Only the following keys are allowed: `model`, `proxy_agi`, `visible_ui`, `reverse_output`, and `config`. + + + + The model to use for running evaluations with this template. Default is `turing_small`. This determines which LLM-based evaluation engine processes each row. + + + + Whether to route evaluation requests through the AGI proxy. Default is `true`. The proxy provides optimized routing and caching for evaluation workloads. + + + + Whether the eval template is visible in the Future AGI dashboard UI. Default is `true`. Set to `false` to hide the template from the template selection interface while keeping it available via the API. + + + + Whether to reverse the output logic of the evaluation. When `true`, the pass/fail or score interpretation is inverted. + + + + + + An optional array of tag strings used to categorize and filter the eval template. Tags help organize templates by domain, quality dimension, or use case (e.g., `["quality"]`, `["hallucination", "safety"]`). + + + + A key-value mapping of choice options. Required when `output_type` is `choices`. Each key represents a choice identifier and each value is the human-readable label for that choice (e.g., `{"A": "Good", "B": "Bad"}`). + + + + Whether the evaluation should check internet sources as part of its assessment process. When `true`, the evaluator can access external information to verify claims in the output. Default is `false`. + + + + Whether multiple choices can be selected simultaneously when `output_type` is `choices`. When `true`, the evaluation can select more than one option from the defined choices. Only relevant when `output_type` is `choices`. Default is `false`. + + + + The universally unique identifier (UUID) of an existing eval template to use as a base for creating the new template. When provided, the new template inherits settings from the specified template. + + + + + + The response payload containing the identifier of the newly created eval template. + + + + + The universally unique identifier (UUID) assigned to the newly created eval template. Use this ID to reference the template when adding evaluations to datasets or managing templates via the API. + + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the eval template is created without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: an eval template with the same name already exists; the `criteria` text does not contain at least one `{{variable}}` placeholder; the `choices` object is missing when `output_type` is `choices`; the `config` object contains keys other than `model`, `proxy_agi`, `visible_ui`, `reverse_output`, and `config`; or the template name does not meet naming requirements. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + An unexpected error occurred on the server while creating the eval template. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx b/src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx index 6333c9fa..158cbc9d 100644 --- a/src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx +++ b/src/pages/docs/api/dataset-evals/delete-dataset-eval.mdx @@ -3,10 +3,6 @@ title: "Delete Dataset Eval" description: "Remove an evaluation from a dataset, with an option to delete the associated column." --- -# Delete Dataset Eval - -Deletes a user evaluation from a dataset. You can choose to either hide the eval from the sidebar or permanently delete the eval along with its associated column and cell data. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset containing the eval. | -| `eval_id` | string (UUID) | Yes | The UUID of the user eval metric to delete. | - -## Request Body - - - Whether to permanently delete the eval's associated column and all its cell data. Default: `false`. - - - When `true`: Soft-deletes the eval column, reason column, and all associated cell data. Removes the column from the dataset's column order. This action cannot be undone. - - When `false`: Hides the eval from the sidebar without deleting any data. - - -### Example - -```json -{ - "delete_column": true -} -``` - -## Response - -Confirmation message. -Whether the request was successful. - -### Example Response - -```json -{ - "data": "Eval deleted successfully", - "success": true -} -``` - -## Responses - -### 200 - -Eval successfully deleted or hidden. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -The specified eval was not found. It may not exist, not belong to the dataset, or has already been deleted. - -### 500 - -Internal server error. Failed to delete the evaluation. - -## Code Examples - - -```python Python -import requests - -dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -eval_id = "d4e5f6a7-b8c9-0123-def0-123456789abc" -url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_user_eval/{eval_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "delete_column": True -} - -response = requests.delete(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; -const evalId = "d4e5f6a7-b8c9-0123-def0-123456789abc"; - -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/${datasetId}/delete_user_eval/${evalId}/`, - { - method: "DELETE", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - delete_column: true - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X DELETE "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_user_eval/d4e5f6a7-b8c9-0123-def0-123456789abc/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "delete_column": true - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset containing the evaluation to delete. The dataset must exist within your organization and be accessible with your current API credentials. + + + + The universally unique identifier (UUID) of the user eval metric to delete. The evaluation must exist within the specified dataset and belong to your organization. + + + + + + Whether to permanently delete the eval's associated column and all its cell data. Default is `false`. When set to `true`, the eval column, reason column, and all associated cell data are soft-deleted, and the column is removed from the dataset's column order. This action cannot be undone. When set to `false`, the eval is hidden from the sidebar without deleting any underlying data, allowing it to be restored later. + + + + + + A human-readable confirmation message indicating that the evaluation was successfully deleted or hidden from the dataset. Typically returns `Eval deleted successfully`. + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the evaluation is deleted or hidden without errors. + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified evaluation was not found. It may not exist, may not belong to the specified dataset, or has already been deleted. Verify both the `dataset_id` and `eval_id` are correct. + + + + An unexpected error occurred on the server while deleting the evaluation. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx b/src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx index 7530afee..ec85ce0b 100644 --- a/src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx +++ b/src/pages/docs/api/dataset-evals/edit-and-run-eval.mdx @@ -3,10 +3,6 @@ title: "Edit and Run Eval" description: "Update an evaluation's configuration and optionally re-run it on the dataset." --- -# Edit and Run Eval - -Updates the configuration of an existing evaluation on a dataset and optionally triggers a re-run. You can modify the variable mapping, model, and configuration, and optionally save the configuration as a reusable template. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset containing the eval. | -| `eval_id` | string (UUID) | Yes | The UUID of the user eval metric to edit. | - -## Request Body - - - Updated configuration for the evaluation. - - - **config** (`object`): Template-specific configuration parameters. - - **params** (`object`): Runtime parameters. - - **mapping** (`object`): Maps template variable keys to dataset column names. All required keys must be mapped. - - **reason_column** (`boolean`): Whether to create or keep a reason column alongside the eval result. - - - - UUID of a knowledge base to associate with this eval. - - - - Whether to enable error localization. - - - - Model to use for evaluation. - - - - Whether to re-run the evaluation after updating. Default: `false`. When `true`, resets all cell statuses to running and queues processing. - - - - Whether to save this updated configuration as a new eval template. Default: `false`. - - - - Name for the new template. Required when `save_as_template` is `true`. Must be unique across all templates. - - -### Example - -```json -{ - "config": { - "config": {}, - "params": {}, - "mapping": { - "input": "question_column", - "output": "response_column" - }, - "reason_column": true - }, - "model": "turing_large", - "run": true, - "save_as_template": false -} -``` - -## Response - -Confirmation message. -Whether the request was successful. - -### Example Response - -```json -{ - "data": "Column evaluation updated and queued for processing", - "success": true -} -``` - -## Responses - -### 200 - -Eval configuration updated (and optionally re-run started) successfully. - -### 400 - -Bad request. Possible reasons: - -- **Column deleted** — The eval's associated column has been deleted and the eval cannot be edited. -- **Duplicate template name** — When `save_as_template` is `true`, the name already exists. -- **Name validation failed** — The template name does not meet naming requirements. -- **Missing required mapping** — All required keys from the template must be present in the `mapping` object. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -The specified eval was not found. It may not exist, not belong to the dataset, or has been deleted. - -### 500 - -Internal server error. Failed to update or run the evaluation. - -## Code Examples - - -```python Python -import requests - -dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -eval_id = "d4e5f6a7-b8c9-0123-def0-123456789abc" -url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/edit_and_run_user_eval/{eval_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "config": { - "config": {}, - "params": {}, - "mapping": { - "input": "question_column", - "output": "response_column" - }, - "reason_column": True - }, - "model": "turing_large", - "run": True, - "save_as_template": False -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; -const evalId = "d4e5f6a7-b8c9-0123-def0-123456789abc"; - -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/${datasetId}/edit_and_run_user_eval/${evalId}/`, - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - config: { - config: {}, - params: {}, - mapping: { - input: "question_column", - output: "response_column" - }, - reason_column: true - }, - model: "turing_large", - run: true, - save_as_template: false - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/edit_and_run_user_eval/d4e5f6a7-b8c9-0123-def0-123456789abc/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "config": { - "config": {}, - "params": {}, - "mapping": { - "input": "question_column", - "output": "response_column" - }, - "reason_column": true - }, - "model": "turing_large", - "run": true, - "save_as_template": false - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset containing the evaluation to edit. The dataset must exist within your organization and be accessible with your current API credentials. + + + + The universally unique identifier (UUID) of the user eval metric to update. The evaluation must exist within the specified dataset, belong to your organization, and not have been deleted. + + + + + + The updated configuration object for the evaluation. This controls how the evaluation is executed against dataset rows, including variable mapping and evaluation parameters. + + + + Template-specific configuration parameters that customize the evaluation behavior. The available options depend on the eval template associated with this evaluation. + + + + Runtime parameters passed to the evaluation engine during processing. These may include thresholds, weights, or other execution-time settings. + + + + A key-value mapping that connects the eval template's variable keys to actual dataset column names. All required keys defined by the template must be present in this mapping. For example, `{"input": "question_column", "output": "response_column"}`. + + + + Whether to create or keep an additional reason column alongside the eval result column. When `true`, the evaluation engine generates an explanation for each evaluation outcome. + + + + + + The universally unique identifier (UUID) of a knowledge base to associate with this evaluation. The knowledge base provides reference data that the evaluation can use to assess responses. + + + + Whether to enable error localization for this evaluation. When `true`, the evaluation engine identifies and highlights specific portions of the output that caused evaluation failures. + + + + The model to use for running the evaluation. This determines which LLM-based evaluation engine processes each row. + + + + Whether to re-run the evaluation after updating its configuration. When `true`, all cell statuses are reset to running and rows are queued for reprocessing. When `false`, only the configuration is updated without triggering execution. Default is `false`. + + + + Whether to save the updated configuration as a new reusable eval template. When `true`, the `name` field is required and must be unique across all templates. Default is `false`. + + + + The name for the new eval template. Required when `save_as_template` is `true`. Must be unique across all eval templates in your organization. + + + + + + A human-readable confirmation message indicating the evaluation configuration was successfully updated, and optionally that processing has been queued. Typically returns `Column evaluation updated and queued for processing`. + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the evaluation is updated without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the eval's associated column has been deleted; `save_as_template` is `true` but the template name already exists; the template name does not meet naming requirements; or required mapping keys from the template are missing. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified evaluation was not found. It may not exist, may not belong to the specified dataset, or has been deleted. Verify both the `dataset_id` and `eval_id` are correct. + + + + An unexpected error occurred on the server while updating or running the evaluation. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/dataset-evals/get-eval-metrics.mdx b/src/pages/docs/api/dataset-evals/get-eval-metrics.mdx index e35e3b93..6a167e6e 100644 --- a/src/pages/docs/api/dataset-evals/get-eval-metrics.mdx +++ b/src/pages/docs/api/dataset-evals/get-eval-metrics.mdx @@ -3,10 +3,6 @@ title: "Get Eval Metrics" description: "Retrieve evaluation metrics for a specific eval template with optional filtering." --- -# Get Eval Metrics - -Retrieves aggregated evaluation metrics for a specific eval template. Supports both GET and POST methods, with optional filters to scope the results. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -This endpoint supports both GET (query parameters) and POST (request body) methods. - -### GET — Query Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `eval_template_id` | string (UUID) | Yes | The UUID of the eval template to retrieve metrics for. | -| `filters` | string (JSON) | No | JSON-encoded array of filter objects. Default: `[]`. | - -### POST — Request Body - - - UUID of the eval template to retrieve metrics for. - - - - Optional array of filter objects to scope which evaluation results are included. Default: `[]`. Only results with `SUCCESS` status are included. - - -### Example (POST) - -```json -{ - "eval_template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", - "filters": [] -} -``` - -## Response - -Evaluation metrics data. Structure depends on the eval template configuration and output type. -Whether the request was successful. - -### Example Response - -```json -{ - "data": { - "total_evaluations": 150, - "pass_rate": 0.85, - "fail_rate": 0.15 - }, - "success": true -} -``` - -## Responses - -### 200 - -Successfully retrieved evaluation metrics. - -### 400 - -Bad request. Possible reasons: - -- **Missing template ID** — `eval_template_id` is required. -- **Invalid filters** — The `filters` value could not be parsed as valid JSON. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 500 - -Internal server error. Failed to calculate evaluation metrics. - -## Code Examples - - -```python Python -import requests - -# Using POST -url = "https://api.futureagi.com/model-hub/get-eval-metrics" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "eval_template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", - "filters": [] -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -// Using POST -const response = await fetch( - "https://api.futureagi.com/model-hub/get-eval-metrics", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" + responseExample={{ + data: { + total_evaluations: 150, + pass_rate: 0.85, + fail_rate: 0.15 }, - body: JSON.stringify({ - eval_template_id: "d4e5f6a7-b8c9-0123-def0-123456789abc", - filters: [] - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -# Using GET -curl -X GET "https://api.futureagi.com/model-hub/get-eval-metrics?eval_template_id=d4e5f6a7-b8c9-0123-def0-123456789abc" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" + success: true + }} + responseStatus={200} + responseStatusText="OK" +/> -# Using POST -curl -X POST "https://api.futureagi.com/model-hub/get-eval-metrics" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "eval_template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", - "filters": [] - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the eval template whose aggregated metrics you want to retrieve. This endpoint also accepts this parameter as a query parameter for GET requests. + + + + An optional array of filter objects used to scope which evaluation results are included in the metrics calculation. Only results with `SUCCESS` status are considered. When empty or not provided, all successful results for the template are included. For GET requests, pass this as a JSON-encoded string in the `filters` query parameter. + + + + + + The aggregated evaluation metrics for the specified eval template. The exact structure depends on the eval template's output type and configuration, but commonly includes pass/fail rates, score distributions, or choice distributions. + + + + + The total number of evaluation results included in the metrics calculation, after applying any specified filters. Only results with `SUCCESS` status are counted. + + + + The proportion of evaluations that resulted in a pass outcome, expressed as a decimal between `0` and `1`. For example, `0.85` indicates that 85% of evaluated rows passed. Only present for `Pass/Fail` output type templates. + + + + The proportion of evaluations that resulted in a fail outcome, expressed as a decimal between `0` and `1`. This value is the complement of `pass_rate`. Only present for `Pass/Fail` output type templates. + + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when metrics are calculated without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: `eval_template_id` is missing; or the `filters` value could not be parsed as valid JSON. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + An unexpected error occurred on the server while calculating evaluation metrics. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/dataset-evals/get-eval-structure.mdx b/src/pages/docs/api/dataset-evals/get-eval-structure.mdx index bdf89ea0..0cbe60f3 100644 --- a/src/pages/docs/api/dataset-evals/get-eval-structure.mdx +++ b/src/pages/docs/api/dataset-evals/get-eval-structure.mdx @@ -3,10 +3,6 @@ title: "Get Eval Structure" description: "Retrieve the configuration structure of a specific evaluation, including required keys, mapping, and model settings." --- -# Get Eval Structure - -Retrieves the full configuration structure of an evaluation, including its template details, required/optional keys, variable mappings, and model configuration. Supports preset, user-created, and previously configured eval types. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. Required when `eval_type` is `user`. | -| `eval_id` | string (UUID) | Yes | The UUID of the evaluation template or user eval metric. | - -### Query Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `eval_type` | string | Yes | The type of evaluation. One of: `preset`, `user`, `previously_configured`. | - -## Response - -The evaluation structure object. -UUID of the eval. -UUID of the underlying eval template. -Display name of the eval. -Description of the eval. -List of required variable keys that must be mapped to dataset columns. -List of optional variable keys. -All template variable keys. -Current key-to-column mapping configuration. -Eval configuration parameters. -Eval runtime parameters. -Output type of the eval. -Choice options (for choice-type evals). -Available models for this eval. -Associated knowledge base UUID, if any. -Whether error localization is enabled. -Whether the required API key is configured. -Whether the request was successful. - -### Example Response - -```json -{ - "data": { - "eval": { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "template_id": "d4e5f6a7-b8c9-0123-def0-123456789abc", - "name": "Hallucination Detection", - "description": "Detects hallucinated content", - "required_keys": ["input", "output"], - "optional_keys": ["context"], - "variable_keys": ["input", "output", "context"], - "mapping": {}, - "config": {}, - "params": {}, - "output": "Pass/Fail", - "choices": null, - "models": "turing_small", - "kb_id": null, - "error_localizer": false, - "api_key_available": true - } - }, - "success": true -} -``` - -## Responses - -### 200 - -Successfully retrieved the eval structure. - -### 400 - -Bad request. Possible reasons: - -- **Invalid or missing eval type** — `eval_type` query parameter is required and must be `preset`, `user`, or `previously_configured`. -- **Missing dataset ID** — `dataset_id` is required when `eval_type` is `user`. -- **Eval stack updated** — The eval template has been updated since it was last configured. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -The specified eval template or user eval was not found. - -### 500 - -Internal server error. Failed to retrieve the eval structure. - -## Code Examples - - -```python Python -import requests - -dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -eval_id = "d4e5f6a7-b8c9-0123-def0-123456789abc" -url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/get_eval_structure/{eval_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -params = { - "eval_type": "preset" -} - -response = requests.get(url, headers=headers, params=params) -print(response.json()) -``` -```typescript TypeScript -const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; -const evalId = "d4e5f6a7-b8c9-0123-def0-123456789abc"; - -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/${datasetId}/get_eval_structure/${evalId}/?eval_type=preset`, - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/get_eval_structure/d4e5f6a7-b8c9-0123-def0-123456789abc/?eval_type=preset" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset. Required when `eval_type` is `user`, as the user eval is scoped to a specific dataset. For `preset` and `previously_configured` types, this parameter is still required in the URL path. + + + + The universally unique identifier (UUID) of the evaluation template or user eval metric whose structure you want to retrieve. The interpretation of this ID depends on the `eval_type` query parameter. + + + + + + The type of evaluation to retrieve the structure for. Accepted values are `preset` (a built-in eval template provided by Future AGI), `user` (a user-created eval configured on a specific dataset), and `previously_configured` (an eval template that has been previously configured on a dataset). This determines how the `eval_id` path parameter is interpreted and which data is returned. + + + + + + The response payload containing the full evaluation structure. + + + + + The evaluation structure object containing all configuration details needed to understand and use the evaluation. + + + + + The universally unique identifier (UUID) of the evaluation. For `user` type evals, this is the user eval metric ID; for `preset` type, this is the eval template ID. + + + + The universally unique identifier (UUID) of the underlying eval template that defines the evaluation criteria and output type. + + + + The human-readable display name of the evaluation, shown in the dataset's eval sidebar and template selection interfaces. + + + + A detailed description of what the evaluation assesses and how it works, helping users understand its purpose and applicability. + + + + An array of variable key names that must be mapped to dataset columns when configuring this evaluation. Every key in this list must have a corresponding entry in the `mapping` object. + + + + An array of variable key names that may optionally be mapped to dataset columns. These provide additional context to the evaluation but are not required for execution. + + + + The complete list of all template variable keys (both required and optional) recognized by this evaluation template. + + + + The current key-to-column mapping configuration. For `user` type evals, this reflects the configured mapping; for `preset` type, this is typically an empty object since no mapping has been configured yet. + + + + The eval configuration parameters specific to this template, including any template-specific settings that customize evaluation behavior. + + + + The runtime parameters for the evaluation, including thresholds, weights, or other execution-time settings. + + + + The output type of the evaluation. One of `Pass/Fail` (binary outcome), `score` (numeric score), or `choices` (selection from predefined options). + + + + The choice options for choice-type evaluations. Contains a key-value mapping of choice identifiers to labels (e.g., `{"A": "Good", "B": "Bad"}`). Returns `null` for non-choice output types. + + + + The available or configured model for running this evaluation (e.g., `turing_small`, `turing_large`). + + + + The universally unique identifier (UUID) of the associated knowledge base, if one is configured. Returns `null` when no knowledge base is associated. + + + + Whether error localization is enabled for this evaluation. When `true`, the evaluation engine identifies specific portions of output that caused failures. + + + + Whether the required API key for the evaluation model is configured in your organization's settings. When `false`, the evaluation cannot be run until the appropriate API key is added. + + + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the eval structure is retrieved without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: `eval_type` is missing or not one of the accepted values (`preset`, `user`, `previously_configured`); `dataset_id` is missing when `eval_type` is `user`; or the eval template has been updated since it was last configured. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified eval template or user eval was not found. Verify that the `eval_id` is correct and that the evaluation exists for the given `eval_type`. + + + + An unexpected error occurred on the server while retrieving the eval structure. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/dataset-evals/get-eval-template-names.mdx b/src/pages/docs/api/dataset-evals/get-eval-template-names.mdx index 4da81ae7..81c16c35 100644 --- a/src/pages/docs/api/dataset-evals/get-eval-template-names.mdx +++ b/src/pages/docs/api/dataset-evals/get-eval-template-names.mdx @@ -3,131 +3,72 @@ title: "Get Eval Template Names" description: "Search and retrieve a list of evaluation template names available in your organization." --- -# Get Eval Template Names - -Retrieves a list of evaluation templates accessible to the authenticated user, with optional text search filtering. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - Optional text to filter eval template names. Performs a case-insensitive search on template names. - - -### Example - -```json -{ - "search_text": "hallucination" -} -``` - -## Response - -Returns a list of eval templates matching the search criteria. - - - Array of eval template objects. - - -UUID of the eval template. -Name of the eval template. -Description of the eval template. - -Whether the request was successful. - -### Example Response - -```json -{ - "data": [ - { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "Hallucination Detection", - "description": "Detects hallucinated content in LLM responses" - } - ], - "success": true -} -``` - -## Responses - -### 200 - -Successfully retrieved eval template names. - -### 400 - -Bad request. An error occurred while processing the request. - -### 401 - -Authentication credentials were not provided or are invalid. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/get-eval-template-names" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "search_text": "hallucination" -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/get-eval-template-names", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - search_text: "hallucination" - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/get-eval-template-names" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "search_text": "hallucination" - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + An optional text string used to filter eval template names. The search is case-insensitive and matches against template names. When empty or not provided, all eval templates accessible to your organization are returned. For example, searching `"hallucination"` returns all templates whose names contain that word. + + + + + + An array of eval template objects matching the search criteria. Each entry provides the essential identification and description information needed to select a template for use in dataset evaluations. + + + + + The universally unique identifier (UUID) of the eval template. Use this ID as the `template_id` when adding an evaluation to a dataset. + + + + The human-readable name of the eval template, used to identify it in the template selection interface and throughout the platform. + + + + A description of what the eval template assesses and how it works, helping users understand the purpose and applicability of the evaluation. + + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the template names are retrieved without errors. + + + + + + The request was malformed or an error occurred while processing the search query. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + diff --git a/src/pages/docs/api/dataset-evals/list-dataset-evals.mdx b/src/pages/docs/api/dataset-evals/list-dataset-evals.mdx index 3bb664ca..640db736 100644 --- a/src/pages/docs/api/dataset-evals/list-dataset-evals.mdx +++ b/src/pages/docs/api/dataset-evals/list-dataset-evals.mdx @@ -3,10 +3,6 @@ title: "List Dataset Evals" description: "Retrieve a list of available evaluations for a dataset with filtering and search options." --- -# List Dataset Evals - -Retrieves a list of evaluations available for a given dataset, including built-in and user-created evals, with support for filtering by category, type, tags, and use cases. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset to retrieve evaluations for. | - -### Query Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `search_text` | string | No | Text to search for in evaluation names (case-insensitive). | -| `eval_categories` | string | No | Filter by category. One of: `futureagi_built`, `user_built`. | -| `eval_type` | string | No | Filter by type. One of: `preset`, `user`, `previously_configured`. | -| `eval_tags[]` | array | No | Filter by one or more eval tags. | -| `use_cases[]` | array | No | Filter by one or more use cases. | -| `experiment_id` | string (UUID) | No | Scope results to a specific experiment. The experiment must exist and belong to the dataset. | -| `order` | string | No | Ordering mode. Use `simulate` for simulation-specific ordering. | - -## Response - -Array of evaluation objects with id, name, description, and tags. -List of recommended evaluation categories (e.g., `["Deterministic Evals"]`). -Whether the request was successful. - -### Example Response - -```json -{ - "data": { - "evals": [ - { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "Hallucination Detection", - "description": "Detects hallucinated content in LLM responses", - "eval_template_tags": ["hallucination", "quality"] - } - ], - "eval_recommendations": ["Deterministic Evals"] - }, - "success": true -} -``` - -## Responses - -### 200 - -Successfully retrieved the evaluations list. - -### 400 - -Bad request. Possible reasons: - -- **Missing dataset ID** — `dataset_id` path parameter is required. -- **Experiment not found** — The specified `experiment_id` does not exist. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -The requested dataset does not exist. - -### 500 - -Internal server error. Failed to fetch the evaluations list. - -## Code Examples - - -```python Python -import requests - -dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/get_evals_list/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -params = { - "search_text": "hallucination", - "eval_categories": "futureagi_built" -} - -response = requests.get(url, headers=headers, params=params) -print(response.json()) -``` -```typescript TypeScript -const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; -const params = new URLSearchParams({ - search_text: "hallucination", - eval_categories: "futureagi_built" -}); - -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/${datasetId}/get_evals_list/?${params}`, - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/get_evals_list/?search_text=hallucination&eval_categories=futureagi_built" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset for which to retrieve the list of available evaluations. The dataset must exist within your organization and be accessible with your current API credentials. + + + + + + An optional text string to filter evaluations by name. The search is case-insensitive and returns evaluations whose names contain the specified text. + + + + Filter evaluations by their category. Accepted values are `futureagi_built` (built-in evaluations provided by Future AGI) and `user_built` (custom evaluations created by users in your organization). + + + + Filter evaluations by their type. Accepted values are `preset` (template-based evaluations not yet configured on this dataset), `user` (evaluations already configured and added to this dataset), and `previously_configured` (evaluation templates that have been used on this dataset before). + + + + An array of tag strings to filter evaluations by. Only evaluations tagged with at least one of the specified tags are returned. Pass multiple values to filter by multiple tags (e.g., `eval_tags[]=hallucination&eval_tags[]=quality`). + + + + An array of use case strings to filter evaluations by. Only evaluations associated with at least one of the specified use cases are returned. + + + + The universally unique identifier (UUID) of an experiment to scope the evaluation results to. When provided, the experiment must exist and belong to the specified dataset. This narrows the results to evaluations relevant to the given experiment context. + + + + The ordering mode for the returned evaluations. Use `simulate` for simulation-specific ordering that prioritizes evaluations relevant to simulation workflows. + + + + + + The response payload containing the list of evaluations and recommendations. + + + + + An array of evaluation objects matching the specified filters. Each evaluation includes its identification, description, and categorization metadata. + + + + + The universally unique identifier (UUID) of the evaluation. For `preset` types, this is the eval template ID; for `user` types, this is the user eval metric ID. + + + + The human-readable name of the evaluation, displayed in the eval selection interface and dataset sidebar. + + + + A description of what the evaluation assesses, helping users understand its purpose and decide whether to apply it to their dataset. + + + + An array of tag strings associated with the evaluation template, used for categorization and filtering (e.g., `["hallucination", "quality"]`). + + + + + An array of recommended evaluation category strings based on the dataset's content and structure. These suggestions help users discover relevant evaluations they may not have considered (e.g., `["Deterministic Evals"]`). + + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the evaluations list is retrieved without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: `dataset_id` is missing; or the specified `experiment_id` does not exist. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset does not exist. Verify the `dataset_id` in the path is correct and that your API credentials have access to the target dataset. + + + + An unexpected error occurred on the server while fetching the evaluations list. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/dataset-evals/start-evals-process.mdx b/src/pages/docs/api/dataset-evals/start-evals-process.mdx index 1d412047..c79541ea 100644 --- a/src/pages/docs/api/dataset-evals/start-evals-process.mdx +++ b/src/pages/docs/api/dataset-evals/start-evals-process.mdx @@ -3,10 +3,6 @@ title: "Start Evals Process" description: "Start running one or more evaluations on a dataset." --- -# Start Evals Process - -Triggers the evaluation process for one or more previously configured evaluations on a dataset. This creates the necessary columns and queues all rows for processing. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset to run evaluations on. | - -## Request Body - - - List of user eval metric UUIDs to run. Must not be empty. Each eval must: - - Exist and belong to the specified dataset and your organization. - - Not have been deleted. - - Not have its associated column deleted (`column_deleted` must be `false`). - - -### Example - -```json -{ - "user_eval_ids": [ - "d4e5f6a7-b8c9-0123-def0-123456789abc", - "e5f6a7b8-c9d0-1234-ef01-23456789abcd" - ] -} -``` - -## Response - -Success message indicating how many evals were started. -Whether the request was successful. - -### Example Response - -```json -{ - "data": "Successfully updated 2 eval(s) status", - "success": true -} -``` - -## Responses - -### 200 - -Evaluation process started successfully. Eval columns are created and rows are queued for processing. - -### 400 - -Bad request. Possible reasons: - -- **Missing eval IDs** — `user_eval_ids` must not be empty. -- **Column deleted** — One or more evals have their associated column deleted and cannot be re-run. -- **Evals not found** — One or more eval IDs do not exist, do not belong to the dataset, or have been deleted. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 500 - -Internal server error. Failed to start the evaluation process. - -## Code Examples - - -```python Python -import requests - -dataset_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -url = f"https://api.futureagi.com/model-hub/develops/{dataset_id}/start_evals_process/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "user_eval_ids": [ - "d4e5f6a7-b8c9-0123-def0-123456789abc", - "e5f6a7b8-c9d0-1234-ef01-23456789abcd" - ] -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const datasetId = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"; - -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/${datasetId}/start_evals_process/`, - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - user_eval_ids: [ - "d4e5f6a7-b8c9-0123-def0-123456789abc", - "e5f6a7b8-c9d0-1234-ef01-23456789abcd" - ] - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/start_evals_process/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "user_eval_ids": [ - "d4e5f6a7-b8c9-0123-def0-123456789abc", - "e5f6a7b8-c9d0-1234-ef01-23456789abcd" - ] - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset on which to start the evaluation process. The dataset must exist within your organization and be accessible with your current API credentials. + + + + + + An array of user eval metric UUIDs identifying the evaluations to run. Must contain at least one ID. Each evaluation must exist within the specified dataset and belong to your organization, must not have been deleted, and must not have its associated column deleted (`column_deleted` must be `false`). The evaluation process creates the necessary columns and queues all rows for processing. + + + + + + A human-readable confirmation message indicating how many evaluations were started. Typically returns a message like `Successfully updated 2 eval(s) status`, where the number reflects the count of evaluations that were triggered. + + + + A boolean flag indicating whether the request completed successfully. Returns `true` when the evaluation process is started without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: `user_eval_ids` is empty; one or more evals have their associated column deleted and cannot be re-run; or one or more eval IDs do not exist, do not belong to the dataset, or have been deleted. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + An unexpected error occurred on the server while starting the evaluation process. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/add-as-new.mdx b/src/pages/docs/api/datasets/add-as-new.mdx index 453e994c..9f7c39e4 100644 --- a/src/pages/docs/api/datasets/add-as-new.mdx +++ b/src/pages/docs/api/datasets/add-as-new.mdx @@ -3,15 +3,10 @@ title: "Add as New Dataset" description: "Create a new dataset from selected columns of an existing dataset or experiment." --- -# Add as New Dataset - -Create a new dataset by selecting and optionally renaming columns from an existing dataset or experiment table. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - UUID of the source dataset or experiment table. - - - - Name for the new dataset. Must be unique within your organization. - - - - Mapping of source column IDs to new column names. At least one column mapping is required. No duplicate column names allowed. - - Format: `{ "source_column_id": "new_column_name" }` - - -### Example - -```json -{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "My New Dataset", - "columns": { - "col-uuid-1": "input_text", - "col-uuid-2": "expected_output" - } -} -``` - -## Response - -Returns the created dataset details. - -Confirmation message. -UUID of the newly created dataset. - -### Example Response - -```json -{ - "message": "Dataset created successfully", - "dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" -} -``` - -## Responses - -### 200 - -Dataset created successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing fields** - `dataset_id`, `name`, and `columns` are all required. -- **Duplicate column names** - Column name mapping contains duplicates. -- **Empty columns** - At least one column mapping must be provided. -- **Duplicate name** - A dataset with this name already exists in your organization. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Source dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/add-as-new/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "My New Dataset", - "columns": { - "col-uuid-1": "input_text", - "col-uuid-2": "expected_output" - } -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/add-as-new/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - name: "My New Dataset", - columns: { - "col-uuid-1": "input_text", - "col-uuid-2": "expected_output" - } - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/add-as-new/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "My New Dataset", - "columns": { - "col-uuid-1": "input_text", - "col-uuid-2": "expected_output" - } - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the source dataset or experiment table from which columns and rows will be copied. The source must exist within your organization. All rows from the source dataset will be included in the new dataset, but only the columns specified in the `columns` mapping will be carried over. + + + The name for the newly created dataset. This name must be unique within your organization. Choose a descriptive name that helps identify the dataset's purpose or contents for easy reference later. + + + A JSON object that maps source column UUIDs to the desired column names in the new dataset. Each key is a UUID of a column in the source dataset, and each value is the string name that column should have in the new dataset. At least one column mapping is required, and no duplicate column names are allowed. Format: `{ "source_column_id": "new_column_name" }`. + + + + + + A human-readable confirmation message indicating the new dataset was created successfully, such as `"Dataset created successfully"`. + + + The universally unique identifier (UUID) of the newly created dataset. Use this ID to reference the dataset in subsequent API calls, such as adding rows, running evaluations, or retrieving dataset details. + + + + + + The request could not be processed. Possible reasons include: required fields (`dataset_id`, `name`, or `columns`) are missing, the column name mapping contains duplicate names, the columns mapping is empty, or a dataset with the specified name already exists in your organization. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The source dataset could not be found. Confirm that the dataset UUID is valid and belongs to your organization. + + + Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. Contact support or wait before retrying. + + + An unexpected error occurred on the server while creating the new dataset. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/add-empty-rows.mdx b/src/pages/docs/api/datasets/add-empty-rows.mdx index 53ba39a0..2308d8ca 100644 --- a/src/pages/docs/api/datasets/add-empty-rows.mdx +++ b/src/pages/docs/api/datasets/add-empty-rows.mdx @@ -3,10 +3,6 @@ title: "Add Empty Rows" description: "Add empty rows to an existing dataset." --- -# Add Empty Rows - -Add a specified number of empty rows to an existing dataset. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the target dataset. - - -## Request Body - - - Number of empty rows to add. Must be between 1 and 100. - - -### Example - -```json -{ - "num_rows": 5 -} -``` - -## Response - -Returns confirmation of added rows. - -Confirmation message with count of rows added. -Status indicator. Example: `success`. - -### Example Response - -```json -{ - "data": "Successfully added 5 empty row(s)", - "status": "success" -} -``` - -## Responses - -### 200 - -Empty rows added successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing num_rows** - The `num_rows` field is required. -- **Invalid range** - `num_rows` must be between 1 and 100. -- **Invalid type** - `num_rows` must be a valid integer. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_empty_rows/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "num_rows": 5 -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_empty_rows/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - num_rows: 5 - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_empty_rows/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "num_rows": 5 - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the target dataset to which empty rows will be appended. The dataset must exist within your organization and can have any number of existing columns and rows. + + + + + + The number of empty rows to add to the dataset. Each new row will have blank values for all existing columns. The value must be an integer between 1 and 100, inclusive. Use this to pre-allocate rows that you intend to populate later via the Update Cell Value endpoint or through the dashboard. + + + + + + A human-readable confirmation message indicating how many empty rows were successfully added to the dataset, such as `"Successfully added 5 empty row(s)"`. + + + Indicates the outcome of the API request. Returns `"success"` when the empty rows are added without errors. + + + + + + The request could not be processed. Possible reasons include: the `num_rows` field is missing, the value is not a valid integer, or the value is outside the allowed range of 1 to 100. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The specified dataset could not be found. Confirm that the dataset UUID is valid and belongs to your organization. + + + Resource limit reached. Your organization has exceeded the row addition quota. Contact support or wait before retrying. + + + An unexpected error occurred on the server while adding empty rows. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/add-rows-from-existing.mdx b/src/pages/docs/api/datasets/add-rows-from-existing.mdx index 288bca5b..60dd466c 100644 --- a/src/pages/docs/api/datasets/add-rows-from-existing.mdx +++ b/src/pages/docs/api/datasets/add-rows-from-existing.mdx @@ -3,10 +3,6 @@ title: "Add Rows from Existing Dataset" description: "Add rows from one dataset to another using column mapping." --- -# Add Rows from Existing Dataset - -Import rows from a source dataset into a target dataset by mapping source columns to target columns. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the target dataset to add rows to. - - -## Request Body - - - UUID of the source dataset to copy rows from. Cannot be the same as the target dataset. - - - - Mapping of source column IDs to target column IDs. At least one mapping is required. No duplicate target columns allowed. - - Format: `{ "source_column_id": "target_column_id" }` - - -### Example - -```json -{ - "source_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "column_mapping": { - "src-col-uuid-1": "tgt-col-uuid-1", - "src-col-uuid-2": "tgt-col-uuid-2" - } -} -``` - -## Response - -Returns confirmation of imported rows. - - - Object containing: - - `message` (string) - Confirmation message - - `rows_added` (integer) - Number of rows imported - -Status indicator. Example: `success`. - -### Example Response - -```json -{ - "data": { - "message": "Rows Imported successfully", - "rows_added": 50 - }, - "status": "success" -} -``` - -## Responses - -### 200 - -Rows imported successfully. - -### 400 - -Bad request. Possible reasons: - -- **Same dataset** - Source and target datasets cannot be the same. -- **Empty mapping** - At least one column mapping is required. -- **Duplicate targets** - Column mapping contains duplicate target columns. -- **Invalid columns** - No valid column mappings found. Check column names. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Source or target dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_existing_dataset/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "source_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "column_mapping": { - "src-col-uuid-1": "tgt-col-uuid-1", - "src-col-uuid-2": "tgt-col-uuid-2" - } -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_existing_dataset/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" + responseExample={{ + data: { + message: "Rows Imported successfully", + rows_added: 50 }, - body: JSON.stringify({ - source_dataset_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", - column_mapping: { - "src-col-uuid-1": "tgt-col-uuid-1", - "src-col-uuid-2": "tgt-col-uuid-2" - } - }) - } -); + status: "success" + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_existing_dataset/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "source_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "column_mapping": { - "src-col-uuid-1": "tgt-col-uuid-1", - "src-col-uuid-2": "tgt-col-uuid-2" - } - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the target dataset that will receive the imported rows. This dataset must exist within your organization and must be different from the source dataset. + + + + + + The universally unique identifier (UUID) of the source dataset from which rows will be copied. The source dataset must belong to your organization and cannot be the same as the target dataset specified in the path parameter. + + + A JSON object that defines how columns from the source dataset map to columns in the target dataset. Each key is a source column UUID and each value is the corresponding target column UUID. At least one mapping entry is required, and no duplicate target column UUIDs are allowed. Only rows with data in the mapped columns will be imported. Format: `{ "source_column_id": "target_column_id" }`. + + + + + + The response payload containing details about the completed row import operation. + + + + A human-readable confirmation message indicating the rows were imported successfully, such as `"Rows Imported successfully"`. + + + The total number of rows that were successfully copied from the source dataset into the target dataset during this import operation. + + + + Indicates the outcome of the API request. Returns `"success"` when the row import completes without errors. + + + + + + The request could not be processed. Possible reasons include: the source and target datasets are the same, the column mapping is empty, the column mapping contains duplicate target columns, or no valid column mappings were found (check that the column IDs exist in their respective datasets). + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The source or target dataset could not be found. Confirm that both dataset UUIDs are valid and belong to your organization. + + + Resource limit reached. Your organization has exceeded the row addition quota. Contact support or wait before retrying. + + + An unexpected error occurred on the server while processing the row import. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/add-rows-from-file.mdx b/src/pages/docs/api/datasets/add-rows-from-file.mdx index f3c7cde0..1873fe3f 100644 --- a/src/pages/docs/api/datasets/add-rows-from-file.mdx +++ b/src/pages/docs/api/datasets/add-rows-from-file.mdx @@ -3,137 +3,64 @@ title: "Add Rows from File" description: "Add rows to an existing dataset by uploading a file." --- -# Add Rows from File - -Add rows to an existing dataset by uploading a CSV, Excel, JSON, or JSONL file. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - -This endpoint accepts `multipart/form-data`. - - - The file to upload. Supported formats: `.csv`, `.xls`, `.xlsx`, `.json`, `.jsonl`. Maximum file size is **10 MB**. - - - - UUID of the target dataset to add rows to. - - -## Response - -Returns confirmation of added rows. - -Confirmation message with count of rows added. -Status indicator. Example: `success`. - -### Example Response - -```json -{ - "data": "50 Row(s) added successfully", - "status": "success" -} -``` - -## Responses - -### 200 - -Rows added successfully. - -### 400 - -Bad request. Possible reasons: - -- **No file uploaded** - The `file` field is required. -- **File too large** - File size exceeds the 10 MB limit. -- **Unsupported format** - Only `.csv`, `.xls`, `.xlsx`, `.json`, and `.jsonl` files are supported. -- **Missing dataset_id** - The `dataset_id` field is required. -- **File processing error** - The file could not be parsed. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/add_rows_from_file/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} -files = { - "file": ("data.csv", open("data.csv", "rb"), "text/csv") -} -data = { - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -} - -response = requests.post(url, headers=headers, files=files, data=data) -print(response.json()) -``` -```typescript TypeScript -const formData = new FormData(); -formData.append("file", fileInput.files[0]); -formData.append("dataset_id", "a1b2c3d4-e5f6-7890-abcd-ef1234567890"); - -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/add_rows_from_file/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - }, - body: formData - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/add_rows_from_file/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -F "file=@data.csv" \ - -F "dataset_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The file to upload containing the row data to be added to the dataset. Supported formats include `.csv`, `.xls`, `.xlsx`, `.json`, and `.jsonl`. The maximum allowed file size is 10 MB. The request must use `multipart/form-data` content type when uploading this field. Column headers in the file are matched to existing dataset columns by name. + + + The universally unique identifier (UUID) of the target dataset to which the uploaded rows will be added. The dataset must exist within your organization and must have columns that correspond to the file's column headers or keys. + + + + + + A human-readable confirmation message indicating how many rows were successfully added from the uploaded file, such as `"50 Row(s) added successfully"`. + + + Indicates the outcome of the API request. Returns `"success"` when the file upload and row import completes without errors. + + + + + + The request could not be processed. Possible reasons include: no file was uploaded, the file exceeds the 10 MB size limit, the file format is not supported (only `.csv`, `.xls`, `.xlsx`, `.json`, `.jsonl`), the `dataset_id` field is missing, or the file could not be parsed. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The specified dataset could not be found. Confirm that the dataset UUID is valid and belongs to your organization. + + + Resource limit reached. Your organization has exceeded the row addition quota. Contact support or wait before retrying. + + + An unexpected error occurred on the server while processing the file upload. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/add-rows-from-huggingface.mdx b/src/pages/docs/api/datasets/add-rows-from-huggingface.mdx index e3d3db32..5fc0b4af 100644 --- a/src/pages/docs/api/datasets/add-rows-from-huggingface.mdx +++ b/src/pages/docs/api/datasets/add-rows-from-huggingface.mdx @@ -3,10 +3,6 @@ title: "Add Rows from HuggingFace" description: "Add rows to an existing dataset by importing from a HuggingFace dataset." --- -# Add Rows from HuggingFace - -Import rows from a HuggingFace dataset into an existing dataset. The data is processed in the background. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the target dataset to add rows to. - - -## Request Body - - - HuggingFace dataset path (e.g., `squad`, `glue`, `username/dataset-name`). - - - - Dataset configuration/subset name (e.g., `plain_text`, `mnli`). - - - - Dataset split to import (e.g., `train`, `test`, `validation`). - - - - Maximum number of rows to import. If not provided, all rows from the split are imported. - - -### Example - -```json -{ - "huggingface_dataset_name": "squad", - "huggingface_dataset_config": "plain_text", - "huggingface_dataset_split": "train", - "num_rows": 50 -} -``` - -## Response - -Returns confirmation of the import. - - - Object containing: - - `message` (string) - Confirmation message with count of rows imported - -Status indicator. Example: `success`. - -### Example Response - -```json -{ - "data": { - "message": "50 Row(s) imported Successfully" - }, - "status": "success" -} -``` - -## Responses - -### 200 - -Rows imported successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing fields** - `huggingface_dataset_config` and `huggingface_dataset_split` are required. -- **Invalid dataset** - The HuggingFace dataset could not be found or accessed. -- **Invalid config/split** - The specified configuration or split does not exist. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Target dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_huggingface/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "huggingface_dataset_name": "squad", - "huggingface_dataset_config": "plain_text", - "huggingface_dataset_split": "train", - "num_rows": 50 -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_huggingface/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" + responseExample={{ + data: { + message: "50 Row(s) imported Successfully" }, - body: JSON.stringify({ - huggingface_dataset_name: "squad", - huggingface_dataset_config: "plain_text", - huggingface_dataset_split: "train", - num_rows: 50 - }) - } -); + status: "success" + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/add_rows_from_huggingface/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "huggingface_dataset_name": "squad", - "huggingface_dataset_config": "plain_text", - "huggingface_dataset_split": "train", - "num_rows": 50 - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the target dataset that will receive the imported rows from HuggingFace. The dataset must exist within your organization. New columns will be created in the target dataset to match the schema of the imported HuggingFace data. + + + + + + The full path or name of the HuggingFace dataset to import from. This can be a simple dataset name like `"squad"` or `"glue"`, or a namespaced path like `"username/dataset-name"`. The dataset must be publicly accessible on the HuggingFace Hub. + + + The specific configuration or subset of the HuggingFace dataset to use. Many HuggingFace datasets have multiple configurations (e.g., `"plain_text"` for SQuAD, `"mnli"` for GLUE). This value must match an available configuration for the specified dataset. + + + The dataset split to import rows from. Common values include `"train"`, `"test"`, and `"validation"`. The split must exist within the specified dataset configuration. + + + The maximum number of rows to import from the HuggingFace dataset split. If this field is omitted or not provided, all rows from the specified split will be imported. Use this to limit the import size when working with large datasets. + + + + + + The response payload containing details about the completed HuggingFace import operation. + + + + A human-readable confirmation message indicating how many rows were successfully imported from HuggingFace, such as `"50 Row(s) imported Successfully"`. + + + + Indicates the outcome of the API request. Returns `"success"` when the HuggingFace import completes without errors. + + + + + + The request could not be processed. Possible reasons include: the `huggingface_dataset_config` or `huggingface_dataset_split` fields are missing, the HuggingFace dataset could not be found or accessed, or the specified configuration or split does not exist for the given dataset. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The target dataset could not be found. Confirm that the dataset UUID is valid and belongs to your organization. + + + Resource limit reached. Your organization has exceeded the row addition quota. Contact support or wait before retrying. + + + An unexpected error occurred on the server while processing the HuggingFace import. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/analytics/annotation-summary.mdx b/src/pages/docs/api/datasets/analytics/annotation-summary.mdx index 532318a3..db91525e 100644 --- a/src/pages/docs/api/datasets/analytics/annotation-summary.mdx +++ b/src/pages/docs/api/datasets/analytics/annotation-summary.mdx @@ -3,132 +3,104 @@ title: "Annotation Summary" description: "Get a summary of annotations for a dataset, including label distributions and annotator statistics." --- -# Annotation Summary - -Retrieve an aggregated summary of all annotations applied to a dataset, including label distributions and annotation progress. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -## Response - -Status message. Example: `success`. -Annotation summary data. - -### Example Response - -```json -{ - "message": "success", - "data": { - "total_annotations": 150, - "total_rows": 50, - "annotated_rows": 45, - "annotation_coverage": 0.9, - "labels": [ - { - "label_name": "Correct", - "count": 90, - "percentage": 0.6 - }, - { - "label_name": "Incorrect", - "count": 35, - "percentage": 0.23 - }, - { - "label_name": "Partially Correct", - "count": 25, - "percentage": 0.17 - } - ] - } -} -``` - -## Responses - -### 200 - -Annotation summary retrieved successfully. - -- **message**: string — `success` -- **data**: object - - **total_annotations**: integer — Total number of annotations. - - **total_rows**: integer — Total rows in the dataset. - - **annotated_rows**: integer — Number of rows with at least one annotation. - - **annotation_coverage**: number — Ratio of annotated rows to total rows. - - **labels**: array — Distribution of annotation labels. - - **label_name**: string — Label display name. - - **count**: integer — Number of times this label was applied. - - **percentage**: number — Proportion of total annotations. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/dataset/{dataset_id}/annotation-summary/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} - -response = requests.get(url, headers=headers) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/dataset/{dataset_id}/annotation-summary/", - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" + responseExample={{ + message: "success", + data: { + total_annotations: 150, + total_rows: 50, + annotated_rows: 45, + annotation_coverage: 0.9, + labels: [ + { + label_name: "Correct", + count: 90, + percentage: 0.6 + }, + { + label_name: "Incorrect", + count: 35, + percentage: 0.23 + }, + { + label_name: "Partially Correct", + count: 25, + percentage: 0.17 + } + ] } - } -); + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/dataset/{dataset_id}/annotation-summary/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset for which you want to retrieve the annotation summary. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + + + + A status message indicating the result of the request. Returns `success` when the annotation summary is retrieved successfully. + + + + The aggregated annotation summary for the dataset, including overall progress metrics and the distribution of annotation labels applied across all rows. + + + + The total number of individual annotations that have been applied across all rows in the dataset. A single row may have multiple annotations if reviewed by multiple annotators or annotated multiple times. + + + The total number of rows in the dataset, regardless of whether they have been annotated. This provides the denominator for calculating annotation coverage. + + + The number of rows in the dataset that have received at least one annotation. Combined with `total_rows`, this indicates how much of the dataset has been reviewed. + + + The ratio of annotated rows to total rows, expressed as a decimal between 0 and 1. Calculated as `annotated_rows / total_rows`. Provides a quick measure of how complete the annotation effort is for this dataset. + + + A breakdown of annotation labels applied across the dataset, showing the distribution of each label. Useful for understanding the balance of categories in your annotated data. + + + + The display name of the annotation label as defined in your annotation configuration. Examples include `Correct`, `Incorrect`, `Partially Correct`, or any custom labels you have configured. + + + The total number of times this specific label has been applied across all annotations in the dataset. + + + The proportion of total annotations that used this label, expressed as a decimal between 0 and 1. Calculated as `count / total_annotations`. + + + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/analytics/eval-stats.mdx b/src/pages/docs/api/datasets/analytics/eval-stats.mdx index f3019d52..3073b03e 100644 --- a/src/pages/docs/api/datasets/analytics/eval-stats.mdx +++ b/src/pages/docs/api/datasets/analytics/eval-stats.mdx @@ -3,137 +3,104 @@ title: "Eval Stats" description: "Get evaluation statistics for a dataset, including metrics by column." --- -# Eval Stats - -Retrieve evaluation statistics for a dataset. Returns aggregated metrics for evaluation columns, optionally filtered by specific column IDs. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -### Query Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `column_ids` | string | No | Comma-separated list of column UUIDs to filter. If omitted, stats for all evaluation columns are returned. | - -## Response - -Returns an array of evaluation statistics objects. - -### Example Response - -```json -[ - { - "template_name": "Relevance", - "metric_count": 50, - "average_score": 0.85, - "min_score": 0.2, - "max_score": 1.0, - "pass_count": 42, - "fail_count": 8, - "pass_rate": 0.84 - }, - { - "template_name": "Faithfulness", - "metric_count": 50, - "average_score": 0.92, - "min_score": 0.5, - "max_score": 1.0, - "pass_count": 47, - "fail_count": 3, - "pass_rate": 0.94 - } -] -``` - -## Responses - -### 200 - -Evaluation statistics retrieved successfully. Each object contains: - -- **template_name**: string — Name of the evaluation template. -- **metric_count**: integer — Total number of evaluated items. -- **average_score**: number — Mean evaluation score. -- **min_score**: number — Minimum score. -- **max_score**: number — Maximum score. -- **pass_count**: integer — Number of items that passed. -- **fail_count**: integer — Number of items that failed. -- **pass_rate**: number — Ratio of passed to total items. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/dataset/{dataset_id}/eval-stats/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} -params = { - "column_ids": "col-uuid-1,col-uuid-2" -} - -response = requests.get(url, headers=headers, params=params) -print(response.json()) -``` -```typescript TypeScript -const params = new URLSearchParams({ - column_ids: "col-uuid-1,col-uuid-2" -}); -const response = await fetch( - `https://api.futureagi.com/model-hub/dataset/{dataset_id}/eval-stats/?${params}`, - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/dataset/{dataset_id}/eval-stats/?column_ids=col-uuid-1,col-uuid-2" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset for which you want to retrieve evaluation statistics. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + + + + A comma-separated list of evaluation column UUIDs to filter the returned statistics. When provided, only statistics for the specified columns are included in the response. When omitted, statistics for all evaluation columns in the dataset are returned. + + + + + Returns an array of evaluation statistics objects, one per evaluation template applied to the dataset. Each object provides aggregated metrics summarizing the evaluation results. + + + The name of the evaluation template that produced these metrics. This corresponds to the template configured on the evaluation column, such as `Relevance`, `Faithfulness`, `Coherence`, or a custom template name. + + + + The total number of data points (rows) that were evaluated by this template. This count includes both passed and failed evaluations. + + + + The arithmetic mean of all evaluation scores produced by this template across the dataset. Scores are typically normalized to a 0-to-1 range, where higher values indicate better performance. + + + + The lowest evaluation score recorded for this template across all evaluated rows in the dataset. Useful for identifying worst-case performance. + + + + The highest evaluation score recorded for this template across all evaluated rows in the dataset. Useful for understanding the upper bound of performance. + + + + The number of evaluated rows that met or exceeded the passing threshold defined by the evaluation template. Combined with `fail_count`, this accounts for all evaluated rows. + + + + The number of evaluated rows that fell below the passing threshold defined by the evaluation template. Indicates how many data points did not meet the quality criteria. + + + + The ratio of passed evaluations to total evaluations, expressed as a decimal between 0 and 1. Calculated as `pass_count / metric_count`. Provides a quick summary of overall evaluation quality. + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/analytics/explanation-summary.mdx b/src/pages/docs/api/datasets/analytics/explanation-summary.mdx index 79663e08..6f27343e 100644 --- a/src/pages/docs/api/datasets/analytics/explanation-summary.mdx +++ b/src/pages/docs/api/datasets/analytics/explanation-summary.mdx @@ -3,164 +3,92 @@ title: "Explanation Summary" description: "Get an AI-generated explanation summary for a dataset's content and patterns." --- -# Explanation Summary - -Retrieve an AI-generated summary that explains the dataset's content, patterns, and key insights. The summary is generated asynchronously and cached. If the summary has not been generated yet, a background task is triggered automatically. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -## Response - -Status message. Example: `success`. -Explanation summary data and generation status. - -### Example Response (Completed) - -```json -{ - "message": "success", - "data": { - "response": { - "summary": "This dataset contains customer support interactions...", - "key_patterns": ["High correlation between response length and satisfaction"], - "critical_issues": ["15% of responses contain hallucinated information"] - }, - "last_updated": "2024-01-15T10:30:00Z", - "status": "COMPLETED", - "row_count": 500, - "min_rows_required": 10 - } -} -``` - -### Example Response (Pending) - -```json -{ - "message": "success", - "data": { - "response": null, - "last_updated": null, - "status": "PENDING", - "row_count": 500, - "min_rows_required": 10 - } -} -``` - -### Example Response (Insufficient Data) - -```json -{ - "message": "success", - "data": { - "response": null, - "last_updated": null, - "status": "INSUFFICIENT_DATA", - "row_count": 3, - "min_rows_required": 10 - } -} -``` - -## Responses - -### 200 - -Summary data returned. Check the `status` field: - -- **message**: string — `success` -- **data**: object - - **response**: object or null — The explanation summary content. `null` if not yet generated. - - **last_updated**: string (ISO 8601) or null — Timestamp of the last summary generation. - - **status**: string — Generation status: - - `COMPLETED` — Summary is available. - - `PENDING` — Summary generation is in progress. - - `INSUFFICIENT_DATA` — Not enough rows to generate a summary. - - **row_count**: integer — Current number of rows in the dataset. - - **min_rows_required**: integer — Minimum rows needed to generate a summary. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/datasets/explanation-summary/{dataset_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} - -response = requests.get(url, headers=headers) -result = response.json() - -if result["data"]["status"] == "COMPLETED": - print("Summary:", result["data"]["response"]) -elif result["data"]["status"] == "PENDING": - print("Summary is being generated, check back later.") -else: - print("Insufficient data:", result["data"]["row_count"], "rows") -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/datasets/explanation-summary/{dataset_id}/", - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" + responseExample={{ + message: "success", + data: { + response: { + summary: "This dataset contains customer support interactions...", + key_patterns: ["High correlation between response length and satisfaction"], + critical_issues: ["15% of responses contain hallucinated information"] + }, + last_updated: "2024-01-15T10:30:00Z", + status: "COMPLETED", + row_count: 500, + min_rows_required: 10 } - } -); - -const result = await response.json(); + }} + responseStatus={200} + responseStatusText="OK" +/> -if (result.data.status === "COMPLETED") { - console.log("Summary:", result.data.response); -} else if (result.data.status === "PENDING") { - console.log("Summary is being generated, check back later."); -} else { - console.log("Insufficient data:", result.data.row_count, "rows"); -} -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/datasets/explanation-summary/{dataset_id}/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset for which you want to retrieve or generate an AI-powered explanation summary. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. If no summary has been generated yet, calling this endpoint automatically triggers a background generation task. + + + + + + A status message indicating the result of the request. Returns `success` when the explanation summary data is retrieved, regardless of whether the summary itself has been generated yet. + + + + The explanation summary data and generation status. The `response` field contains the actual summary content when available, while the `status` field indicates whether the summary has been generated, is in progress, or cannot be generated due to insufficient data. + + + + The AI-generated explanation summary content. Contains structured insights about the dataset's content, patterns, and potential issues. Returns `null` if the summary has not yet been generated or if the dataset has insufficient data. + + + + A comprehensive natural-language summary describing the dataset's content, structure, and overall characteristics. Provides a high-level overview of what the data represents and its key attributes. + + + A list of notable patterns, trends, and correlations identified by the AI analysis across the dataset's rows and columns. Each entry is a string describing a specific observation. + + + A list of potential quality issues, anomalies, or concerns identified in the dataset. Each entry is a string describing a specific issue that may require attention, such as data inconsistencies, hallucinations, or coverage gaps. + + + + The ISO 8601 timestamp indicating when the explanation summary was last generated or refreshed. Returns `null` if the summary has never been generated. + + + The current generation status of the explanation summary. Possible values: `COMPLETED` indicates the summary is available and ready to read; `PENDING` indicates the summary generation is currently in progress as a background task; `INSUFFICIENT_DATA` indicates the dataset does not have enough rows to generate a meaningful summary. + + + The current number of rows in the dataset at the time of the request. Used in conjunction with `min_rows_required` to determine whether the dataset has sufficient data for summary generation. + + + The minimum number of rows required in the dataset before an explanation summary can be generated. If `row_count` is less than this value, the status will be `INSUFFICIENT_DATA`. + + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx b/src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx index ab2b38fd..6eb3d3ee 100644 --- a/src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx +++ b/src/pages/docs/api/datasets/analytics/run-prompt-stats.mdx @@ -3,129 +3,120 @@ title: "Run Prompt Stats" description: "Get aggregated statistics for run prompt columns in a dataset." --- -# Run Prompt Stats - -Retrieve aggregated statistics for run prompt columns in a dataset, including average token usage, cost, and response time. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -### Query Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `prompt_ids` | string | No | Comma-separated list of RunPrompter UUIDs to filter. If omitted, stats for all run prompt columns are returned. | - -## Response - -Status message. Example: `success`. -Aggregated run prompt statistics. - -### Example Response - -```json -{ - "message": "success", - "data": { - "avg_tokens": 245.8, - "avg_cost": 0.0032, - "avg_time": 1.45, - "prompts": [ - { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "gpt_response", - "model": "gpt-4o", - "avg_tokens": 245.8, - "avg_cost": 0.0032, - "avg_time": 1.45, - "total_rows": 50, - "completed_rows": 48, - "failed_rows": 2 - } - ] - } -} -``` - -## Responses - -### 200 - -Statistics retrieved successfully. - -- **message**: string — `success` -- **data**: object - - **avg_tokens**: number — Average token count across all prompts. - - **avg_cost**: number — Average cost per request (USD). - - **avg_time**: number — Average response time in seconds. - - **prompts**: array — Per-prompt breakdown. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/dataset/{dataset_id}/run-prompt-stats/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} - -response = requests.get(url, headers=headers) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/dataset/{dataset_id}/run-prompt-stats/", - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" + responseExample={{ + message: "success", + data: { + avg_tokens: 245.8, + avg_cost: 0.0032, + avg_time: 1.45, + prompts: [ + { + id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + name: "gpt_response", + model: "gpt-4o", + avg_tokens: 245.8, + avg_cost: 0.0032, + avg_time: 1.45, + total_rows: 50, + completed_rows: 48, + failed_rows: 2 + } + ] } - } -); + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/dataset/{dataset_id}/run-prompt-stats/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset for which you want to retrieve run prompt statistics. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + + + + A comma-separated list of RunPrompter UUIDs to filter the returned statistics. When provided, only statistics for the specified run prompt columns are included in the response. When omitted, statistics for all run prompt columns in the dataset are returned. + + + + + + A status message indicating the result of the request. Returns `success` when the statistics are retrieved successfully. + + + + The aggregated run prompt statistics for the dataset, including overall averages and per-prompt breakdowns. + + + + The average number of tokens consumed per prompt execution across all run prompt columns in the dataset. This includes both input and output tokens and provides an overall measure of token usage efficiency. + + + The average cost in USD per prompt execution across all run prompt columns in the dataset. Calculated based on the model pricing for the tokens consumed during each execution. + + + The average response time in seconds per prompt execution across all run prompt columns in the dataset. Measures the end-to-end latency from sending the prompt to receiving the complete response from the language model. + + + A detailed per-prompt breakdown of execution statistics. Each object in the array represents a single run prompt column and its individual performance metrics. + + + + The universally unique identifier (UUID) of the RunPrompter configuration associated with this run prompt column. + + + The human-readable name of the run prompt column as it appears in the dataset grid. + + + The identifier of the language model used for prompt execution in this column, such as `gpt-4o`, `gpt-3.5-turbo`, or `claude-3-opus`. + + + The average number of tokens consumed per execution for this specific run prompt column. + + + The average cost in USD per execution for this specific run prompt column. + + + The average response time in seconds per execution for this specific run prompt column. + + + The total number of rows in the dataset that this run prompt column was configured to process. + + + The number of rows that were successfully processed by this run prompt column, producing a valid output. + + + The number of rows where prompt execution failed for this column, due to errors such as model timeouts, rate limits, or invalid input data. + + + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/clone-dataset.mdx b/src/pages/docs/api/datasets/clone-dataset.mdx index 79c36ec9..20f00ab7 100644 --- a/src/pages/docs/api/datasets/clone-dataset.mdx +++ b/src/pages/docs/api/datasets/clone-dataset.mdx @@ -3,142 +3,78 @@ title: "Clone Dataset" description: "Create a copy of an existing dataset with all its columns and rows." --- -# Clone Dataset - -Create a full copy of an existing dataset including all columns (user-created) and rows. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the source dataset to clone. - - -## Request Body - - - Name for the cloned dataset. If not provided, defaults to `Copy of {source_dataset_name}`. Must be unique within your organization. - - -### Example - -```json -{ - "new_dataset_name": "Copy of My Dataset" -} -``` - -## Response - -Returns the cloned dataset details. - -Confirmation message. -UUID of the newly cloned dataset. -Name of the cloned dataset. - -### Example Response - -```json -{ - "message": "Dataset cloned successfully", - "dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "dataset_name": "Copy of My Dataset" -} -``` - -## Responses - -### 200 - -Dataset cloned successfully. - -### 400 - -Bad request. Possible reasons: - -- **Duplicate name** - A dataset with this name already exists in your organization. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Source dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/clone-dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "new_dataset_name": "Copy of My Dataset" -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/clone-dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - new_dataset_name: "Copy of My Dataset" - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/clone-dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "new_dataset_name": "Copy of My Dataset" - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the source dataset to clone. The clone operation creates a full copy of all user-created columns and all rows from this dataset into a new, independent dataset. + + + + + + The human-readable name to assign to the cloned dataset. This name is used to identify the new dataset throughout the Future AGI platform. If not provided, the name defaults to `Copy of {source_dataset_name}`. Must be unique within your organization. + + + + + + A human-readable confirmation message indicating that the dataset was cloned successfully. Typically returns `Dataset cloned successfully`. + + + + The universally unique identifier (UUID) assigned to the newly cloned dataset. Use this ID to reference the cloned dataset in subsequent API calls such as updating, adding rows, or running evaluations. + + + + The name assigned to the cloned dataset, either matching the `new_dataset_name` value provided in the request body or the auto-generated default name. + + + + + + The request was malformed or contained invalid parameters. This can occur when a dataset with the specified name already exists in your organization. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The source dataset could not be found. The provided ID does not match any dataset in your organization. Verify the dataset UUID is correct and that the dataset has not been deleted. + + + + Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. Contact support or upgrade your plan to increase limits. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/add-columns.mdx b/src/pages/docs/api/datasets/columns/add-columns.mdx index 3183eda4..ba58b204 100644 --- a/src/pages/docs/api/datasets/columns/add-columns.mdx +++ b/src/pages/docs/api/datasets/columns/add-columns.mdx @@ -3,182 +3,103 @@ title: "Add Columns" description: "Add one or more columns to a dataset with specified names and data types." --- -# Add Columns - -Add one or more columns to a dataset. Returns the created column objects with their generated UUIDs. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -## Request Body - - - Array of column definitions. Each object must include `name` and `data_type`. - - -Each column object: - - - Name for the column. Must be unique within the dataset. - - - - Data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. - - - - Optional source type for the column. - - -### Example - -```json -{ - "new_columns_data": [ - { - "name": "context", - "data_type": "text" - }, - { - "name": "rating", - "data_type": "number" - } - ] -} -``` - -## Response - -Confirmation message. Example: `2 Columns added successfully`. -Array of created column objects with their UUIDs. - -### Example Response - -```json -{ - "message": "2 Columns added successfully", - "data": [ - { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "context", - "data_type": "text" - }, - { - "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "name": "rating", - "data_type": "number" - } - ] -} -``` - -## Responses - -### 200 - -Columns added successfully. Returns the created column objects. - -### 400 - -Bad request. Possible reasons: - -- **Invalid format** — `new_columns_data` must be a list. -- **Missing fields** — Each column must have `name` and `data_type`. -- **Duplicate name** — A column with this name already exists in the dataset. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_columns/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "new_columns_data": [ - {"name": "context", "data_type": "text"}, - {"name": "rating", "data_type": "number"} + responseExample={{ + message: "2 Columns added successfully", + data: [ + { + id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + name: "context", + data_type: "text" + }, + { + id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + name: "rating", + data_type: "number" + } ] -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_columns/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - new_columns_data: [ - { name: "context", data_type: "text" }, - { name: "rating", data_type: "number" } - ] - }) - } -); + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_columns/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "new_columns_data": [ - {"name": "context", "data_type": "text"}, - {"name": "rating", "data_type": "number"} - ] - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset you want to add columns to. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + + + + An array of column definition objects specifying the columns to create. Each object describes a single column to be added to the dataset. All columns in the array are created in a single operation, and each column receives a unique system-generated UUID upon creation. + + + The human-readable name to assign to the new column. This name is used to identify the column throughout the Future AGI platform, including in the dataset grid, evaluation configurations, and prompt templates. Must be unique within the dataset. + + + The data type for the column, which determines what kind of values can be stored in it and how the platform renders and validates cell contents. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + An optional source type annotation for the column. When specified, this indicates the origin or intended purpose of the column data, which can be used by the platform for downstream processing and filtering. + + + + + + + + A human-readable confirmation message indicating the number of columns that were successfully added. Typically returns a string like `2 Columns added successfully`. + + + + An array of the newly created column objects. Each object contains the system-generated UUID and the column metadata that was provided in the request. + + + + The universally unique identifier (UUID) assigned to the newly created column. Use this ID to reference the column in subsequent API calls such as updating, deleting, or configuring the column. + + + The human-readable name of the column as specified in the request. + + + The data type of the column as specified in the request. One of: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + + + + The request was malformed or contained invalid parameters. This can occur when: `new_columns_data` is not a valid array; individual column objects are missing the required `name` or `data_type` fields; a column with the same name already exists in the dataset; or the specified `data_type` is not one of the supported values. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx b/src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx index da033ca0..d771ede0 100644 --- a/src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx +++ b/src/pages/docs/api/datasets/columns/add-multiple-static-columns.mdx @@ -3,10 +3,6 @@ title: "Add Multiple Static Columns" description: "Add multiple static columns to a dataset in a single request." --- -# Add Multiple Static Columns - -Add multiple static columns to a dataset in a single atomic operation. All columns are created together — if any column fails validation, none are added. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -## Request Body - - - Array of column definitions to add. Each object must contain `new_column_name` and `column_type`. - - -Each column object: - - - Name for the column. Must be unique within the dataset and within the request. - - - - Data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. - - - - Optional source type for the column. - - -### Example - -```json -{ - "columns": [ - { - "new_column_name": "input", - "column_type": "text" - }, - { - "new_column_name": "score", - "column_type": "number" - }, - { - "new_column_name": "metadata", - "column_type": "json" - } - ] -} -``` - -## Response - -Confirmation message indicating success. - -### Example Response - -```json -{ - "message": "3 columns added successfully" -} -``` - -## Responses - -### 200 - -All columns added successfully. Empty cells are created for each new column across all existing rows. - -### 400 - -Bad request. Possible reasons: - -- **Empty columns array** — At least one column must be provided. -- **Missing name or type** — Each column must have `new_column_name` and `column_type`. -- **Duplicate names in request** — Column names within the request must be unique. -- **Duplicate names in dataset** — A column with one of the provided names already exists in the dataset. -- **Invalid data type** — One or more `column_type` values are not valid. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_multiple_static_columns/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "columns": [ - {"new_column_name": "input", "column_type": "text"}, - {"new_column_name": "score", "column_type": "number"}, - {"new_column_name": "metadata", "column_type": "json"} - ] -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_multiple_static_columns/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - columns: [ - { new_column_name: "input", column_type: "text" }, - { new_column_name: "score", column_type: "number" }, - { new_column_name: "metadata", column_type: "json" } - ] - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_multiple_static_columns/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "columns": [ - {"new_column_name": "input", "column_type": "text"}, - {"new_column_name": "score", "column_type": "number"}, - {"new_column_name": "metadata", "column_type": "json"} - ] - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset to which you want to add multiple static columns. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + + + + An array of column definition objects to add to the dataset in a single atomic operation. All columns are created together -- if any column fails validation, none are added. Each object describes a single static column to be created. + + + The human-readable name to assign to the new column. This name is used to identify the column throughout the Future AGI platform, including in the dataset grid, evaluation configurations, and prompt template variable mappings. Must be unique within both the dataset and the request itself. + + + The data type for the column, which determines what kind of values can be stored in it and how the platform renders and validates cell contents. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + An optional source type annotation for the column. When specified, this indicates the origin or intended purpose of the column data, which can be used by the platform for downstream processing and filtering. + + + + + + + + A human-readable confirmation message indicating the number of columns that were successfully added. Empty cells are automatically initialized for each new column across all existing rows in the dataset. Typically returns a string like `3 columns added successfully`. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `columns` array is empty or missing; individual column objects are missing the required `new_column_name` or `column_type` fields; column names within the request are not unique; a column with one of the provided names already exists in the dataset; or one or more `column_type` values are not supported. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/add-static-column.mdx b/src/pages/docs/api/datasets/columns/add-static-column.mdx index 5a5aeea0..e8ee4ca1 100644 --- a/src/pages/docs/api/datasets/columns/add-static-column.mdx +++ b/src/pages/docs/api/datasets/columns/add-static-column.mdx @@ -3,10 +3,6 @@ title: "Add Static Column" description: "Add a single static column to an existing dataset." --- -# Add Static Column - -Add a new static column to a dataset. The column is created with the specified name and data type, and empty cells are added for all existing rows. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -## Request Body - - - Name for the new column. Must be unique within the dataset. - - - - Data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. - - - - Optional source type for the column. - - -### Example - -```json -{ - "new_column_name": "score", - "column_type": "number" -} -``` - -## Response - -Confirmation message. Example: `Column added successfully`. - -### Example Response - -```json -{ - "message": "Column added successfully" -} -``` - -## Responses - -### 200 - -Column added successfully. Empty cells are created for all existing rows in the dataset. - -### 400 - -Bad request. Possible reasons: - -- **Missing column name** — `new_column_name` is required. -- **Missing column type** — `column_type` is required. -- **Duplicate name** — A column with this name already exists in the dataset. -- **Invalid data type** — The provided `column_type` is not a valid data type. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_static_column/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "new_column_name": "score", - "column_type": "number" -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_static_column/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - new_column_name: "score", - column_type: "number" - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/{dataset_id}/add_static_column/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "new_column_name": "score", - "column_type": "number" - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset to which you want to add a static column. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + + + + The human-readable name to assign to the new static column. This name is used to identify the column throughout the Future AGI platform, including in the dataset grid, evaluation configurations, and prompt template variable mappings. Must be unique within the dataset. + + + + The data type for the new column, which determines what kind of values can be stored in it and how the platform renders and validates cell contents. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + An optional source type annotation for the column. When specified, this indicates the origin or intended purpose of the column data, which can be used by the platform for downstream processing and filtering. + + + + + + A human-readable confirmation message indicating that the column was created successfully. Empty cells are automatically initialized for all existing rows in the dataset. Typically returns `Column added successfully`. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `new_column_name` field is missing or empty; the `column_type` field is missing; a column with the same name already exists in the dataset; or the provided `column_type` is not one of the supported data type values. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/delete-column.mdx b/src/pages/docs/api/datasets/columns/delete-column.mdx index 6a8ad2c9..46804b36 100644 --- a/src/pages/docs/api/datasets/columns/delete-column.mdx +++ b/src/pages/docs/api/datasets/columns/delete-column.mdx @@ -3,102 +3,52 @@ title: "Delete Column" description: "Delete a column and its associated data from a dataset." --- -# Delete Column - -Delete a column from a dataset. This removes the column, all associated cell data, and any linked resources (e.g., run prompt configurations or evaluation metrics). - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | -| `column_id` | string (UUID) | Yes | The UUID of the column to delete. | - -## Response - -Confirmation message indicating the column was deleted. - -### Example Response - -```json -{ - "message": "Column deleted successfully" -} -``` - -## Responses - -### 200 - -Column deleted successfully. The following cleanup is performed automatically: - -- All cell data in the column is deleted. -- The column is removed from the dataset's column order. -- If the column has a source (e.g., RUN_PROMPT, EVALUATION), the associated configuration is also deleted. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Column or dataset not found, or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_column/{column_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} - -response = requests.delete(url, headers=headers) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_column/{column_id}/", - { - method: "DELETE", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X DELETE "https://api.futureagi.com/model-hub/develops/{dataset_id}/delete_column/{column_id}/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset that contains the column you want to delete. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + The universally unique identifier (UUID) of the column to delete. This ID is returned when a column is created and can be retrieved from the column details endpoint. Deleting a column permanently removes all cell data associated with it, removes the column from the dataset's column order, and deletes any linked configurations such as run prompt or evaluation settings. + + + + + + A human-readable confirmation message indicating that the column and all of its associated data were successfully deleted. The following cleanup is performed automatically: all cell data in the column is removed, the column is removed from the dataset's column ordering, and if the column had a source type (such as RUN_PROMPT or EVALUATION), the associated configuration is also deleted. Typically returns `Column deleted successfully`. + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified column or dataset was not found, or does not belong to your organization. Verify that both the `dataset_id` and `column_id` are correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/get-column-config.mdx b/src/pages/docs/api/datasets/columns/get-column-config.mdx index 2d3ac239..944e6c67 100644 --- a/src/pages/docs/api/datasets/columns/get-column-config.mdx +++ b/src/pages/docs/api/datasets/columns/get-column-config.mdx @@ -3,146 +3,155 @@ title: "Get Column Config" description: "Retrieve the configuration details for a specific column, including source-specific settings." --- -# Get Column Config - -Retrieve the full configuration for a specific column. The response varies based on the column's source type (e.g., RUN_PROMPT, EVALUATION, EXPERIMENT, OPTIMISATION). - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `column_id` | string (UUID) | Yes | The UUID of the column. | - -## Response - -The response structure depends on the column source type. - -### RUN_PROMPT Column - -```json -{ - "name": "gpt_output", - "model": "gpt-4o", - "messages": [ - { - "role": "system", - "content": "You are a helpful assistant." - }, - { - "role": "user", - "content": "Summarize: {{input}}" - } - ], - "output_format": "string", - "temperature": 0.7, - "frequency_penalty": 0, - "presence_penalty": 0, - "max_tokens": 1024, - "top_p": 1, - "response_format": null, - "tool_choice": null, - "tools": [] -} -``` - -### EVALUATION Column - -```json -{ - "name": "relevance_eval", - "template": "Relevance", - "template_config": {}, - "description": "Evaluates relevance of the response", - "config": {}, - "status": "COMPLETED" -} -``` - -### EXPERIMENT Column - -```json -{ - "name": "experiment_v1", - "prompt_config": {}, - "status": "COMPLETED", - "user_eval_template_ids": [] -} -``` - -## Responses - -### 200 - -Column configuration retrieved successfully. Response fields vary by source type: - -- **RUN_PROMPT**: `name`, `model`, `messages`, `output_format`, `temperature`, `frequency_penalty`, `presence_penalty`, `max_tokens`, `top_p`, `response_format`, `tool_choice`, `tools` -- **EVALUATION**: `name`, `template`, `template_config`, `description`, `config`, `status` -- **EXPERIMENT**: `name`, `prompt_config`, `status`, `user_eval_template_ids` -- **OPTIMISATION**: `name`, `optimize_type`, `optimized_k_prompts`, `messages`, `status`, `model_config`, `user_eval_template_ids` - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Column not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/column-config/{column_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} - -response = requests.get(url, headers=headers) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/column-config/{column_id}/", - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/column-config/{column_id}/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the column whose configuration you want to retrieve. This ID is returned when a column is created and can be retrieved from the column details endpoint. The response structure varies depending on the column's source type. + + + + + The response structure depends on the column's source type. Below are the fields returned for each source type. + + + The human-readable name assigned to the column. Present in all source types. + + + + The identifier of the language model used for prompt execution. Only present for RUN_PROMPT source columns. Examples include `gpt-4o`, `gpt-3.5-turbo`, `claude-3-opus`, etc. + + + + The ordered list of chat messages that define the prompt template sent to the language model. Each message object contains a `role` (such as `system`, `user`, or `assistant`) and `content` (the message text, which may include template variables in double-brace syntax like `{{input}}`). Present for RUN_PROMPT and OPTIMISATION source columns. + + + + The expected output format for the language model response. Common values include `string` for plain text output and `json` for structured JSON output. Only present for RUN_PROMPT source columns. + + + + The sampling temperature parameter used when generating model responses. A value between 0 and 2, where lower values produce more deterministic output and higher values produce more creative output. Only present for RUN_PROMPT source columns. + + + + The frequency penalty parameter applied during model response generation. A value between -2.0 and 2.0 that penalizes new tokens based on their existing frequency in the text so far, reducing the likelihood of repeating the same content. Only present for RUN_PROMPT source columns. + + + + The presence penalty parameter applied during model response generation. A value between -2.0 and 2.0 that penalizes new tokens based on whether they appear in the text so far, encouraging the model to discuss new topics. Only present for RUN_PROMPT source columns. + + + + The maximum number of tokens the model is allowed to generate in a single response. Controls the length of the output. Only present for RUN_PROMPT source columns. + + + + The nucleus sampling parameter. A value between 0 and 1 that controls the cumulative probability threshold for token selection. Lower values make the output more focused and deterministic. Only present for RUN_PROMPT source columns. + + + + An optional structured output format specification for the model response. When set, it constrains the model to produce output matching a specific schema. Can be `null` if no format constraint is applied. Only present for RUN_PROMPT source columns. + + + + Controls which tool (if any) the model should use. Can be `null` if no tool usage is configured. Only present for RUN_PROMPT source columns. + + + + A list of tool definitions available to the model during prompt execution. Each tool describes a function the model can call. Returns an empty array if no tools are configured. Only present for RUN_PROMPT source columns. + + + + The name of the evaluation template used by this column. Only present for EVALUATION source columns. + + + + The configuration parameters specific to the evaluation template. Only present for EVALUATION source columns. + + + + A human-readable description of what the evaluation measures. Only present for EVALUATION source columns. + + + + Additional configuration settings for the evaluation. Only present for EVALUATION source columns. + + + + The current execution status of the column. Values include `COMPLETED`, `RUNNING`, `PENDING`, or `FAILED`. Present for EVALUATION, EXPERIMENT, and OPTIMISATION source columns. + + + + The prompt configuration used for the experiment. Only present for EXPERIMENT source columns. + + + + A list of evaluation template UUIDs linked to this column for automated evaluation. Present for EXPERIMENT and OPTIMISATION source columns. + + + + The type of optimization being performed. Only present for OPTIMISATION source columns. + + + + The number of optimized prompt variations generated. Only present for OPTIMISATION source columns. + + + + The model configuration settings used during optimization, including model name, temperature, and other parameters. Only present for OPTIMISATION source columns. + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified column was not found or does not belong to your organization. Verify that the `column_id` is correct and that you have access to the associated dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/get-column-details.mdx b/src/pages/docs/api/datasets/columns/get-column-details.mdx index 2700b1f6..8ebb6f9c 100644 --- a/src/pages/docs/api/datasets/columns/get-column-details.mdx +++ b/src/pages/docs/api/datasets/columns/get-column-details.mdx @@ -3,130 +3,93 @@ title: "Get Column Details" description: "Retrieve column metadata for a dataset, including column names, types, and IDs." --- -# Get Column Details - -Retrieve the column metadata for a specific dataset. Returns a list of all columns with their IDs, names, and data types. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | - -### Query Parameters - -| Parameter | Type | Required | Default | Description | -|-----------|------|----------|---------|-------------| -| `include_prompt` | boolean | No | `false` | Whether to include RUN_PROMPT source columns. | -| `source` | string | No | - | Filter columns by source type (e.g., `STATIC`, `RUN_PROMPT`, `EVALUATION`). | - -## Response - -Status message. Example: `success`. -Response payload containing column configuration. - -### Example Response - -```json -{ - "message": "success", - "data": { - "column_config": [ - { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "input", - "data_type": "text" - }, - { - "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "name": "expected_output", - "data_type": "text" - } - ] - } -} -``` - -## Responses - -### 200 - -Column details retrieved successfully. Returns an array of column objects. - -- **message**: string — `success` -- **data**: object - - **column_config**: array of objects - - **id**: string (UUID) — Unique column identifier. - - **name**: string — Column name. - - **data_type**: string — Column data type (`text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`). - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/dataset/columns/{dataset_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} -params = { - "include_prompt": True -} - -response = requests.get(url, headers=headers, params=params) -print(response.json()) -``` -```typescript TypeScript -const params = new URLSearchParams({ include_prompt: "true" }); -const response = await fetch( - `https://api.futureagi.com/model-hub/dataset/columns/{dataset_id}/?${params}`, - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" + responseExample={{ + message: "success", + data: { + column_config: [ + { + id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + name: "input", + data_type: "text" + }, + { + id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + name: "expected_output", + data_type: "text" + } + ] } - } -); + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/dataset/columns/{dataset_id}/?include_prompt=true" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset whose column metadata you want to retrieve. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + + + + Whether to include columns with RUN_PROMPT source type in the response. By default, RUN_PROMPT columns are excluded from the results. Set to `true` to include them alongside static and other column types. + + + + Filter the returned columns by their source type. When specified, only columns matching the given source are returned. Common values include `STATIC` for manually created columns, `RUN_PROMPT` for prompt-generated columns, and `EVALUATION` for evaluation metric columns. + + + + + + A status message indicating the result of the request. Returns `success` when the column details are retrieved successfully. + + + + The response payload containing the column configuration for the specified dataset. + + + + An ordered list of column metadata objects representing all columns in the dataset that match the applied filters. Each object provides the essential identifiers and type information for a single column. + + + + The universally unique identifier (UUID) assigned to the column. Use this ID to reference the column in subsequent API calls such as updating column names, changing column types, or deleting columns. + + + The human-readable name of the column as it appears in the dataset grid and throughout the platform. + + + The data type of the column, which determines what kind of values can be stored in it. One of: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify that the `dataset_id` is correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/update-column-name.mdx b/src/pages/docs/api/datasets/columns/update-column-name.mdx index 66729051..32618a0c 100644 --- a/src/pages/docs/api/datasets/columns/update-column-name.mdx +++ b/src/pages/docs/api/datasets/columns/update-column-name.mdx @@ -3,10 +3,6 @@ title: "Update Column Name" description: "Rename an existing column in a dataset." --- -# Update Column Name - -Rename a column in a dataset. The new name must be unique within the dataset. Any derived variable references in run prompt or prompt version configurations are automatically updated. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | -| `column_id` | string (UUID) | Yes | The UUID of the column to rename. | - -## Request Body - - - The new name for the column. Must be unique within the dataset and cannot be empty. - - -### Example - -```json -{ - "new_column_name": "updated_name" -} -``` - -## Response - -Confirmation message. Example: `Column name updated successfully`. - -### Example Response - -```json -{ - "message": "Column name updated successfully" -} -``` - -## Responses - -### 200 - -Column name updated successfully. Any derived variable references are automatically updated. - -### 400 - -Bad request. Possible reasons: - -- **Empty name** — `new_column_name` cannot be empty. -- **Duplicate name** — A column with this name already exists in the dataset. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Column or dataset not found, or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_name/{column_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "new_column_name": "updated_name" -} - -response = requests.put(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_name/{column_id}/", - { - method: "PUT", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - new_column_name: "updated_name" - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X PUT "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_name/{column_id}/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "new_column_name": "updated_name" - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset that contains the column you want to rename. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + The universally unique identifier (UUID) of the column to rename. This ID is returned when a column is created and can be retrieved from the column details endpoint. + + + + + + The new human-readable name to assign to the column. This name is used to identify the column throughout the Future AGI platform, including in the dataset grid, evaluation configurations, and prompt template variable mappings. Must be unique within the dataset and cannot be empty. Any derived variable references in run prompt or prompt version configurations that use the old column name are automatically updated to reflect the new name. + + + + + + A human-readable confirmation message indicating that the column was successfully renamed. Any derived variable references in linked configurations are automatically updated. Typically returns `Column name updated successfully`. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `new_column_name` field is missing or empty; or a column with the same name already exists in the dataset. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified column or dataset was not found, or does not belong to your organization. Verify that both the `dataset_id` and `column_id` are correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/columns/update-column-type.mdx b/src/pages/docs/api/datasets/columns/update-column-type.mdx index 6cd33838..fa1a98eb 100644 --- a/src/pages/docs/api/datasets/columns/update-column-type.mdx +++ b/src/pages/docs/api/datasets/columns/update-column-type.mdx @@ -3,10 +3,6 @@ title: "Update Column Type" description: "Change the data type of an existing column with preview and conversion support." --- -# Update Column Type - -Change the data type of a column in a dataset. Supports a preview mode to validate conversion compatibility before applying changes. Only static columns (without a source) can be converted. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `dataset_id` | string (UUID) | Yes | The UUID of the dataset. | -| `column_id` | string (UUID) | Yes | The UUID of the column. | - -## Request Body - - - Target data type for the column. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. - - - - When `true` (default), returns a preview of the conversion without applying changes. Set to `false` to execute the conversion. - - - - When `true`, forces the conversion even if some values cannot be converted. Default: `false`. - - -### Example (Preview) - -```json -{ - "new_column_type": "number", - "preview": true -} -``` - -### Example (Execute) - -```json -{ - "new_column_type": "number", - "preview": false -} -``` - -## Response - -### Preview Response - -Status message. Example: `success`. -Preview data including invalid counts and sample conversions. - -```json -{ - "message": "success", - "data": { - "invalid_count": 2, - "invalid_values": ["abc", "N/A"], - "valid_conversion_samples": { - "42": 42, - "3.14": 3.14 - }, - "new_data_type": "number" - } -} -``` - -### Execution Response - -```json -{ - "message": "Column type conversion started", - "column_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "new_data_type": "number", - "status": "RUNNING" -} -``` - -## Responses - -### 200 - -- **Preview mode**: Returns conversion compatibility analysis. -- **Execution mode**: Conversion task started asynchronously. - -### 400 - -Bad request. Possible reasons: - -- **Source column** — Columns with a source (e.g., RUN_PROMPT, EVALUATION) cannot be type-converted. -- **Invalid data type** — The provided `new_column_type` is not valid. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Column or dataset not found, or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -# Preview conversion -url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} - -# Step 1: Preview -data = { - "new_column_type": "number", - "preview": True -} -response = requests.put(url, headers=headers, json=data) -print("Preview:", response.json()) - -# Step 2: Execute -data = { - "new_column_type": "number", - "preview": False -} -response = requests.put(url, headers=headers, json=data) -print("Execute:", response.json()) -``` -```typescript TypeScript -const url = "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/"; -const headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -}; - -// Step 1: Preview -const preview = await fetch(url, { - method: "PUT", - headers, - body: JSON.stringify({ new_column_type: "number", preview: true }) -}); -console.log("Preview:", await preview.json()); - -// Step 2: Execute -const execute = await fetch(url, { - method: "PUT", - headers, - body: JSON.stringify({ new_column_type: "number", preview: false }) -}); -console.log("Execute:", await execute.json()); -``` -```bash cURL -# Preview conversion -curl -X PUT "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "new_column_type": "number", - "preview": true - }' - -# Execute conversion -curl -X PUT "https://api.futureagi.com/model-hub/develops/{dataset_id}/update_column_type/{column_id}/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "new_column_type": "number", - "preview": false - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset that contains the column whose type you want to change. This ID is returned when you create a dataset and can be found in the dataset listing or dataset detail endpoints. + + + The universally unique identifier (UUID) of the column to convert. This ID is returned when a column is created and can be retrieved from the column details endpoint. Only static columns (those without a source type) can have their data type changed. + + + + + + The target data type to convert the column to. This determines how existing cell values are interpreted and validated during conversion. Valid values: `text`, `number`, `boolean`, `json`, `image`, `audio`, `pdf`. + + + + Controls whether to preview the conversion or execute it. When set to `true` (the default), the API returns a compatibility analysis showing which values can and cannot be converted, without making any changes. Set to `false` to execute the actual conversion, which runs asynchronously as a background task. + + + + When set to `true`, forces the type conversion even if some cell values cannot be successfully converted to the target type. Inconvertible values may be set to null or a default value. Defaults to `false`, which requires all values to be convertible before proceeding. + + + + + The response structure varies depending on whether the request is in preview mode or execution mode. + + + A human-readable status message. Returns `success` for preview mode results, or `Column type conversion started` when the conversion is initiated in execution mode. + + + + Preview data containing conversion compatibility analysis. Only present in preview mode responses. + + + + The total number of cell values in the column that cannot be converted to the target data type. A count of zero indicates all values are compatible with the target type. + + + A sample list of cell values that cannot be converted to the target data type. Useful for identifying problematic data before executing the conversion. May be truncated for columns with many invalid values. + + + A mapping of sample original values to their converted equivalents, demonstrating how existing data will be transformed. Keys are the original string values and values are the converted representations in the target type. + + + The target data type that was evaluated in the preview. Matches the `new_column_type` value from the request. + + + + + The UUID of the column being converted. Only present in execution mode responses. + + + + The target data type the column is being converted to. Only present in execution mode responses. + + + + The current status of the conversion task. Returns `RUNNING` when the conversion has been initiated. Only present in execution mode responses. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the column has a source type (such as RUN_PROMPT or EVALUATION) and is not a static column; the provided `new_column_type` is not one of the supported data type values; or the conversion cannot proceed because too many values are incompatible and `force_update` is not enabled. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified column or dataset was not found, or does not belong to your organization. Verify that both the `dataset_id` and `column_id` are correct and that you have access to the dataset. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx b/src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx index 0eac73de..a7d0ff08 100644 --- a/src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx +++ b/src/pages/docs/api/datasets/create-dataset-from-huggingface.mdx @@ -3,15 +3,10 @@ title: "Create Dataset from HuggingFace" description: "Create a new dataset by importing data from a HuggingFace dataset." --- -# Create Dataset from HuggingFace - -Create a new dataset by importing data from a HuggingFace dataset. The dataset is processed in the background after creation. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - HuggingFace dataset path (e.g., `squad`, `glue`, `username/dataset-name`). - - - - Dataset configuration/subset name (e.g., `plain_text`, `mnli`). - - - - Dataset split to import (e.g., `train`, `test`, `validation`). - - - - Name for the dataset. If not provided, defaults to the HuggingFace dataset name with `/` replaced by `_`. Must be unique within your organization. - - - - Model type for the dataset (e.g., `GenerativeLLM`). - - - - Maximum number of rows to import. If not provided, all rows from the split are imported. - - -### Example - -```json -{ - "huggingface_dataset_name": "squad", - "huggingface_dataset_config": "plain_text", - "huggingface_dataset_split": "train", - "name": "My HuggingFace Dataset", - "num_rows": 100 -} -``` - -## Response - -Returns the created dataset details. Data import is processed in the background. - -Confirmation message. -UUID of the newly created dataset. -Name of the created dataset. -Model type of the created dataset. - -### Example Response - -```json -{ - "message": "Dataset creation started successfully. Please check in some time", - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "dataset_name": "My HuggingFace Dataset", - "dataset_model_type": "GenerativeLLM" -} -``` - -## Responses - -### 200 - -Dataset creation started. Data is being imported from HuggingFace in the background. - -### 400 - -Bad request. Possible reasons: - -- **Invalid dataset** - The HuggingFace dataset could not be found or accessed. -- **Invalid config/split** - The specified configuration or split does not exist. -- **Duplicate name** - A dataset with this name already exists in your organization. -- **Invalid num_rows** - Must be a non-negative integer. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 429 - -Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/create-dataset-from-huggingface/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "huggingface_dataset_name": "squad", - "huggingface_dataset_config": "plain_text", - "huggingface_dataset_split": "train", - "name": "My HuggingFace Dataset", - "num_rows": 100 -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/create-dataset-from-huggingface/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - huggingface_dataset_name: "squad", - huggingface_dataset_config: "plain_text", - huggingface_dataset_split: "train", - name: "My HuggingFace Dataset", - num_rows: 100 - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/create-dataset-from-huggingface/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "huggingface_dataset_name": "squad", - "huggingface_dataset_config": "plain_text", - "huggingface_dataset_split": "train", - "name": "My HuggingFace Dataset", - "num_rows": 100 - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The fully qualified path of the HuggingFace dataset to import. This can be a public dataset name such as `squad` or `glue`, or a user-scoped dataset in the format `username/dataset-name`. The dataset must be publicly accessible or accessible with the configured HuggingFace credentials. + + + + The specific configuration or subset of the HuggingFace dataset to import. Many HuggingFace datasets contain multiple configurations (e.g., `plain_text` for SQuAD, `mnli` for GLUE). If the dataset has only one configuration, this field can be omitted. + + + + The data split to import from the HuggingFace dataset. Common values include `train`, `test`, and `validation`. If not specified, the default split for the dataset is used. Only one split can be imported per request. + + + + The human-readable name to assign to the newly created dataset in Future AGI. If not provided, the name defaults to the HuggingFace dataset name with any `/` characters replaced by `_`. Must be unique within your organization. + + + + The model type classification for the dataset, which determines how the dataset is categorized and which evaluation templates are available. For example, `GenerativeLLM` indicates the dataset is intended for use with generative large language model evaluations. + + + + The maximum number of rows to import from the HuggingFace dataset split. Use this to limit the import size when working with large datasets. If not provided, all available rows from the specified split are imported. + + + + + + A human-readable confirmation message indicating that the dataset creation process has been initiated. Since data import from HuggingFace is processed asynchronously in the background, this message confirms the job was queued successfully. Typically returns `Dataset creation started successfully. Please check in some time`. + + + + The universally unique identifier (UUID) assigned to the newly created dataset. Use this ID to check the status of the import or reference the dataset in subsequent API calls once processing is complete. + + + + The name assigned to the created dataset, either matching the `name` value provided in the request body or the auto-generated name derived from the HuggingFace dataset path. + + + + The model type classification assigned to the dataset. This reflects the `model_type` value from the request, or the system default if none was specified. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the HuggingFace dataset could not be found or accessed; the specified configuration or split does not exist for the given dataset; a dataset with the same name already exists in your organization; or the `num_rows` value is not a valid non-negative integer. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. Contact support or upgrade your plan to increase limits. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/create-dataset.mdx b/src/pages/docs/api/datasets/create-dataset.mdx index 3ca48db3..7c5f9c4e 100644 --- a/src/pages/docs/api/datasets/create-dataset.mdx +++ b/src/pages/docs/api/datasets/create-dataset.mdx @@ -3,153 +3,80 @@ title: "Create Dataset" description: "Create a new dataset with rows and columns in your organization." --- -# Create Dataset - -Create a new dataset with a specified number of rows and columns for evaluation, testing, or data management. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - Name for the dataset. Must be unique within your organization. Maximum 2000 characters. - - - - Number of rows to create. Must be between 1 and 100. - - - - Number of columns to create. Must be between 1 and 100. Columns are created with default names (`Column 1`, `Column 2`, etc.) and `text` data type. - - -### Example - -```json -{ - "dataset_name": "My Evaluation Dataset", - "number_of_rows": 10, - "number_of_columns": 3 -} -``` - -## Response - -Returns the created dataset details. - -Confirmation message. Example: `Dataset created successfully`. -UUID of the newly created dataset. -Number of rows created in the dataset. -Number of columns created in the dataset. - -### Example Response - -```json -{ - "message": "Dataset created successfully", - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "rows_created": 10, - "columns_created": 3 -} -``` - -## Responses - -### 200 - -Dataset created successfully. Returns the dataset ID, rows created, and columns created. - -### 400 - -Bad request. Possible reasons: - -- **Missing dataset name** - `dataset_name` is required. -- **Duplicate name** - A dataset with this name already exists in your organization. -- **Invalid row or column count** - `number_of_rows` and `number_of_columns` must be positive integers between 1 and 100. -- **Invalid number format** - The provided values are not valid integers. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 429 - -Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. - -### 500 - -Internal server error. Failed to create the dataset. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/create-dataset-manually/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "dataset_name": "My Evaluation Dataset", - "number_of_rows": 10, - "number_of_columns": 3 -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/create-dataset-manually/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - dataset_name: "My Evaluation Dataset", - number_of_rows: 10, - number_of_columns: 3 - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/create-dataset-manually/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "dataset_name": "My Evaluation Dataset", - "number_of_rows": 10, - "number_of_columns": 3 - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The human-readable name to assign to the newly created dataset. This name is used to identify the dataset throughout the Future AGI platform, including in the dashboard, experiment configurations, and evaluation pipelines. Must be unique within your organization. Maximum 2000 characters. + + + + The number of empty rows to initialize in the dataset upon creation. Each row represents a single data point that can later be populated with values for each column. Must be a positive integer between 1 and 100. + + + + The number of columns to create in the dataset schema. Each column is initialized with a sequentially generated default name (`Column 1`, `Column 2`, etc.) and a `text` data type. You can rename columns and change their types after creation. Must be a positive integer between 1 and 100. + + + + + + A human-readable confirmation message indicating that the dataset was created successfully. Typically returns `Dataset created successfully`. + + + + The universally unique identifier (UUID) assigned to the newly created dataset. Use this ID to reference the dataset in subsequent API calls such as updating, cloning, or deleting the dataset. + + + + The total number of rows that were successfully created in the dataset. This value matches the `number_of_rows` parameter from the request. + + + + The total number of columns that were successfully created in the dataset schema. This value matches the `number_of_columns` parameter from the request. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `dataset_name` field is missing or empty; a dataset with the same name already exists in your organization; `number_of_rows` or `number_of_columns` is outside the allowed range of 1 to 100; or the provided values are not valid integers. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. Contact support or upgrade your plan to increase limits. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/create-empty-dataset.mdx b/src/pages/docs/api/datasets/create-empty-dataset.mdx index 37e74195..53695c50 100644 --- a/src/pages/docs/api/datasets/create-empty-dataset.mdx +++ b/src/pages/docs/api/datasets/create-empty-dataset.mdx @@ -3,150 +3,80 @@ title: "Create Empty Dataset" description: "Create a new empty dataset with optional pre-created rows." --- -# Create Empty Dataset - -Create a new empty dataset. Optionally pre-populate with a small number of empty rows. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - Name for the dataset. Must be unique within your organization. - - - - Model type for the dataset (e.g., `GenerativeLLM`). - - - - Number of empty rows to pre-create. Maximum: 10. - - -### Example - -```json -{ - "new_dataset_name": "My Empty Dataset", - "model_type": "GenerativeLLM", - "row": 5 -} -``` - -## Response - -Returns the created dataset details. - -Confirmation message. -UUID of the newly created dataset. -Name of the created dataset. -Model type of the created dataset. - -### Example Response - -```json -{ - "message": "Empty dataset created successfully", - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "dataset_name": "My Empty Dataset", - "dataset_model_type": "GenerativeLLM" -} -``` - -## Responses - -### 200 - -Dataset created successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing name** - `new_dataset_name` is required. -- **Duplicate name** - A dataset with this name already exists in your organization. -- **Invalid row count** - `row` must be between 0 and 10. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 429 - -Resource limit reached. Your organization has exceeded the dataset creation quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/create-empty-dataset/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "new_dataset_name": "My Empty Dataset", - "model_type": "GenerativeLLM", - "row": 5 -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/create-empty-dataset/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - new_dataset_name: "My Empty Dataset", - model_type: "GenerativeLLM", - row: 5 - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/create-empty-dataset/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "new_dataset_name": "My Empty Dataset", - "model_type": "GenerativeLLM", - "row": 5 - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The human-readable name to assign to the newly created empty dataset. This name is used to identify the dataset throughout the Future AGI platform, including in the dashboard, experiment configurations, and evaluation pipelines. Must be unique within your organization. + + + + The model type classification for the dataset, which determines how the dataset is categorized and which evaluation templates are available. For example, `GenerativeLLM` indicates the dataset is intended for use with generative large language model evaluations. + + + + The number of empty rows to pre-create in the dataset upon initialization. This allows you to scaffold the dataset structure before populating data. Must be between 0 and 10. If omitted, no rows are created and the dataset starts completely empty. + + + + + + A human-readable confirmation message indicating that the empty dataset was created successfully. Typically returns `Empty dataset created successfully`. + + + + The universally unique identifier (UUID) assigned to the newly created dataset. Use this ID to reference the dataset in subsequent API calls such as adding rows, adding columns, or running evaluations. + + + + The name of the created dataset, matching the `new_dataset_name` value provided in the request body. + + + + The model type classification assigned to the dataset. This reflects the `model_type` value from the request, or the system default if none was specified. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `new_dataset_name` field is missing or empty; a dataset with the same name already exists in your organization; or the `row` value exceeds the maximum of 10. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + Resource limit reached. Your organization has exceeded the dataset creation quota. Contact support or upgrade your plan to increase limits. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/delete-dataset.mdx b/src/pages/docs/api/datasets/delete-dataset.mdx index 22910d33..48951485 100644 --- a/src/pages/docs/api/datasets/delete-dataset.mdx +++ b/src/pages/docs/api/datasets/delete-dataset.mdx @@ -3,133 +3,60 @@ title: "Delete Dataset" description: "Delete one or more datasets by their IDs." --- -# Delete Dataset - -Delete one or more datasets. This is a soft delete operation. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - Array of dataset UUIDs to delete. Must contain at least 1 and at most 50 items. All IDs must be valid UUIDs. - - -### Example - -```json -{ - "dataset_ids": [ - "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "b2c3d4e5-f6a7-8901-bcde-f12345678901" - ] -} -``` - -## Response - -Returns confirmation of deleted datasets. - -Confirmation message with count of deleted datasets. -Status indicator. Example: `success`. - -### Example Response - -```json -{ - "data": "2 datasets deleted successfully", - "status": "success" -} -``` - -## Responses - -### 200 - -Datasets deleted successfully. - -### 400 - -Bad request. Possible reasons: - -- **Empty list** - `dataset_ids` must contain at least one ID. -- **Too many IDs** - Maximum of 50 dataset IDs per request. -- **Invalid UUID** - One or more IDs are not valid UUIDs. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -One or more datasets not found in your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/delete_dataset/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "dataset_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"] -} - -response = requests.delete(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/delete_dataset/", - { - method: "DELETE", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - dataset_ids: ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"] - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X DELETE "https://api.futureagi.com/model-hub/develops/delete_dataset/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "dataset_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"] - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + An array of universally unique identifiers (UUIDs) specifying the datasets to delete. This endpoint performs a soft delete, meaning the datasets are marked as deleted but may be recoverable within a retention window. Must contain at least 1 and at most 50 valid UUID strings. All specified datasets must belong to your organization. + + + + + + A human-readable confirmation message indicating how many datasets were successfully deleted. For example, `2 datasets deleted successfully`. + + + + The status of the API response. Returns `success` when all specified datasets were deleted without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `dataset_ids` array is empty; the array contains more than 50 entries; or one or more values are not valid UUID strings. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + One or more of the specified dataset IDs could not be found in your organization. Verify that all UUIDs are correct and that the datasets have not already been deleted. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/delete-rows.mdx b/src/pages/docs/api/datasets/delete-rows.mdx index 4a633423..db77c0bf 100644 --- a/src/pages/docs/api/datasets/delete-rows.mdx +++ b/src/pages/docs/api/datasets/delete-rows.mdx @@ -3,10 +3,6 @@ title: "Delete Rows" description: "Delete one or more rows from a dataset." --- -# Delete Rows - -Delete specific rows from a dataset by their IDs, or delete all rows. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the dataset containing the rows to delete. - - -## Request Body - - - Array of row UUIDs to delete. Required if `selected_all_rows` is `false`. - - - - Set to `true` to delete all rows in the dataset. When `true`, `row_ids` is ignored. Default: `false`. - - -### Example - -```json -{ - "row_ids": [ - "row-uuid-1", - "row-uuid-2" - ], - "selected_all_rows": false -} -``` - -## Response - -Returns confirmation of deleted rows. - -Confirmation message. -Status indicator. Example: `success`. - -### Example Response - -```json -{ - "data": "Row deleted successfully", - "status": "success" -} -``` - -## Responses - -### 200 - -Rows deleted successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing rows** - Either `row_ids` or `selected_all_rows` must be provided. -- **No matching rows** - The provided row IDs do not exist in the dataset. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_row/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "row_ids": ["row-uuid-1", "row-uuid-2"], - "selected_all_rows": False -} - -response = requests.delete(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_row/", - { - method: "DELETE", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - row_ids: ["row-uuid-1", "row-uuid-2"], - selected_all_rows: false - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X DELETE "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/delete_row/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "row_ids": ["row-uuid-1", "row-uuid-2"], - "selected_all_rows": false - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset from which rows will be deleted. The dataset must exist within your organization. + + + + + + An array of row UUIDs to delete from the dataset. Each entry must be a valid UUID string corresponding to an existing row in the specified dataset. This field is required when `selected_all_rows` is set to `false` or is omitted. The rows will be permanently removed and cannot be recovered. + + + A boolean flag that, when set to `true`, instructs the API to delete every row in the dataset, effectively clearing all data while preserving the dataset structure and columns. Defaults to `false`. When set to `true`, the `row_ids` field is ignored. + + + + + + A human-readable confirmation message indicating the rows were successfully deleted, such as `"Row deleted successfully"`. + + + Indicates the outcome of the API request. Returns `"success"` when the row deletion completes without errors. + + + + + + The request could not be processed. Possible reasons include: neither `row_ids` nor `selected_all_rows` was provided, or the provided row IDs do not match any existing rows in the dataset. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The specified dataset could not be found. Confirm that the dataset UUID is valid and belongs to your organization. + + + An unexpected error occurred on the server while deleting the rows. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/duplicate-dataset.mdx b/src/pages/docs/api/datasets/duplicate-dataset.mdx index 607a8132..0dc278d4 100644 --- a/src/pages/docs/api/datasets/duplicate-dataset.mdx +++ b/src/pages/docs/api/datasets/duplicate-dataset.mdx @@ -3,164 +3,105 @@ title: "Duplicate Dataset" description: "Create a new dataset from selected rows of an existing dataset." --- -# Duplicate Dataset - -Create a new dataset by duplicating an existing dataset. Optionally select specific rows to include. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the source dataset to duplicate. - - -## Request Body - - - Name for the new dataset. Must be unique within your organization. - - - - Array of row UUIDs to include in the new dataset. If not provided, all rows are included. - - - - Set to `true` to include all rows. Default: `false`. - - -### Example - -```json -{ - "name": "Duplicated Dataset", - "row_ids": ["row-uuid-1", "row-uuid-2"], - "selected_all_rows": false -} -``` - -## Response - -Returns the new dataset details. - -Confirmation message. -UUID of the newly created dataset. -Name of the new dataset. -Number of columns copied. -Number of rows copied. - -### Example Response - -```json -{ - "data": { - "message": "Dataset duplicated successfully", - "new_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "new_dataset_name": "Duplicated Dataset", - "columns_copied": 5, - "rows_copied": 100 - }, - "status": "success" -} -``` - -## Responses - -### 200 - -Dataset duplicated successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing name** - The `name` field is required. -- **Duplicate name** - A dataset with this name already exists. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Source dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "name": "Duplicated Dataset", - "selected_all_rows": True -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" + responseExample={{ + data: { + message: "Dataset duplicated successfully", + new_dataset_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + new_dataset_name: "Duplicated Dataset", + columns_copied: 5, + rows_copied: 100 }, - body: JSON.stringify({ - name: "Duplicated Dataset", - selected_all_rows: true - }) - } -); + status: "success" + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "Duplicated Dataset", - "selected_all_rows": true - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the source dataset to duplicate. The duplicate operation copies the dataset schema and selected rows into a new, independent dataset. + + + + + + The human-readable name to assign to the newly duplicated dataset. This name is used to identify the dataset throughout the Future AGI platform, including in the dashboard, experiment configurations, and evaluation pipelines. Must be unique within your organization. + + + + An array of row UUIDs specifying which individual rows from the source dataset to include in the duplicated dataset. Use this parameter for selective duplication when you only need a subset of the source data. If not provided and `selected_all_rows` is `false`, no rows are copied. + + + + A flag indicating whether to include all rows from the source dataset in the duplicate. When set to `true`, every row in the source dataset is copied regardless of the `row_ids` parameter. Defaults to `false` if not specified. + + + + + + The top-level data wrapper containing details about the newly created duplicate dataset. + + + + A human-readable confirmation message indicating that the dataset was duplicated successfully. Typically returns `Dataset duplicated successfully`. + + + The universally unique identifier (UUID) assigned to the newly duplicated dataset. Use this ID to reference the dataset in subsequent API calls. + + + The name assigned to the duplicated dataset, matching the `name` value provided in the request body. + + + The total number of columns that were copied from the source dataset into the new duplicate dataset. + + + The total number of rows that were copied from the source dataset into the new duplicate dataset. This reflects either the count of specified `row_ids` or the total row count if `selected_all_rows` was `true`. + + + + + The status of the API response. Returns `success` when the duplication was completed without errors. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `name` field is missing or empty; or a dataset with the same name already exists in your organization. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The source dataset could not be found. The provided ID does not match any dataset in your organization. Verify the dataset UUID is correct and that the dataset has not been deleted. + + + + Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. Contact support or upgrade your plan to increase limits. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/duplicate-rows.mdx b/src/pages/docs/api/datasets/duplicate-rows.mdx index fb6fbd66..53b4e7f9 100644 --- a/src/pages/docs/api/datasets/duplicate-rows.mdx +++ b/src/pages/docs/api/datasets/duplicate-rows.mdx @@ -3,10 +3,6 @@ title: "Duplicate Rows" description: "Create copies of specific rows within a dataset." --- -# Duplicate Rows - -Create one or more copies of selected rows within the same dataset. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the dataset containing the rows to duplicate. - - -## Request Body - - - Array of row UUIDs to duplicate. Required if `selected_all_rows` is `false`. - - - - Set to `true` to duplicate all rows. Default: `false`. - - - - Number of copies to create per row. Must be a positive integer. Default: `1`. - - -### Example - -```json -{ - "row_ids": ["row-uuid-1", "row-uuid-2"], - "num_copies": 2 -} -``` - -## Response - -Returns details of the duplication. - -Confirmation message. -Number of source rows duplicated. -Number of copies created per row. -Total number of new rows created. -Array of UUIDs for the newly created rows. - -### Example Response - -```json -{ - "data": { - "message": "Rows duplicated successfully", - "source_rows": 2, - "copies_per_row": 2, - "total_new_rows": 4, - "new_row_ids": ["new-row-1", "new-row-2", "new-row-3", "new-row-4"] - }, - "status": "success" -} -``` - -## Responses - -### 200 - -Rows duplicated successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing rows** - Either `row_ids` or `selected_all_rows` must be provided. -- **Invalid num_copies** - Must be a positive integer. -- **No matching rows** - The provided row IDs do not exist in the dataset. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate-rows/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "row_ids": ["row-uuid-1", "row-uuid-2"], - "num_copies": 2 -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate-rows/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" + responseExample={{ + data: { + message: "Rows duplicated successfully", + source_rows: 2, + copies_per_row: 1, + total_new_rows: 2, + new_row_ids: ["new-row-1", "new-row-2"] }, - body: JSON.stringify({ - row_ids: ["row-uuid-1", "row-uuid-2"], - num_copies: 2 - }) - } -); + status: "success" + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate-rows/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "row_ids": ["row-uuid-1", "row-uuid-2"], - "num_copies": 2 - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset containing the rows you want to duplicate. The dataset must exist within your organization. The newly created duplicate rows will be appended to the same dataset. + + + + + + An array of row UUIDs to duplicate within the dataset. Each entry must be a valid UUID string corresponding to an existing row. This field is required when `selected_all_rows` is set to `false` or is omitted. Each specified row will be copied the number of times defined by `num_copies`. + + + A boolean flag that, when set to `true`, instructs the API to duplicate every row in the dataset. Defaults to `false`. When set to `true`, the `row_ids` field is ignored and all rows are used as the source for duplication. + + + The number of copies to create for each source row. Must be a positive integer. Defaults to `1`. For example, if you specify 3 row IDs and set `num_copies` to 2, a total of 6 new rows will be created. + + + + + + The response payload containing details about the completed row duplication operation. + + + + A human-readable confirmation message indicating the rows were duplicated successfully, such as `"Rows duplicated successfully"`. + + + The number of original source rows that were used as the basis for duplication. + + + The number of copies that were created for each source row, corresponding to the `num_copies` value from the request. + + + The total number of new rows created during this operation, calculated as `source_rows` multiplied by `copies_per_row`. + + + An array of universally unique identifiers (UUIDs) for each newly created duplicate row. These IDs can be used to reference the new rows in subsequent API calls such as updating cell values or deleting rows. + + + + Indicates the outcome of the API request. Returns `"success"` when the row duplication completes without errors. + + + + + + The request could not be processed. Possible reasons include: neither `row_ids` nor `selected_all_rows` was provided, `num_copies` is not a positive integer, or the provided row IDs do not match any existing rows in the dataset. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The specified dataset could not be found. Confirm that the dataset UUID is valid and belongs to your organization. + + + Resource limit reached. Your organization has exceeded the row addition quota. Contact support or wait before retrying. + + + An unexpected error occurred on the server while duplicating the rows. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/get-dataset.mdx b/src/pages/docs/api/datasets/get-dataset.mdx index 268a0e1d..8db41f3b 100644 --- a/src/pages/docs/api/datasets/get-dataset.mdx +++ b/src/pages/docs/api/datasets/get-dataset.mdx @@ -3,120 +3,98 @@ title: "Get Dataset" description: "Retrieve details of a specific dataset by ID." --- -# Get Dataset - -Retrieve details of a specific dataset including its name, columns, row count, and metadata. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the dataset to retrieve. - - -## Response - -Returns the dataset details. - -UUID of the dataset. -Name of the dataset. -List of column objects, each containing `id`, `name`, and `data_type`. -Total number of rows in the dataset. -ISO 8601 timestamp of when the dataset was created. -Type of the dataset. - -### Example Response - -```json -{ - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "My Evaluation Dataset", - "columns": [ - { - "id": "col-uuid-1", - "name": "input", - "data_type": "text" - }, - { - "id": "col-uuid-2", - "name": "expected_output", - "data_type": "text" - } - ], - "number_of_datapoints": 150, - "created_at": "2025-01-15T10:30:00Z", - "dataset_type": "GenerativeLLM" -} -``` - -## Responses - -### 200 - -Dataset retrieved successfully. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found. The provided ID does not match any dataset in your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} - -response = requests.get(url, headers=headers) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/", - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset to retrieve. This ID is returned when a dataset is created and can also be found by listing all datasets in your organization. + + + + + + The universally unique identifier (UUID) of the dataset. + + + + The human-readable name of the dataset as it appears in the Future AGI dashboard and throughout the platform. + + + + An array of column definition objects describing the schema of the dataset. Each object represents a single column with its identifier, display name, and data type. + + + + The unique identifier for the column within the dataset. + + + The human-readable display name of the column, such as `input`, `expected_output`, or a custom name you assigned. + + + The data type of the column, indicating how values in this column are stored and validated. Common types include `text`, `number`, and `boolean`. + + + + + The total number of data rows currently stored in the dataset. + + + + The ISO 8601 formatted timestamp indicating when the dataset was originally created. + + + + The model type classification of the dataset, such as `GenerativeLLM`, indicating the intended use case for evaluations and experiments. + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset could not be found. The provided ID does not match any dataset in your organization. Verify the dataset UUID is correct and that the dataset has not been deleted. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/list-datasets.mdx b/src/pages/docs/api/datasets/list-datasets.mdx index e3b00a03..b3e4722c 100644 --- a/src/pages/docs/api/datasets/list-datasets.mdx +++ b/src/pages/docs/api/datasets/list-datasets.mdx @@ -3,148 +3,119 @@ title: "List Datasets" description: "Retrieve a paginated list of datasets in your organization." --- -# List Datasets - -Retrieve a paginated list of datasets with optional search and sorting. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Query Parameters - - - Page number (zero-indexed). Default: `0`. - - - - Number of items per page. Must be between 1 and 100. Default: `10`. - - - - Case-insensitive search filter by dataset name. - - - - JSON array of sort objects. Each object contains: - - `column_id` - One of: `name`, `numberOfDatapoints`, `numberOfExperiments`, `numberOfOptimisations`, `derivedDatasets`, `createdAt` - - `type` - `ascending` or `descending` - - -## Response - -Returns a paginated list of datasets. - - - Array of dataset objects, each containing: - - `id` (string) - Dataset UUID - - `name` (string) - Dataset name - - `number_of_datapoints` (integer) - Number of rows - - `number_of_experiments` (integer) - Number of linked experiments - - `number_of_optimisations` (integer) - Number of linked optimisations - - `derived_datasets` (integer) - Number of derived datasets - - `created_at` (string) - Creation timestamp in `YYYY-MM-DD HH:MM` format - - `dataset_type` (string) - Type of the dataset - -Total number of pages. -Total number of datasets matching the query. - -### Example Response - -```json -{ - "data": { - "datasets": [ - { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "My Evaluation Dataset", - "number_of_datapoints": 150, - "number_of_experiments": 3, - "number_of_optimisations": 1, - "derived_datasets": 0, - "created_at": "2025-01-15 10:30", - "dataset_type": "GenerativeLLM" - } - ], - "total_pages": 5, - "total_count": 42 - }, - "status": "success" -} -``` - -## Responses - -### 200 - -Datasets listed successfully. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/get-datasets/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} -params = { - "page": 0, - "page_size": 10, - "search_text": "evaluation" -} - -response = requests.get(url, headers=headers, params=params) -print(response.json()) -``` -```typescript TypeScript -const params = new URLSearchParams({ - page: "0", - page_size: "10", - search_text: "evaluation" -}); - -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/get-datasets/?${params}`, - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/develops/get-datasets/?page=0&page_size=10&search_text=evaluation" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The zero-indexed page number to retrieve from the paginated result set. The first page is `0`, the second page is `1`, and so on. Defaults to `0` if not specified. + + + + The maximum number of dataset records to return per page. Must be a positive integer between 1 and 100. Defaults to `10` if not specified. Use larger values to reduce the number of paginated requests needed to retrieve all datasets. + + + + A case-insensitive text filter applied to dataset names. Only datasets whose names contain the specified substring are included in the results. Useful for quickly finding datasets by partial name match. + + + + A JSON-encoded array of sort objects that control the ordering of results. Each sort object must contain a `column_id` field (one of `name`, `numberOfDatapoints`, `numberOfExperiments`, `numberOfOptimisations`, `derivedDatasets`, `createdAt`) and a `type` field (`ascending` or `descending`). Multiple sort objects can be provided to define multi-level sorting. + + + + + + The top-level data wrapper containing the paginated dataset listing and metadata. + + + + An array of dataset summary objects representing the datasets that match the query criteria for the current page. + + + + The universally unique identifier (UUID) of the dataset. Use this ID to reference the dataset in other API calls. + + + The human-readable name of the dataset as it appears in the Future AGI dashboard and throughout the platform. + + + The total number of data rows currently stored in the dataset. + + + The number of experiments that have been linked to or run against this dataset. + + + The number of optimization runs that have been linked to or executed against this dataset. + + + The number of datasets that have been derived (cloned or duplicated) from this dataset. + + + The timestamp indicating when the dataset was created, formatted as `YYYY-MM-DD HH:MM`. + + + The model type classification of the dataset, such as `GenerativeLLM`, indicating the intended use case. + + + + The total number of pages available given the current `page_size` and the total number of matching datasets. + + + The total number of datasets in your organization that match the applied search and filter criteria. + + + + + The status of the API response. Returns `success` when the request was processed without errors. + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/merge-dataset.mdx b/src/pages/docs/api/datasets/merge-dataset.mdx index 6cb50b9a..07b5b26e 100644 --- a/src/pages/docs/api/datasets/merge-dataset.mdx +++ b/src/pages/docs/api/datasets/merge-dataset.mdx @@ -3,10 +3,6 @@ title: "Merge Dataset" description: "Merge rows from one dataset into another dataset." --- -# Merge Dataset - -Merge rows from a source dataset into a target dataset. Columns are matched by name and data type. New columns are created in the target for any unmatched source columns. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the source dataset to merge rows from. - - -## Request Body - - - UUID of the target dataset to merge rows into. Cannot be the same as the source dataset. - - - - Array of row UUIDs from the source dataset to merge. If not provided, all rows are merged. - - - - Set to `true` to merge all rows from the source dataset. Default: `false`. - - -### Example - -```json -{ - "target_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "row_ids": ["row-uuid-1", "row-uuid-2"], - "selected_all_rows": false -} -``` - -## Response - -Returns details of the merge operation. - -Confirmation message. -Number of rows merged into the target dataset. -Number of new columns created in the target dataset for unmatched source columns. - -### Example Response - -```json -{ - "data": { - "message": "Dataset merged successfully", - "rows_merged": 50, - "new_columns_created": 2 - }, - "status": "success" -} -``` - -## Responses - -### 200 - -Datasets merged successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing target** - `target_dataset_id` is required. -- **Same dataset** - Source and target datasets cannot be the same. -- **No rows** - No rows to merge from the source dataset. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Source or target dataset not found. - -### 429 - -Resource limit reached. Your organization has exceeded the row addition quota. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/merge/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "target_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "selected_all_rows": True -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/merge/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" + responseExample={{ + data: { + message: "Dataset merged successfully", + rows_merged: 50, + new_columns_created: 2 }, - body: JSON.stringify({ - target_dataset_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", - selected_all_rows: true - }) - } -); + status: "success" + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890/merge/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "target_dataset_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "selected_all_rows": true - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the source dataset whose rows you want to merge into another dataset. This dataset must exist within your organization and contain at least one row. + + + + + + The universally unique identifier (UUID) of the destination dataset that will receive the merged rows. Columns are matched by name and data type between the source and target datasets. Any source columns that do not have a matching column in the target dataset will be automatically created. This value cannot be the same as the source dataset ID. + + + An array of row UUIDs from the source dataset that you want to merge into the target. Each entry must be a valid UUID string corresponding to an existing row in the source dataset. If this field is omitted, the merge operation will include all rows from the source dataset. + + + A boolean flag that, when set to `true`, instructs the API to merge every row from the source dataset into the target dataset, regardless of whether `row_ids` is provided. Defaults to `false`. When `true`, the `row_ids` field is ignored. + + + + + + The response payload containing details about the completed merge operation. + + + + A human-readable confirmation message indicating the merge completed successfully, such as `"Dataset merged successfully"`. + + + The total number of rows that were successfully copied from the source dataset into the target dataset during this merge operation. + + + The number of new columns that were created in the target dataset to accommodate source columns that did not have a matching column by name and data type. + + + + Indicates the outcome of the API request. Returns `"success"` when the merge operation completes without errors. + + + + + + The request could not be processed. Possible reasons include: `target_dataset_id` is missing or invalid, the source and target datasets are the same, or the source dataset contains no rows to merge. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The source or target dataset could not be found. Confirm that both dataset UUIDs are valid and belong to your organization. + + + Resource limit reached. Your organization has exceeded the row addition quota. Contact support or wait before retrying. + + + An unexpected error occurred on the server while processing the merge operation. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx b/src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx index 5147f8c5..1e67f8d8 100644 --- a/src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx +++ b/src/pages/docs/api/datasets/run-prompt/add-run-prompt-column.mdx @@ -3,15 +3,10 @@ title: "Add Run Prompt Column" description: "Add a new run prompt column to a dataset that generates LLM responses for each row." --- -# Add Run Prompt Column - -Add a new run prompt column to a dataset. This creates a column that executes an LLM prompt for each row, populating cells with the model's responses. The prompt can reference other column values using template variables. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - The UUID of the dataset to add the column to. - - - - Name for the new column. Must be unique within the dataset. Minimum 1 character. - - - - Prompt configuration object. - - -### Config Object - - - The model to use (e.g., `gpt-4o`, `gpt-4o-mini`, `claude-3-5-sonnet`). - - - - Array of message objects defining the prompt. Use `{{column_name}}` syntax to reference column values. - - - - Output format. Values: `string` (default), `audio`, `json`. - - - - Sampling temperature (0-2). Default: `1`. - - - - Maximum tokens in the response. - - - - Nucleus sampling parameter (0-1). Default: `1`. - - - - Frequency penalty (-2 to 2). Default: `0`. - - - - Presence penalty (-2 to 2). Default: `0`. - - - - Response format constraint (e.g., `json_object`). - - - - Tool selection strategy (e.g., `auto`, `none`, `required`). - - - - Array of tool definitions. Each tool has `id`, `name`, and `config`. - - - - Number of concurrent requests. Controls how many rows are processed simultaneously. - - -### Example - -```json -{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "gpt_response", - "config": { - "model": "gpt-4o", - "messages": [ - { - "role": "system", - "content": "You are a helpful assistant." - }, - { - "role": "user", - "content": "Summarize the following text:\n\n{{input}}" - } - ], - "output_format": "string", - "temperature": 0.7, - "max_tokens": 1024, - "top_p": 1, - "frequency_penalty": 0, - "presence_penalty": 0 - } -} -``` - -## Response - -Confirmation message. Example: `Run prompt column added successfully`. - -### Example Response - -```json -{ - "message": "Run prompt column added successfully" -} -``` - -## Responses - -### 200 - -Column created and prompt execution started. Rows are processed asynchronously in the background. - -### 400 - -Bad request. Possible reasons: - -- **Missing dataset_id** — `dataset_id` is required. -- **Missing name** — Column `name` is required and must be at least 1 character. -- **Duplicate name** — A column with this name already exists in the dataset. -- **Invalid config** — The prompt configuration is invalid. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/add_run_prompt_column/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "gpt_response", - "config": { - "model": "gpt-4o", - "messages": [ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": "Summarize: {{input}}"} - ], - "output_format": "string", - "temperature": 0.7, - "max_tokens": 1024 - } -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/add_run_prompt_column/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - name: "gpt_response", - config: { - model: "gpt-4o", - messages: [ - { role: "system", content: "You are a helpful assistant." }, - { role: "user", content: "Summarize: {{input}}" } - ], - output_format: "string", - temperature: 0.7, - max_tokens: 1024 - } - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/add_run_prompt_column/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "gpt_response", - "config": { - "model": "gpt-4o", - "messages": [ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": "Summarize: {{input}}"} - ], - "output_format": "string", - "temperature": 0.7, - "max_tokens": 1024 - } - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset to which the new run prompt column will be added. The dataset must exist within your organization and be accessible with your current API credentials. + + + + The human-readable name to assign to the new column. This name is displayed in the dataset table and must be unique within the dataset. Minimum length is 1 character. + + + + The prompt configuration object that controls how the LLM generates responses for each row. This object specifies the model, prompt messages, sampling parameters, and output format. + + + + The identifier of the language model to use for generation (e.g., `gpt-4o`, `gpt-4o-mini`, `claude-3-5-sonnet`). This determines which LLM provider and model processes each row in the dataset. + + + + An ordered array of message objects defining the prompt sent to the LLM. Each message has a `role` (e.g., `system`, `user`, `assistant`) and `content` string. Use `{{column_name}}` syntax within content strings to reference values from other columns in the dataset, enabling dynamic per-row prompt generation. + + + + The format of the generated output. Accepted values are `string` (plain text, the default), `audio` (audio output from supported models), and `json` (structured JSON output). + + + + The sampling temperature controlling randomness in the model's output, ranging from `0` (deterministic) to `2` (highly creative). Default is `1`. Lower values produce more focused and consistent responses. + + + + The maximum number of tokens the model is allowed to generate in a single response. Setting this value helps control response length and associated costs. + + + + The nucleus sampling parameter, ranging from `0` to `1`. Only tokens with cumulative probability up to this value are considered during generation. Default is `1`. An alternative to temperature for controlling output diversity. + + + + A penalty applied to tokens based on how frequently they appear in the generated text so far, ranging from `-2` to `2`. Positive values discourage repetition. Default is `0`. + + + + A penalty applied to tokens based on whether they have appeared at all in the generated text so far, ranging from `-2` to `2`. Positive values encourage the model to introduce new topics. Default is `0`. + + + + An optional constraint on the response format returned by the model (e.g., `json_object`). When set, the model is instructed to produce output conforming to the specified format. + + + + The tool selection strategy that governs how the model decides whether to call a tool. Accepted values include `auto` (model decides), `none` (tools disabled), and `required` (model must call a tool). + + + + An array of tool definitions available to the model during generation. Each tool object includes an `id`, `name`, and `config` describing its capabilities. + + + + The number of concurrent requests to execute simultaneously. Controls how many dataset rows are processed in parallel, allowing you to balance throughput against rate limits. + + + + + + + + A human-readable confirmation message indicating that the run prompt column was successfully created and prompt execution has been queued. Rows are processed asynchronously in the background. Typically returns `Run prompt column added successfully`. + + + + + + The request was malformed or contained invalid parameters. This can occur when: `dataset_id` is missing; `name` is missing or shorter than 1 character; a column with the same name already exists in the dataset; or the prompt configuration is invalid. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify the `dataset_id` is correct and that your API credentials have access to the target dataset. + + + + An unexpected error occurred on the server while creating the run prompt column. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx b/src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx index 686b16ac..8fd9faa2 100644 --- a/src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx +++ b/src/pages/docs/api/datasets/run-prompt/edit-run-prompt-column.mdx @@ -3,15 +3,10 @@ title: "Edit Run Prompt Column" description: "Update the configuration of an existing run prompt column and re-execute the prompt." --- -# Edit Run Prompt Column - -Update the configuration of an existing run prompt column. This clears all existing cell values and re-executes the prompt with the new configuration for all rows. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - The UUID of the dataset. - - - - The UUID of the run prompt column to edit. - - - - New name for the column. If not provided, the existing name is kept. - - - - Updated prompt configuration. See [Add Run Prompt Column](/docs/api/datasets/run-prompt/add-run-prompt-column) for the full config schema. - - -### Example - -```json -{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "name": "gpt_response_v2", - "config": { - "model": "gpt-4o-mini", - "messages": [ - { - "role": "user", - "content": "Answer the following question:\n\n{{question}}" - } - ], - "temperature": 0.5, - "max_tokens": 512 - } -} -``` - -## Response - -Confirmation message indicating the column was updated. - -### Example Response - -```json -{ - "message": "Run prompt column updated successfully" -} -``` - -## Responses - -### 200 - -Column updated and prompt re-execution started. All existing cell values are cleared and regenerated asynchronously. - -### 400 - -Bad request. Possible reasons: - -- **Invalid column** — The specified column is not a RUN_PROMPT column. -- **Invalid config** — The prompt configuration is invalid. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset or column not found, or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/edit_run_prompt_column/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "name": "gpt_response_v2", - "config": { - "model": "gpt-4o-mini", - "messages": [ - {"role": "user", "content": "Answer: {{question}}"} - ], - "temperature": 0.5, - "max_tokens": 512 - } -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/edit_run_prompt_column/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - column_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", - name: "gpt_response_v2", - config: { - model: "gpt-4o-mini", - messages: [ - { role: "user", content: "Answer: {{question}}" } - ], - temperature: 0.5, - max_tokens: 512 - } - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/edit_run_prompt_column/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "name": "gpt_response_v2", - "config": { - "model": "gpt-4o-mini", - "messages": [ - {"role": "user", "content": "Answer: {{question}}"} - ], - "temperature": 0.5, - "max_tokens": 512 - } - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset that contains the run prompt column to be edited. The dataset must exist within your organization and be accessible with your current API credentials. + + + + The universally unique identifier (UUID) of the run prompt column to update. The column must be of type `RUN_PROMPT` within the specified dataset. All existing cell values in this column will be cleared and regenerated with the new configuration. + + + + An optional new name for the column. If not provided, the existing column name is retained. The name must be unique within the dataset. + + + + The updated prompt configuration object. Accepts the same structure as the config in [Add Run Prompt Column](/docs/api/datasets/run-prompt/add-run-prompt-column), including `model`, `messages`, `temperature`, `max_tokens`, `top_p`, `frequency_penalty`, `presence_penalty`, `response_format`, `tool_choice`, `tools`, `output_format`, and `concurrency`. Only the fields you provide will be updated. + + + + + + A human-readable confirmation message indicating that the run prompt column configuration was successfully updated and re-execution has been queued. All existing cell values are cleared and regenerated asynchronously in the background. Typically returns `Run prompt column updated successfully`. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the specified column is not a `RUN_PROMPT` column; or the prompt configuration is invalid. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset or column was not found, or does not belong to your organization. Verify that both `dataset_id` and `column_id` are correct and that your API credentials have access to the target resources. + + + + An unexpected error occurred on the server while updating the run prompt column. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/run-prompt/get-column-values.mdx b/src/pages/docs/api/datasets/run-prompt/get-column-values.mdx index 9c72c8b9..ad90fba7 100644 --- a/src/pages/docs/api/datasets/run-prompt/get-column-values.mdx +++ b/src/pages/docs/api/datasets/run-prompt/get-column-values.mdx @@ -3,15 +3,10 @@ title: "Get Column Values" description: "Retrieve sample values from specified columns in a dataset for prompt preview." --- -# Get Column Values - -Retrieve sample values from specified dataset columns. Useful for previewing template variable values before configuring a run prompt column. Returns the first 10 rows of data for each requested column. - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - - - The UUID of the dataset. - - - - A mapping of placeholder names to column UUIDs. Keys are the placeholder names used in prompt templates, values are column UUIDs. - - -### Example - -```json -{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "column_placeholders": { - "input": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "context": "c3d4e5f6-a7b8-9012-cdef-123456789012" - } -} -``` - -## Response - -Status message. Example: `success`. -Column values organized by placeholder name. - -### Example Response - -```json -{ - "message": "success", - "data": { - "result": { - "input": { - "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "column_name": "input", - "values": [ - "What is machine learning?", - "Explain neural networks", - "How does backpropagation work?" - ] - }, - "context": { - "column_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", - "column_name": "context", - "values": [ - "ML textbook chapter 1", - "Deep learning reference", - "Optimization theory notes" - ] + responseExample={{ + message: "success", + data: { + result: { + input: { + column_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901", + column_name: "input", + values: [ + "What is machine learning?", + "Explain neural networks", + "How does backpropagation work?" + ] + }, + context: { + column_id: "c3d4e5f6-a7b8-9012-cdef-123456789012", + column_name: "context", + values: [ + "ML textbook chapter 1", + "Deep learning reference", + "Optimization theory notes" + ] + } } } - } -} -``` - -## Responses - -### 200 - -Column values retrieved successfully. Returns up to 10 sample values per column. - -- **message**: string — `success` -- **data**: object - - **result**: object — Keyed by placeholder name. - - **column_id**: string (UUID) — Column identifier. - - **column_name**: string — Column display name. - - **values**: array — Sample values from the column (up to 10). - -### 400 - -Bad request. Possible reasons: - -- **Missing dataset_id** — `dataset_id` is required. -- **Missing column_placeholders** — `column_placeholders` is required. -- **Invalid column** — One or more column UUIDs do not exist in the dataset. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/get-column-values/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "column_placeholders": { - "input": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "context": "c3d4e5f6-a7b8-9012-cdef-123456789012" - } -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/get-column-values/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - dataset_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - column_placeholders: { - input: "b2c3d4e5-f6a7-8901-bcde-f12345678901", - context: "c3d4e5f6-a7b8-9012-cdef-123456789012" - } - }) - } -); + }} + responseStatus={200} + responseStatusText="OK" +/> -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/get-column-values/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "column_placeholders": { - "input": "b2c3d4e5-f6a7-8901-bcde-f12345678901", - "context": "c3d4e5f6-a7b8-9012-cdef-123456789012" - } - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset from which to retrieve sample column values. The dataset must exist within your organization and be accessible with your current API credentials. + + + + A mapping of placeholder names to column UUIDs. The keys represent the placeholder variable names used in prompt templates (e.g., `input`, `context`), and the values are the UUIDs of the corresponding dataset columns. This allows you to preview what data will be injected into template variables before configuring a run prompt column. + + + + + + A status message indicating the outcome of the request. Returns `success` when column values are retrieved without errors. + + + + The response payload containing the retrieved column values organized by placeholder name. + + + + + An object keyed by placeholder name, where each entry contains the column metadata and sample values. Up to 10 rows of data are returned for each requested column. + + + + + The universally unique identifier (UUID) of the column from which the sample values were retrieved. + + + + The display name of the column in the dataset, as it appears in the table header. + + + + An array of sample values from the column, containing up to 10 entries from the first rows of the dataset. Useful for previewing what data will populate template variables at runtime. + + + + + + + + The request was malformed or contained invalid parameters. This can occur when: `dataset_id` is missing; `column_placeholders` is missing; or one or more column UUIDs do not exist in the specified dataset. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset was not found or does not belong to your organization. Verify the `dataset_id` is correct and that your API credentials have access to the target dataset. + + + + An unexpected error occurred on the server while retrieving column values. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx b/src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx index 6f6a88cf..3140a7e1 100644 --- a/src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx +++ b/src/pages/docs/api/datasets/run-prompt/get-model-voices.mdx @@ -3,128 +3,112 @@ title: "Get Model Voices" description: "Retrieve available voice options for a specific model's audio output." --- -# Get Model Voices - -Retrieve the available voice options, supported audio formats, and defaults for a specific model's audio output capabilities. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Query Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `model` | string | Yes | The model name to retrieve voice options for (e.g., `gpt-4o-audio-preview`). | - -## Response - -Status message. Example: `success`. -Voice configuration for the specified model. - -### Example Response - -```json -{ - "message": "success", - "data": { - "model_name": "gpt-4o-audio-preview", - "provider": "openai", - "custom_voice_supported": true, - "supported_voices": [ - { "id": "alloy", "name": "Alloy", "type": "system" }, - { "id": "echo", "name": "Echo", "type": "system" }, - { "id": "custom-voice-id", "name": "My Custom Voice", "type": "custom" } - ], - "supported_formats": ["mp3", "wav", "opus", "flac"], - "default_voice": "alloy", - "default_format": "mp3" - } -} -``` - -## Responses - -### 200 - -Voice options retrieved successfully. - -- **message**: string — `success` -- **data**: object - - **model_name**: string — Model identifier. - - **provider**: string — Model provider. - - **custom_voice_supported**: boolean — Whether custom voices are supported. - - **supported_voices**: array — Available voices. - - **id**: string — Voice identifier. - - **name**: string — Display name. - - **type**: string — `system` or `custom`. - - **supported_formats**: array of strings — Supported audio formats. - - **default_voice**: string — Default voice ID. - - **default_format**: string — Default audio format. - -### 400 - -Bad request. The `model` query parameter is required. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/api/model_voices/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} -params = { - "model": "gpt-4o-audio-preview" -} - -response = requests.get(url, headers=headers, params=params) -print(response.json()) -``` -```typescript TypeScript -const params = new URLSearchParams({ model: "gpt-4o-audio-preview" }); -const response = await fetch( - `https://api.futureagi.com/model-hub/api/model_voices/?${params}`, - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/api/model_voices/?model=gpt-4o-audio-preview" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The identifier of the language model whose audio voice options you want to retrieve (e.g., `gpt-4o-audio-preview`). The model must support audio output capabilities. This parameter determines which provider's voice catalog is returned. + + + + + + A status message indicating the outcome of the request. Returns `success` when voice options are retrieved without errors. + + + + The voice configuration payload for the specified model, including available voices, supported audio formats, and default settings. + + + + + The identifier of the model for which voice options were retrieved, matching the value provided in the `model` query parameter. + + + + The name of the model provider that serves this model (e.g., `openai`, `elevenlabs`). This determines which voice catalog and audio rendering engine is used. + + + + Indicates whether this model supports custom (user-created) voices in addition to the built-in system voices. When `true`, custom TTS voices created by your organization can be used with this model. + + + + An array of voice objects representing all voices available for use with this model. Each voice includes its unique identifier, display name, and whether it is a built-in system voice or a custom voice created by your organization. + + + + + The unique identifier of the voice, used when configuring audio output in a run prompt column. + + + + The human-readable display name of the voice, shown in the UI when selecting voice options. + + + + The category of the voice. `system` indicates a built-in voice provided by the model provider, while `custom` indicates a voice created by your organization. + + + + + An array of strings listing the audio file formats supported by this model (e.g., `mp3`, `wav`, `opus`, `flac`). These determine which output encoding options are available when generating audio responses. + + + + The identifier of the default voice used when no specific voice is selected in the prompt configuration. This voice is automatically applied if the `voice` parameter is omitted. + + + + The default audio file format used when no specific format is selected in the prompt configuration (e.g., `mp3`). This format is automatically applied if the `format` parameter is omitted. + + + + + + + The request was malformed or missing required parameters. The `model` query parameter is required and must reference a valid model that supports audio output. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + An unexpected error occurred on the server while retrieving voice options. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx index bf05bee0..b435a7db 100644 --- a/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx +++ b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-column-config.mdx @@ -3,151 +3,145 @@ title: "Retrieve Run Prompt Column Config" description: "Get the full configuration of an existing run prompt column." --- -# Retrieve Run Prompt Column Config - -Retrieve the complete configuration of a run prompt column, including model settings, messages, tools, and output format. Column UUID references in messages are resolved back to column names. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Query Parameters - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `column_id` | string (UUID) | Yes | The UUID of the run prompt column. | - -## Response - -Status message. Example: `success`. -Configuration object for the run prompt column. - -### Example Response - -```json -{ - "message": "success", - "data": { - "config": { - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "gpt_response", - "model": "gpt-4o", - "messages": [ - { - "role": "system", - "content": "You are a helpful assistant." - }, - { - "role": "user", - "content": "Summarize: {{input}}" - } - ], - "temperature": 0.7, - "frequency_penalty": 0, - "presence_penalty": 0, - "max_tokens": 1024, - "top_p": 1, - "response_format": null, - "tool_choice": null, - "tools": [], - "output_format": "string", - "concurrency": 5, - "run_prompt_config": {} - } - } -} -``` - -## Responses - -### 200 - -Configuration retrieved successfully. - -- **message**: string — `success` -- **data**: object - - **config**: object - - **dataset_id**: string (UUID) — Dataset identifier. - - **name**: string — Column name. - - **model**: string — Model used for generation. - - **messages**: array — Prompt messages with column variable references. - - **temperature**: number — Sampling temperature. - - **frequency_penalty**: number — Frequency penalty. - - **presence_penalty**: number — Presence penalty. - - **max_tokens**: integer — Maximum response tokens. - - **top_p**: number — Nucleus sampling parameter. - - **response_format**: string or null — Response format constraint. - - **tool_choice**: string or null — Tool selection strategy. - - **tools**: array — Tool definitions with `id`, `name`, `config`. - - **output_format**: string — Output format (`string`, `audio`, `json`). - - **concurrency**: integer — Concurrent request count. - - **run_prompt_config**: object — Additional run prompt settings. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Column not found or is not a run prompt column. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_column_config/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} -params = { - "column_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" -} - -response = requests.get(url, headers=headers, params=params) -print(response.json()) -``` -```typescript TypeScript -const params = new URLSearchParams({ - column_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901" -}); -const response = await fetch( - `https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_column_config/?${params}`, - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_column_config/?column_id=b2c3d4e5-f6a7-8901-bcde-f12345678901" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the run prompt column whose configuration you want to retrieve. The column must be of type `RUN_PROMPT` and must belong to a dataset accessible by your organization. + + + + + + A status message indicating the outcome of the request. Returns `success` when the column configuration is retrieved without errors. + + + + The response payload containing the full run prompt column configuration. Column UUID references in messages are resolved back to column names for readability. + + + + + The complete configuration object for the run prompt column, including all model settings, prompt messages, sampling parameters, and output options. + + + + + The universally unique identifier (UUID) of the dataset that contains this run prompt column. + + + + The display name of the run prompt column as it appears in the dataset table. + + + + The identifier of the language model used for generation (e.g., `gpt-4o`, `claude-3-5-sonnet`). + + + + The ordered array of message objects defining the prompt. Column UUID references within message content are resolved back to human-readable `{{column_name}}` template variable syntax. + + + + The sampling temperature controlling randomness in the model's output, ranging from `0` to `2`. + + + + The frequency penalty applied to tokens based on their occurrence count in the generated text, ranging from `-2` to `2`. + + + + The presence penalty applied to tokens based on whether they have appeared at all in the generated text, ranging from `-2` to `2`. + + + + The maximum number of tokens the model is allowed to generate in a single response. + + + + The nucleus sampling parameter controlling token selection probability mass, ranging from `0` to `1`. + + + + The response format constraint applied to the model output (e.g., `json_object`), or `null` if no format constraint is set. + + + + The tool selection strategy governing how the model decides whether to call a tool (e.g., `auto`, `none`, `required`), or `null` if no tools are configured. + + + + The array of tool definitions available to the model during generation. Each tool includes an `id`, `name`, and `config` describing its capabilities. Returns an empty array when no tools are configured. + + + + The output format of the generated content. One of `string` (plain text), `audio` (audio output), or `json` (structured JSON output). + + + + The number of concurrent requests configured for parallel row processing. + + + + Additional run prompt settings specific to the column configuration. This object contains provider-specific or advanced configuration options. + + + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified column was not found or is not a run prompt column. Verify the `column_id` is correct and that the column is of type `RUN_PROMPT`. + + + + An unexpected error occurred on the server while retrieving the column configuration. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx index 72edb4ca..83086430 100644 --- a/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx +++ b/src/pages/docs/api/datasets/run-prompt/retrieve-run-prompt-options.mdx @@ -3,137 +3,135 @@ title: "Retrieve Run Prompt Options" description: "Get available models, tools, output formats, and tool choices for run prompt configuration." --- -# Retrieve Run Prompt Options - -Retrieve the available options for configuring a run prompt column, including supported models, tools, output formats, and tool choice strategies. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Response - -Status message. Example: `success`. -Available options for run prompt configuration. - -### Example Response - -```json -{ - "message": "success", - "data": { - "models": [ - { - "model_name": "gpt-4o", - "providers": ["openai"], - "is_available": true - }, - { - "model_name": "claude-3-5-sonnet", - "providers": ["anthropic"], - "is_available": true - } - ], - "tool_config": {}, - "available_tools": [ - { - "id": "tool-uuid", - "name": "web_search", - "yaml_config": "...", - "config": {}, - "config_type": "function", - "description": "Search the web for information" - } - ], - "output_formats": [ - { "value": "string", "label": "String" }, - { "value": "audio", "label": "Audio" }, - { "value": "json", "label": "JSON" } - ], - "tool_choices": [ - { "value": "auto", "label": "Auto" }, - { "value": "none", "label": "None" }, - { "value": "required", "label": "Required" } - ] - } -} -``` - -## Responses - -### 200 - -Options retrieved successfully. - -- **message**: string — `success` -- **data**: object - - **models**: array — Available LLM models. - - **model_name**: string — Model identifier. - - **providers**: array of strings — Available providers. - - **is_available**: boolean — Whether the model is currently available. - - **tool_config**: object — Tool configuration schema. - - **available_tools**: array — Organization's available tools. - - **id**: string (UUID) — Tool identifier. - - **name**: string — Tool name. - - **config**: object — Tool configuration. - - **config_type**: string — Configuration type. - - **description**: string — Tool description. - - **output_formats**: array — Supported output formats with `value` and `label`. - - **tool_choices**: array — Supported tool choice strategies with `value` and `label`. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_options/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} - -response = requests.get(url, headers=headers) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_options/", - { - method: "GET", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - } - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X GET "https://api.futureagi.com/model-hub/develops/retrieve_run_prompt_options/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + A status message indicating the outcome of the request. Returns `success` when the available options are retrieved without errors. + + + + The response payload containing all available configuration options for setting up a run prompt column, including models, tools, output formats, and tool selection strategies. + + + + + An array of available language model objects that can be used for run prompt generation. Each model entry indicates its name, supported providers, and current availability status. + + + + + The identifier of the language model (e.g., `gpt-4o`, `claude-3-5-sonnet`). Use this value in the `config.model` field when creating or editing a run prompt column. + + + + An array of provider names that offer this model (e.g., `["openai"]`, `["anthropic"]`). A model may be available from multiple providers. + + + + Indicates whether the model is currently available for use. Models may become temporarily unavailable due to provider outages or capacity constraints. + + + + + The tool configuration schema describing the structure and validation rules for tool definitions. This schema guides how tools should be configured when added to a run prompt column. + + + + An array of tool objects available to your organization for use in run prompt columns. These tools can be referenced in the `config.tools` array when creating or editing a run prompt column. + + + + + The universally unique identifier (UUID) of the tool. Use this value when referencing the tool in a run prompt column configuration. + + + + The human-readable name of the tool, describing its function (e.g., `web_search`). + + + + The configuration object for the tool, containing provider-specific settings and parameters. + + + + The type of tool configuration, indicating how the tool is invoked by the model (e.g., `function`). + + + + A human-readable description of what the tool does and when the model should use it. + + + + + An array of supported output format options, each containing a `value` (the programmatic identifier to use in configuration) and a `label` (the human-readable display name). Standard options include `string`, `audio`, and `json`. + + + + An array of supported tool choice strategy options, each containing a `value` (the programmatic identifier to use in configuration) and a `label` (the human-readable display name). Standard options include `auto`, `none`, and `required`. + + + + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + An unexpected error occurred on the server while retrieving run prompt options. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/run-prompt/tts-voices.mdx b/src/pages/docs/api/datasets/run-prompt/tts-voices.mdx index cef7d9ac..47507a3a 100644 --- a/src/pages/docs/api/datasets/run-prompt/tts-voices.mdx +++ b/src/pages/docs/api/datasets/run-prompt/tts-voices.mdx @@ -3,205 +3,100 @@ title: "TTS Voices" description: "Manage custom text-to-speech voices for your organization." --- -# TTS Voices - -Create, list, retrieve, update, and delete custom text-to-speech (TTS) voices for your organization. Custom voices can be used with audio output in run prompt columns. - -## List Voices - -### Response - -```json -[ - { - "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "Customer Support Voice", - "voice_id": "custom_voice_123", - "provider": "openai", - "model": "tts-1", - "description": "Warm, professional tone for customer support", - "created_at": "2024-01-15T10:30:00Z" - } -] -``` - -## Create Voice - - - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Endpoints - -| Method | Endpoint | Description | -|--------|----------|-------------| -| GET | `/model-hub/tts-voices/` | List all TTS voices | -| POST | `/model-hub/tts-voices/` | Create a new TTS voice | -| GET | `/model-hub/tts-voices/{id}/` | Retrieve a specific voice | -| PATCH | `/model-hub/tts-voices/{id}/` | Update a voice | -| DELETE | `/model-hub/tts-voices/{id}/` | Delete a voice | - -## Request Body (Create / Update) - - - Display name for the TTS voice. - - - - Provider-specific voice identifier. - - - - TTS provider (e.g., `openai`, `elevenlabs`). - - - - TTS model to use (e.g., `tts-1`, `tts-1-hd`). - - - - Description of the voice characteristics. - - -### Example - -```json -{ - "name": "Customer Support Voice", - "voice_id": "custom_voice_123", - "provider": "openai", - "model": "tts-1", - "description": "Warm, professional tone for customer support" -} -``` - -## Responses - -### 200 / 201 - -Voice operation completed successfully. Returns the voice object. - -- **id**: string (UUID) — Voice identifier. -- **name**: string — Display name. -- **voice_id**: string — Provider-specific voice ID. -- **provider**: string — TTS provider. -- **model**: string — TTS model. -- **description**: string — Voice description. -- **created_at**: string (datetime) — Creation timestamp. - -### 400 - -Bad request. Missing required fields or invalid data. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Voice not found or does not belong to your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -base_url = "https://api.futureagi.com/model-hub/tts-voices/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} - -# List voices -response = requests.get(base_url, headers=headers) -print("List:", response.json()) - -# Create voice -data = { - "name": "Customer Support Voice", - "voice_id": "custom_voice_123", - "provider": "openai", - "model": "tts-1", - "description": "Warm, professional tone" -} -response = requests.post(base_url, headers=headers, json=data) -print("Created:", response.json()) -``` -```typescript TypeScript -const baseUrl = "https://api.futureagi.com/model-hub/tts-voices/"; -const headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -}; - -// List voices -const listRes = await fetch(baseUrl, { headers }); -console.log("List:", await listRes.json()); - -// Create voice -const createRes = await fetch(baseUrl, { - method: "POST", - headers, - body: JSON.stringify({ - name: "Customer Support Voice", - voice_id: "custom_voice_123", - provider: "openai", - model: "tts-1", - description: "Warm, professional tone" - }) -}); -console.log("Created:", await createRes.json()); -``` -```bash cURL -# List voices -curl -X GET "https://api.futureagi.com/model-hub/tts-voices/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" - -# Create voice -curl -X POST "https://api.futureagi.com/model-hub/tts-voices/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "Customer Support Voice", - "voice_id": "custom_voice_123", - "provider": "openai", - "model": "tts-1", - "description": "Warm, professional tone" - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The human-readable display name for the TTS voice. This name is shown in the UI when selecting a voice for audio output in run prompt columns. It should clearly describe the voice characteristics (e.g., "Customer Support Voice", "Narrator - Deep Male"). + + + + The provider-specific voice identifier used to reference this voice in the TTS engine. This value must match a valid voice ID recognized by the specified provider (e.g., a custom voice ID from OpenAI or ElevenLabs). + + + + The TTS provider that hosts this voice (e.g., `openai`, `elevenlabs`). The provider determines which voice rendering engine is used when generating audio output. + + + + The TTS model to use for audio rendering with this voice (e.g., `tts-1`, `tts-1-hd`). Different models offer varying quality levels and latency characteristics. If not provided, the provider's default model is used. + + + + A human-readable description of the voice characteristics, tone, and intended use case. This description helps team members select the appropriate voice when configuring audio output columns. + + + + + + The universally unique identifier (UUID) assigned to the TTS voice. Use this ID to reference, update, or delete the voice in subsequent API calls. + + + + The display name of the TTS voice as provided during creation or last update. + + + + The provider-specific voice identifier used by the TTS engine to render audio output. + + + + The TTS provider that hosts and renders this voice (e.g., `openai`, `elevenlabs`). + + + + The TTS model configured for this voice (e.g., `tts-1`, `tts-1-hd`). + + + + The human-readable description of the voice characteristics, tone, and intended use case. + + + + The ISO 8601 timestamp indicating when the TTS voice was created in the system. + + + + + + The request was malformed or contained invalid parameters. This can occur when required fields (`name`, `voice_id`, `provider`) are missing or contain invalid data. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified TTS voice was not found or does not belong to your organization. This error applies to retrieve, update, and delete operations on individual voices. + + + + An unexpected error occurred on the server while processing the TTS voice request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/update-cell-value.mdx b/src/pages/docs/api/datasets/update-cell-value.mdx index 410f9bd9..42037f02 100644 --- a/src/pages/docs/api/datasets/update-cell-value.mdx +++ b/src/pages/docs/api/datasets/update-cell-value.mdx @@ -3,10 +3,6 @@ title: "Update Cell Value" description: "Update the value of a specific cell in a dataset." --- -# Update Cell Value - -Update the value of a single cell in a dataset, identified by row ID and column ID. Supports text, boolean, and file uploads. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the dataset containing the cell. - - -## Request Body - -Accepts `application/json` for text/boolean values or `multipart/form-data` for file uploads. - - - UUID of the row containing the cell. - - - - UUID of the column containing the cell. - - - - The new value for the cell. The accepted format depends on the column data type: - - **text** - Any string value - - **boolean** - `"true"` or `"false"` - - **image/audio/document** - File upload (use `multipart/form-data`) - - -### Example (JSON) - -```json -{ - "row_id": "row-uuid-1", - "column_id": "col-uuid-1", - "new_value": "Updated text value" -} -``` - -## Response - -Returns confirmation of the update. - -Confirmation message. -Status indicator. Example: `success`. - -### Example Response - -```json -{ - "data": "Cell value updated successfully", - "status": "success" -} -``` - -## Responses - -### 200 - -Cell value updated successfully. - -### 400 - -Bad request. Possible reasons: - -- **Missing fields** - Both `row_id` and `column_id` are required. -- **Cell not found** - The specified row/column combination does not exist in the dataset. -- **Non-editable column** - The column is a system-generated column and cannot be edited. -- **Invalid boolean** - For boolean columns, value must be `"true"` or `"false"`. -- **Value too long** - The value exceeds the maximum allowed character length. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -# Text value update -url = "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update_cell_value/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "row_id": "row-uuid-1", - "column_id": "col-uuid-1", - "new_value": "Updated text value" -} - -response = requests.put(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update_cell_value/", - { - method: "PUT", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - row_id: "row-uuid-1", - column_id: "col-uuid-1", - new_value: "Updated text value" - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X PUT "https://api.futureagi.com/model-hub/develops/a1b2c3d4-e5f6-7890-abcd-ef1234567890/update_cell_value/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "row_id": "row-uuid-1", - "column_id": "col-uuid-1", - "new_value": "Updated text value" - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset containing the cell you want to update. The dataset must exist within your organization. + + + + + + The universally unique identifier (UUID) of the row containing the cell to update. The row must exist within the specified dataset. + + + The universally unique identifier (UUID) of the column containing the cell to update. The column must exist within the specified dataset and must be an editable column (system-generated columns cannot be modified). + + + The new value to set for the specified cell. The accepted format depends on the column's data type: for text columns, provide any string value; for boolean columns, provide `"true"` or `"false"` as a string; for image, audio, or document columns, upload a file using `multipart/form-data` content type instead of JSON. When using JSON, send the request with `application/json` content type. + + + + + + A human-readable confirmation message indicating the cell value was successfully updated, such as `"Cell value updated successfully"`. + + + Indicates the outcome of the API request. Returns `"success"` when the cell update completes without errors. + + + + + + The request could not be processed. Possible reasons include: `row_id` or `column_id` is missing, the specified row/column combination does not exist in the dataset, the column is a non-editable system-generated column, the value for a boolean column is not `"true"` or `"false"`, or the value exceeds the maximum allowed character length. + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and correct. + + + The specified dataset could not be found. Confirm that the dataset UUID is valid and belongs to your organization. + + + An unexpected error occurred on the server while updating the cell value. If the issue persists, contact Future AGI support. + + diff --git a/src/pages/docs/api/datasets/update-dataset.mdx b/src/pages/docs/api/datasets/update-dataset.mdx index 775098d6..2876fd0d 100644 --- a/src/pages/docs/api/datasets/update-dataset.mdx +++ b/src/pages/docs/api/datasets/update-dataset.mdx @@ -3,137 +3,69 @@ title: "Update Dataset" description: "Update dataset properties such as name." --- -# Update Dataset - -Update the properties of an existing dataset. Currently supports renaming a dataset. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Parameters - -### Path Parameters - - - UUID of the dataset to update. - - -## Request Body - - - New name for the dataset. Must be unique within your organization. - - -### Example - -```json -{ - "name": "Updated Dataset Name" -} -``` - -## Response - -Returns the updated dataset details. - -UUID of the updated dataset. -Updated name of the dataset. - -### Example Response - -```json -{ - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "name": "Updated Dataset Name" -} -``` - -## Responses - -### 200 - -Dataset updated successfully. - -### 400 - -Bad request. Possible reasons: - -- **Duplicate name** - A dataset with this name already exists in your organization. -- **Missing name** - The `name` field is required. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 404 - -Dataset not found. The provided ID does not match any dataset in your organization. - -### 500 - -Internal server error. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" -} -data = { - "name": "Updated Dataset Name" -} - -response = requests.post(url, headers=headers, json=data) -print(response.json()) -``` -```typescript TypeScript -const response = await fetch( - "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY", - "Content-Type": "application/json" - }, - body: JSON.stringify({ - name: "Updated Dataset Name" - }) - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/dataset/a1b2c3d4-e5f6-7890-abcd-ef1234567890/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "Updated Dataset Name" - }' -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The universally unique identifier (UUID) of the dataset to update. This ID is returned when a dataset is created and can also be found by listing all datasets in your organization. + + + + + + The new human-readable name to assign to the dataset. This name replaces the current dataset name throughout the Future AGI platform, including in the dashboard, experiment references, and evaluation pipelines. Must be unique within your organization. + + + + + + The universally unique identifier (UUID) of the updated dataset, confirming which dataset was modified. + + + + The new name of the dataset after the update, reflecting the value provided in the request body. + + + + + + The request was malformed or contained invalid parameters. This can occur when: the `name` field is missing or empty; or a dataset with the same name already exists in your organization. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + The specified dataset could not be found. The provided ID does not match any dataset in your organization. Verify the dataset UUID is correct and that the dataset has not been deleted. + + + + An unexpected error occurred on the server while processing the request. If this persists, contact Future AGI support with details of your request. + + diff --git a/src/pages/docs/api/datasets/upload-dataset.mdx b/src/pages/docs/api/datasets/upload-dataset.mdx index 5a376bf5..22e497b7 100644 --- a/src/pages/docs/api/datasets/upload-dataset.mdx +++ b/src/pages/docs/api/datasets/upload-dataset.mdx @@ -3,16 +3,11 @@ title: "Upload Dataset from File" description: "Create a new dataset by uploading a local file." --- -# Upload Dataset from File - -Create a new dataset by uploading a file from your local machine. The file is uploaded and processed in the background, automatically detecting columns and data types. - -## Authentication - -All requests require authentication via API keys: - -| Header | Description | -|--------|-------------| -| `X-Api-Key` | Your API key | -| `X-Secret-Key` | Your secret key | - -## Request Body - -This endpoint accepts `multipart/form-data`. - - - The file to upload. Supported formats: `.csv`, `.xls`, `.xlsx`, `.json`, `.jsonl`. Maximum file size is **10 MB**. - - - - Name for the dataset. Must be unique within your organization. If not provided, the original filename is used as the dataset name. - - -## Response - -Returns the created dataset details. The file is processed asynchronously in the background. - -Confirmation message. Example: `Dataset creation started successfully. Processing in background.` -UUID of the newly created dataset. -Name of the created dataset. -Current processing status. Initially `queued`. -Estimated number of rows detected in the file. -Estimated number of columns detected in the file. - -### Example Response - -```json -{ - "message": "Dataset creation started successfully. Processing in background.", - "dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", - "dataset_name": "My Uploaded Dataset", - "processing_status": "queued", - "estimated_rows": 150, - "estimated_columns": 5 -} -``` - -## Responses - -### 200 - -Dataset creation started successfully. The file has been uploaded and is being processed in the background. - -### 400 - -Bad request. Possible reasons: - -- **No file uploaded** - The `file` field is required. -- **File too large** - File size exceeds the 10 MB limit. -- **Unsupported file format** - Only `.csv`, `.xls`, `.xlsx`, `.json`, and `.jsonl` files are supported. -- **Duplicate name** - A dataset with this name already exists in your organization. -- **File processing error** - The file could not be parsed. - -### 401 - -Authentication credentials were not provided or are invalid. - -### 429 - -Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. - -### 500 - -Internal server error. Failed to create the dataset from the uploaded file. - -## Code Examples - - -```python Python -import requests - -url = "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/" -headers = { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" -} -files = { - "file": ("data.csv", open("data.csv", "rb"), "text/csv") -} -data = { - "new_dataset_name": "My Uploaded Dataset" -} - -response = requests.post(url, headers=headers, files=files, data=data) -print(response.json()) -``` -```typescript TypeScript -const formData = new FormData(); -formData.append("file", fileInput.files[0]); -formData.append("new_dataset_name", "My Uploaded Dataset"); - -const response = await fetch( - "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/", - { - method: "POST", - headers: { - "X-Api-Key": "YOUR_API_KEY", - "X-Secret-Key": "YOUR_SECRET_KEY" - }, - body: formData - } -); - -const data = await response.json(); -console.log(data); -``` -```bash cURL -curl -X POST "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/" \ - -H "X-Api-Key: YOUR_API_KEY" \ - -H "X-Secret-Key: YOUR_SECRET_KEY" \ - -F "file=@data.csv" \ - -F "new_dataset_name=My Uploaded Dataset" -``` - + + + Your Future AGI API key used to authenticate requests. You can find and manage your API keys in the [Dashboard](https://app.futureagi.com) under Settings. + + + Your Future AGI secret key, used alongside the API key for request authentication. This is generated when you create an API key in the [Dashboard](https://app.futureagi.com). + + + + + + The file to upload and import as a dataset. The server automatically detects columns and data types from the file contents. Supported formats include `.csv`, `.xls`, `.xlsx`, `.json`, and `.jsonl`. The maximum allowed file size is **10 MB**. This endpoint expects `multipart/form-data` encoding. + + + + The human-readable name to assign to the newly created dataset. This name is used to identify the dataset throughout the Future AGI platform, including in the dashboard, experiment configurations, and evaluation pipelines. Must be unique within your organization. If not provided, the original filename (without extension) is used as the dataset name. + + + + + + A human-readable confirmation message indicating that the file upload was received and dataset creation has been queued for background processing. Typically returns `Dataset creation started successfully. Processing in background.` + + + + The universally unique identifier (UUID) assigned to the newly created dataset. Use this ID to check the processing status or reference the dataset in subsequent API calls once processing is complete. + + + + The name assigned to the created dataset, either matching the `new_dataset_name` value provided in the request body or the auto-generated name derived from the uploaded filename. + + + + The current processing status of the file import operation. Initially set to `queued`, this status transitions through `processing` and finally to `completed` or `failed` as the background job progresses. + + + + The estimated number of data rows detected in the uploaded file during initial parsing. This is a preliminary count that may differ slightly from the final row count after full processing is complete. + + + + The estimated number of columns detected in the uploaded file during initial parsing. This is a preliminary count based on the file header or structure analysis. + + + + + + The request was malformed or contained invalid parameters. This can occur when: no file was included in the request; the file exceeds the 10 MB size limit; the file format is not one of the supported types (`.csv`, `.xls`, `.xlsx`, `.json`, `.jsonl`); a dataset with the same name already exists in your organization; or the file contents could not be parsed. + + + + Authentication credentials were not provided or are invalid. Verify that both `X-Api-Key` and `X-Secret-Key` headers are present and contain valid keys. + + + + Resource limit reached. Your organization has exceeded the dataset creation or row addition quota. Contact support or upgrade your plan to increase limits. + + + + An unexpected error occurred on the server while processing the uploaded file. If this persists, contact Future AGI support with details of your request. + + From 9c47b90ce70557214161b1f8214916777e17cb86 Mon Sep 17 00:00:00 2001 From: sarthak Date: Mon, 6 Apr 2026 16:14:54 +0530 Subject: [PATCH 3/3] Fixed the sidebar post/put/get not visible bug --- src/components/Sidebar.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index 5bdc77a0..7f30287a 100644 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -94,10 +94,10 @@ const isApiTab = activeTab?.tab === 'API'; function inferApiMethod(title: string): { method: string; css: string } | null { const t = title.toLowerCase(); - if (/\b(list|get|retrieve|health|find|export|progress|analytics|agreement)\b/.test(t)) { + if (/\b(list|get|retrieve|health|find|export|progress|analytics|agreement|compare|stats|summary|voices|tts)\b/.test(t)) { return { method: 'GET', css: 'api-method-get' }; } - if (/\b(create|add|generate|execute|submit|assign|bulk|complete|skip|release|pause|unpause|check|upload)\b/.test(t)) { + if (/\b(create|add|generate|execute|submit|assign|bulk|complete|skip|release|pause|unpause|check|upload|start|duplicate|fetch|run|rerun|cancel|clone|merge)\b/.test(t)) { return { method: 'POST', css: 'api-method-post' }; } if (/\b(delete|remove)\b/.test(t)) {