@naturali/cli 0.67.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1380 -13
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "0.
|
|
17
|
+
var version = "0.69.0";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
20
20
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
@@ -1676,6 +1676,282 @@ var Conversations = class {
|
|
|
1676
1676
|
});
|
|
1677
1677
|
}
|
|
1678
1678
|
};
|
|
1679
|
+
var Evaluations = class {
|
|
1680
|
+
/**
|
|
1681
|
+
* List datasets
|
|
1682
|
+
*
|
|
1683
|
+
* Returns the datasets defined in a project
|
|
1684
|
+
*/
|
|
1685
|
+
static listDatasets(options) {
|
|
1686
|
+
return (options.client ?? client).get({
|
|
1687
|
+
url: "/v1/projects/{project_id}/datasets",
|
|
1688
|
+
...options
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Create a dataset
|
|
1693
|
+
*
|
|
1694
|
+
* Creates a project-scoped dataset — a named collection of test cases an eval runs an agent against. Names are unique per project.
|
|
1695
|
+
*
|
|
1696
|
+
* Datasets are operator-owned **fixtures**. The platform's content purge never deletes or mutates a dataset item, so erasing a generation cannot silently stop a test suite from being runnable.
|
|
1697
|
+
*/
|
|
1698
|
+
static createDataset(options) {
|
|
1699
|
+
return (options.client ?? client).post({
|
|
1700
|
+
url: "/v1/projects/{project_id}/datasets",
|
|
1701
|
+
...options,
|
|
1702
|
+
headers: {
|
|
1703
|
+
"Content-Type": "application/json",
|
|
1704
|
+
...options.headers
|
|
1705
|
+
}
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* Delete a dataset
|
|
1710
|
+
*
|
|
1711
|
+
* Deletes a dataset, its items, and every eval bound to it. Results of runs that already scored those items keep their frozen copies of the input and expected output.
|
|
1712
|
+
*/
|
|
1713
|
+
static deleteDataset(options) {
|
|
1714
|
+
return (options.client ?? client).delete({
|
|
1715
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}",
|
|
1716
|
+
...options
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Get a dataset
|
|
1721
|
+
*
|
|
1722
|
+
* Returns a specific dataset
|
|
1723
|
+
*/
|
|
1724
|
+
static getDataset(options) {
|
|
1725
|
+
return (options.client ?? client).get({
|
|
1726
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}",
|
|
1727
|
+
...options
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Update a dataset
|
|
1732
|
+
*
|
|
1733
|
+
* Updates a dataset's name and/or description
|
|
1734
|
+
*/
|
|
1735
|
+
static updateDataset(options) {
|
|
1736
|
+
return (options.client ?? client).put({
|
|
1737
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}",
|
|
1738
|
+
...options,
|
|
1739
|
+
headers: {
|
|
1740
|
+
"Content-Type": "application/json",
|
|
1741
|
+
...options.headers
|
|
1742
|
+
}
|
|
1743
|
+
});
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
* List dataset items
|
|
1747
|
+
*
|
|
1748
|
+
* Returns the test cases in a dataset, oldest first
|
|
1749
|
+
*/
|
|
1750
|
+
static listDatasetItems(options) {
|
|
1751
|
+
return (options.client ?? client).get({
|
|
1752
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}/items",
|
|
1753
|
+
...options
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
/**
|
|
1757
|
+
* Add a dataset item
|
|
1758
|
+
*
|
|
1759
|
+
* Adds one test case. `input` is replayed verbatim as the generation's messages, so it must be a non-empty array of `{ role, content }`.
|
|
1760
|
+
*/
|
|
1761
|
+
static createDatasetItem(options) {
|
|
1762
|
+
return (options.client ?? client).post({
|
|
1763
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}/items",
|
|
1764
|
+
...options,
|
|
1765
|
+
headers: {
|
|
1766
|
+
"Content-Type": "application/json",
|
|
1767
|
+
...options.headers
|
|
1768
|
+
}
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Curate a dataset item from a generation
|
|
1773
|
+
*
|
|
1774
|
+
* Promotes a real, completed generation into a test case: its input messages become the item's `input`, and its own answer becomes `expected_output` unless you supply one. Use it to build an evaluation set out of production traffic rather than hand-authoring fixtures.
|
|
1775
|
+
*
|
|
1776
|
+
* The item is a **copy**, not a view. It keeps working after the source generation's content is purged, and `source_generation_id` goes null if that generation is deleted — a purge can never quietly stop a suite from being runnable.
|
|
1777
|
+
*
|
|
1778
|
+
* Requires both `evaluations:CreateDataset` and `generations:GetGeneration`: the call copies content out of a generation, so a principal that may not read that generation may not curate it either.
|
|
1779
|
+
*
|
|
1780
|
+
* Only a **completed** generation can be promoted (`409 GENERATION_NOT_COMPLETED`), and only while its content is still available: an agent or project running with `trace_content_mode: none` never stored the input, and a purged or expired generation no longer has it (`409 GENERATION_CONTENT_UNAVAILABLE`). Generations that predate input recording answer the same way.
|
|
1781
|
+
*/
|
|
1782
|
+
static createDatasetItemFromGeneration(options) {
|
|
1783
|
+
return (options.client ?? client).post({
|
|
1784
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}/items/from-generation",
|
|
1785
|
+
...options,
|
|
1786
|
+
headers: {
|
|
1787
|
+
"Content-Type": "application/json",
|
|
1788
|
+
...options.headers
|
|
1789
|
+
}
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Delete a dataset item
|
|
1794
|
+
*
|
|
1795
|
+
* Deletes a test case. Results of runs that already scored it stay readable; their `dataset_item_id` becomes null.
|
|
1796
|
+
*/
|
|
1797
|
+
static deleteDatasetItem(options) {
|
|
1798
|
+
return (options.client ?? client).delete({
|
|
1799
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}/items/{item_id}",
|
|
1800
|
+
...options
|
|
1801
|
+
});
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Update a dataset item
|
|
1805
|
+
*
|
|
1806
|
+
* Updates a test case. Runs that already scored it are unaffected — each result carries its own frozen copy of the input and expected output.
|
|
1807
|
+
*/
|
|
1808
|
+
static updateDatasetItem(options) {
|
|
1809
|
+
return (options.client ?? client).put({
|
|
1810
|
+
url: "/v1/projects/{project_id}/datasets/{dataset_id}/items/{item_id}",
|
|
1811
|
+
...options,
|
|
1812
|
+
headers: {
|
|
1813
|
+
"Content-Type": "application/json",
|
|
1814
|
+
...options.headers
|
|
1815
|
+
}
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* List evals
|
|
1820
|
+
*
|
|
1821
|
+
* Returns the evals defined in a project
|
|
1822
|
+
*/
|
|
1823
|
+
static listEvals(options) {
|
|
1824
|
+
return (options.client ?? client).get({
|
|
1825
|
+
url: "/v1/projects/{project_id}/evals",
|
|
1826
|
+
...options
|
|
1827
|
+
});
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* Create an eval
|
|
1831
|
+
*
|
|
1832
|
+
* Binds an agent under test to a dataset and a list of scorers. The agent and the dataset must belong to the same project as the eval; a cross-project reference is rejected with 400.
|
|
1833
|
+
*
|
|
1834
|
+
* Scorer config is frozen here rather than read from the agent at run time, so two runs of the same eval are always judged by the same criteria and their comparison measures the agent instead of the config drifting underneath it. Each scorer `type` may appear at most once.
|
|
1835
|
+
*/
|
|
1836
|
+
static createEval(options) {
|
|
1837
|
+
return (options.client ?? client).post({
|
|
1838
|
+
url: "/v1/projects/{project_id}/evals",
|
|
1839
|
+
...options,
|
|
1840
|
+
headers: {
|
|
1841
|
+
"Content-Type": "application/json",
|
|
1842
|
+
...options.headers
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
/**
|
|
1847
|
+
* Delete an eval
|
|
1848
|
+
*
|
|
1849
|
+
* Deletes an eval, its runs, and their results
|
|
1850
|
+
*/
|
|
1851
|
+
static deleteEval(options) {
|
|
1852
|
+
return (options.client ?? client).delete({
|
|
1853
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}",
|
|
1854
|
+
...options
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
/**
|
|
1858
|
+
* Get an eval
|
|
1859
|
+
*
|
|
1860
|
+
* Returns a specific eval
|
|
1861
|
+
*/
|
|
1862
|
+
static getEval(options) {
|
|
1863
|
+
return (options.client ?? client).get({
|
|
1864
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}",
|
|
1865
|
+
...options
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* Update an eval
|
|
1870
|
+
*
|
|
1871
|
+
* Updates an eval. Changing `agent_id` re-validates the scorers against the new agent, since an `output_schema` scorer that was legal against the old one may not be.
|
|
1872
|
+
*/
|
|
1873
|
+
static updateEval(options) {
|
|
1874
|
+
return (options.client ?? client).put({
|
|
1875
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}",
|
|
1876
|
+
...options,
|
|
1877
|
+
headers: {
|
|
1878
|
+
"Content-Type": "application/json",
|
|
1879
|
+
...options.headers
|
|
1880
|
+
}
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
/**
|
|
1884
|
+
* List eval runs
|
|
1885
|
+
*
|
|
1886
|
+
* Returns an eval's runs, newest first
|
|
1887
|
+
*/
|
|
1888
|
+
static listEvalRuns(options) {
|
|
1889
|
+
return (options.client ?? client).get({
|
|
1890
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}/runs",
|
|
1891
|
+
...options
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Start an eval run
|
|
1896
|
+
*
|
|
1897
|
+
* Runs the eval against its dataset, creating one real agent generation per item and scoring the outputs.
|
|
1898
|
+
*
|
|
1899
|
+
* `wait: true` executes the run synchronously and returns it terminal, with its scores. The dataset is capped at 25 items for a synchronous run; a larger one is rejected with 400 rather than partially scored.
|
|
1900
|
+
*
|
|
1901
|
+
* `wait: false` (the default) enqueues one task per item and returns immediately with `status: "queued"`. A worker executes the items and the run settles itself; poll `GET /evals/{eval_id}/runs/{eval_run_id}` for the terminal status. There is no item cap on a queued run.
|
|
1902
|
+
*
|
|
1903
|
+
* The whole run is pinned to **one** agent version, stamped on `agent_version`: pass one explicitly to evaluate a canary before promoting it, or omit it to use the active release's stable version (or the live draft when no release is in effect). Without the pin, release assignment would bucket each item independently and blend two configs into a single score.
|
|
1904
|
+
*
|
|
1905
|
+
* With `baseline_run_id`, the finished run's `aggregate_scores.baseline` carries per-scorer deltas against that run, computed over the items present and scorable in **both** runs, with the divergence counted. A delta over a shifted dataset is therefore never presented as a clean comparison.
|
|
1906
|
+
*/
|
|
1907
|
+
static startEvalRun(options) {
|
|
1908
|
+
return (options.client ?? client).post({
|
|
1909
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}/runs",
|
|
1910
|
+
...options,
|
|
1911
|
+
headers: {
|
|
1912
|
+
"Content-Type": "application/json",
|
|
1913
|
+
...options.headers
|
|
1914
|
+
}
|
|
1915
|
+
});
|
|
1916
|
+
}
|
|
1917
|
+
/**
|
|
1918
|
+
* Get an eval run
|
|
1919
|
+
*
|
|
1920
|
+
* Returns a run's status, counts, and aggregate scores
|
|
1921
|
+
*/
|
|
1922
|
+
static getEvalRun(options) {
|
|
1923
|
+
return (options.client ?? client).get({
|
|
1924
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}/runs/{eval_run_id}",
|
|
1925
|
+
...options
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* List eval run results
|
|
1930
|
+
*
|
|
1931
|
+
* Returns the per-item results of a run, oldest first
|
|
1932
|
+
*/
|
|
1933
|
+
static listEvalResults(options) {
|
|
1934
|
+
return (options.client ?? client).get({
|
|
1935
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}/runs/{eval_run_id}/results",
|
|
1936
|
+
...options
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
/**
|
|
1940
|
+
* Cancel an eval run
|
|
1941
|
+
*
|
|
1942
|
+
* Cancels a queued or running run: its outstanding item tasks are dropped so it stops consuming provider budget, and the run settles as `canceled`.
|
|
1943
|
+
*
|
|
1944
|
+
* Results already written are kept — they are real measurements of generations that were really paid for — and `completed_count` / `errored_count` report what ran. `aggregate_scores` is deliberately left null: a partial roll-up in the same field a completed run uses would read as a whole-dataset verdict.
|
|
1945
|
+
*
|
|
1946
|
+
* A run that has already finished is rejected with 400.
|
|
1947
|
+
*/
|
|
1948
|
+
static cancelEvalRun(options) {
|
|
1949
|
+
return (options.client ?? client).post({
|
|
1950
|
+
url: "/v1/projects/{project_id}/evals/{eval_id}/runs/{eval_run_id}/cancel",
|
|
1951
|
+
...options
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1679
1955
|
var Generations = class {
|
|
1680
1956
|
/**
|
|
1681
1957
|
* List generations
|
|
@@ -1817,6 +2093,45 @@ var ModelRoutes = class {
|
|
|
1817
2093
|
});
|
|
1818
2094
|
}
|
|
1819
2095
|
};
|
|
2096
|
+
var Models = class {
|
|
2097
|
+
/**
|
|
2098
|
+
* List models
|
|
2099
|
+
*
|
|
2100
|
+
* Lists catalog models, sorted by id. Filter by vendor, provider, input/output modality, status, or `managed` — the last being the axis that decides whether a model is usable without bringing your own provider credentials, so `?managed=true&status=available` is the set a project can enable today.
|
|
2101
|
+
*
|
|
2102
|
+
*/
|
|
2103
|
+
static listModels(options) {
|
|
2104
|
+
return (options?.client ?? client).get({
|
|
2105
|
+
url: "/v1/models",
|
|
2106
|
+
...options
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* Get a model
|
|
2111
|
+
*/
|
|
2112
|
+
static getModel(options) {
|
|
2113
|
+
return (options.client ?? client).get({
|
|
2114
|
+
url: "/v1/models/{model_id}",
|
|
2115
|
+
...options
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* Enable a naturali-managed model
|
|
2120
|
+
*
|
|
2121
|
+
* Provisions a managed provider running this model in the project. The provider needs no credentials of yours — it runs on naturali's own model access — and is priced from the catalog the moment it is created, so its usage is metered from the first generation. The created resource is an ordinary provider: read, update and delete it through [`GET /v1/projects/{project_id}/ai-providers/{ai_provider_id}`](/docs/api/ai-providers/get-ai-provider) like any other. Requires the `admin` role in the project. Only models with `managed: true` can be enabled; anything else is a 400.
|
|
2122
|
+
*
|
|
2123
|
+
*/
|
|
2124
|
+
static enableManagedModel(options) {
|
|
2125
|
+
return (options.client ?? client).post({
|
|
2126
|
+
url: "/v1/projects/{project_id}/models/{model_id}/providers",
|
|
2127
|
+
...options,
|
|
2128
|
+
headers: {
|
|
2129
|
+
"Content-Type": "application/json",
|
|
2130
|
+
...options.headers
|
|
2131
|
+
}
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
1820
2135
|
var Projects = class {
|
|
1821
2136
|
/**
|
|
1822
2137
|
* List projects
|
|
@@ -2253,6 +2568,58 @@ var Tools = class {
|
|
|
2253
2568
|
});
|
|
2254
2569
|
}
|
|
2255
2570
|
};
|
|
2571
|
+
var Traces = class {
|
|
2572
|
+
/**
|
|
2573
|
+
* List traces
|
|
2574
|
+
*
|
|
2575
|
+
* Returns a paginated list of execution traces for the project.
|
|
2576
|
+
*/
|
|
2577
|
+
static listTraces(options) {
|
|
2578
|
+
return (options.client ?? client).get({
|
|
2579
|
+
url: "/v1/projects/{project_id}/traces",
|
|
2580
|
+
...options
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* Get a trace
|
|
2585
|
+
*
|
|
2586
|
+
* Returns a single trace by ID.
|
|
2587
|
+
*/
|
|
2588
|
+
static getTrace(options) {
|
|
2589
|
+
return (options.client ?? client).get({
|
|
2590
|
+
url: "/v1/projects/{project_id}/traces/{trace_id}",
|
|
2591
|
+
...options
|
|
2592
|
+
});
|
|
2593
|
+
}
|
|
2594
|
+
/**
|
|
2595
|
+
* Get trace tree
|
|
2596
|
+
*
|
|
2597
|
+
* Returns the full execution tree rooted at the given trace (or its root if the given trace is a child). Each node represents one agent's execution session. The `children` array contains traces triggered by sub-agent tool calls from that trace.
|
|
2598
|
+
*
|
|
2599
|
+
*/
|
|
2600
|
+
static getTraceTree(options) {
|
|
2601
|
+
return (options.client ?? client).get({
|
|
2602
|
+
url: "/v1/projects/{project_id}/traces/{trace_id}/tree",
|
|
2603
|
+
...options
|
|
2604
|
+
});
|
|
2605
|
+
}
|
|
2606
|
+
/**
|
|
2607
|
+
* Purge trace content
|
|
2608
|
+
*
|
|
2609
|
+
* Deletes the trace's steps object from storage and clears its content columns (`file_id`, `error`), cascading to every descendant trace and to all of their generations. A descendant holds its own steps object covering the same run, so the cascade is what makes the erasure complete rather than merely partial.
|
|
2610
|
+
*
|
|
2611
|
+
* The rows survive as auditable skeletons with `content_redacted_at` set — ids, timestamps, step counts, and the generations' usage-attribution fields are preserved, because the billing and audit ledger must outlive a tenant's erasure of the content. A purged trace therefore reads back as a skeleton, not a 404: a 404 would prove nothing.
|
|
2612
|
+
*
|
|
2613
|
+
* Idempotent — purging an already-purged trace succeeds and leaves the original `content_redacted_at` in place.
|
|
2614
|
+
*
|
|
2615
|
+
*/
|
|
2616
|
+
static purgeTraceContent(options) {
|
|
2617
|
+
return (options.client ?? client).delete({
|
|
2618
|
+
url: "/v1/projects/{project_id}/traces/{trace_id}/content",
|
|
2619
|
+
...options
|
|
2620
|
+
});
|
|
2621
|
+
}
|
|
2622
|
+
};
|
|
2256
2623
|
var Users = class {
|
|
2257
2624
|
/**
|
|
2258
2625
|
* Get the current user
|
|
@@ -2458,12 +2825,15 @@ var NaturaliClient = class {
|
|
|
2458
2825
|
channels;
|
|
2459
2826
|
auth;
|
|
2460
2827
|
conversations;
|
|
2828
|
+
evaluations;
|
|
2461
2829
|
generations;
|
|
2462
2830
|
modelRoutes;
|
|
2831
|
+
models;
|
|
2463
2832
|
projects;
|
|
2464
2833
|
secrets;
|
|
2465
2834
|
sessions;
|
|
2466
2835
|
tools;
|
|
2836
|
+
traces;
|
|
2467
2837
|
users;
|
|
2468
2838
|
webhooks;
|
|
2469
2839
|
/** The underlying HTTP client, for interceptors or one-off requests. */
|
|
@@ -2485,12 +2855,15 @@ var NaturaliClient = class {
|
|
|
2485
2855
|
this.channels = bindResource(Channels, this.http);
|
|
2486
2856
|
this.auth = bindResource(Auth, this.http);
|
|
2487
2857
|
this.conversations = bindResource(Conversations, this.http);
|
|
2858
|
+
this.evaluations = bindResource(Evaluations, this.http);
|
|
2488
2859
|
this.generations = bindResource(Generations, this.http);
|
|
2489
2860
|
this.modelRoutes = bindResource(ModelRoutes, this.http);
|
|
2861
|
+
this.models = bindResource(Models, this.http);
|
|
2490
2862
|
this.projects = bindResource(Projects, this.http);
|
|
2491
2863
|
this.secrets = bindResource(Secrets, this.http);
|
|
2492
2864
|
this.sessions = bindResource(Sessions, this.http);
|
|
2493
2865
|
this.tools = bindResource(Tools, this.http);
|
|
2866
|
+
this.traces = bindResource(Traces, this.http);
|
|
2494
2867
|
this.users = bindResource(Users, this.http);
|
|
2495
2868
|
this.webhooks = bindResource(Webhooks, this.http);
|
|
2496
2869
|
}
|
|
@@ -2507,13 +2880,16 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
2507
2880
|
Auth: () => Auth,
|
|
2508
2881
|
Channels: () => Channels,
|
|
2509
2882
|
Conversations: () => Conversations,
|
|
2883
|
+
Evaluations: () => Evaluations,
|
|
2510
2884
|
Generations: () => Generations,
|
|
2511
2885
|
ModelRoutes: () => ModelRoutes,
|
|
2886
|
+
Models: () => Models,
|
|
2512
2887
|
NaturaliClient: () => NaturaliClient,
|
|
2513
2888
|
Projects: () => Projects,
|
|
2514
2889
|
Secrets: () => Secrets,
|
|
2515
2890
|
Sessions: () => Sessions,
|
|
2516
2891
|
Tools: () => Tools,
|
|
2892
|
+
Traces: () => Traces,
|
|
2517
2893
|
Users: () => Users,
|
|
2518
2894
|
Webhooks: () => Webhooks,
|
|
2519
2895
|
createClient: () => createClient,
|
|
@@ -6064,20 +6440,787 @@ const routes = {
|
|
|
6064
6440
|
"in": "path"
|
|
6065
6441
|
}]
|
|
6066
6442
|
},
|
|
6067
|
-
"list-
|
|
6068
|
-
serviceClass: "
|
|
6069
|
-
operationId: "
|
|
6070
|
-
description: "Returns
|
|
6071
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/
|
|
6443
|
+
"list-datasets": {
|
|
6444
|
+
serviceClass: "Evaluations",
|
|
6445
|
+
operationId: "listDatasets",
|
|
6446
|
+
description: "Returns the datasets defined in a project",
|
|
6447
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6072
6448
|
httpMethod: "get",
|
|
6073
6449
|
pathParams: ["project_id"],
|
|
6074
|
-
queryParams: [
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6450
|
+
queryParams: ["limit", "offset"],
|
|
6451
|
+
flags: [
|
|
6452
|
+
{
|
|
6453
|
+
"name": "project_id",
|
|
6454
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6455
|
+
"required": true,
|
|
6456
|
+
"type": "string",
|
|
6457
|
+
"in": "path"
|
|
6458
|
+
},
|
|
6459
|
+
{
|
|
6460
|
+
"name": "limit",
|
|
6461
|
+
"description": "Maximum number of results to return",
|
|
6462
|
+
"required": false,
|
|
6463
|
+
"type": "integer",
|
|
6464
|
+
"in": "query"
|
|
6465
|
+
},
|
|
6466
|
+
{
|
|
6467
|
+
"name": "offset",
|
|
6468
|
+
"description": "Number of results to skip",
|
|
6469
|
+
"required": false,
|
|
6470
|
+
"type": "integer",
|
|
6471
|
+
"in": "query"
|
|
6472
|
+
}
|
|
6473
|
+
]
|
|
6474
|
+
},
|
|
6475
|
+
"create-dataset": {
|
|
6476
|
+
serviceClass: "Evaluations",
|
|
6477
|
+
operationId: "createDataset",
|
|
6478
|
+
description: "Creates a project-scoped dataset — a named collection of test cases an eval runs an agent against. Names are unique per project. Datasets are operator-owned **fixtures**. The platform's content purge never deletes or mutates a dataset item, so erasing a generation cannot silently stop a test suite from being runnable.",
|
|
6479
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6480
|
+
httpMethod: "post",
|
|
6481
|
+
pathParams: ["project_id"],
|
|
6482
|
+
queryParams: [],
|
|
6483
|
+
flags: [
|
|
6484
|
+
{
|
|
6485
|
+
"name": "project_id",
|
|
6486
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6487
|
+
"required": true,
|
|
6488
|
+
"type": "string",
|
|
6489
|
+
"in": "path"
|
|
6490
|
+
},
|
|
6491
|
+
{
|
|
6492
|
+
"name": "name",
|
|
6493
|
+
"description": "Unique name within the project",
|
|
6494
|
+
"required": true,
|
|
6495
|
+
"type": "string",
|
|
6496
|
+
"in": "body"
|
|
6497
|
+
},
|
|
6498
|
+
{
|
|
6499
|
+
"name": "description",
|
|
6500
|
+
"description": "What this suite covers",
|
|
6501
|
+
"required": false,
|
|
6502
|
+
"type": "string",
|
|
6503
|
+
"in": "body"
|
|
6504
|
+
}
|
|
6505
|
+
]
|
|
6506
|
+
},
|
|
6507
|
+
"get-dataset": {
|
|
6508
|
+
serviceClass: "Evaluations",
|
|
6509
|
+
operationId: "getDataset",
|
|
6510
|
+
description: "Returns a specific dataset",
|
|
6511
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6512
|
+
httpMethod: "get",
|
|
6513
|
+
pathParams: ["project_id", "dataset_id"],
|
|
6514
|
+
queryParams: [],
|
|
6515
|
+
flags: [{
|
|
6516
|
+
"name": "project_id",
|
|
6517
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6518
|
+
"required": true,
|
|
6519
|
+
"type": "string",
|
|
6520
|
+
"in": "path"
|
|
6521
|
+
}, {
|
|
6522
|
+
"name": "dataset_id",
|
|
6523
|
+
"description": "Dataset ID",
|
|
6524
|
+
"required": true,
|
|
6525
|
+
"type": "string",
|
|
6526
|
+
"in": "path"
|
|
6527
|
+
}]
|
|
6528
|
+
},
|
|
6529
|
+
"update-dataset": {
|
|
6530
|
+
serviceClass: "Evaluations",
|
|
6531
|
+
operationId: "updateDataset",
|
|
6532
|
+
description: "Updates a dataset's name and/or description",
|
|
6533
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6534
|
+
httpMethod: "put",
|
|
6535
|
+
pathParams: ["project_id", "dataset_id"],
|
|
6536
|
+
queryParams: [],
|
|
6537
|
+
flags: [
|
|
6538
|
+
{
|
|
6539
|
+
"name": "project_id",
|
|
6540
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6541
|
+
"required": true,
|
|
6542
|
+
"type": "string",
|
|
6543
|
+
"in": "path"
|
|
6544
|
+
},
|
|
6545
|
+
{
|
|
6546
|
+
"name": "dataset_id",
|
|
6547
|
+
"description": "Dataset ID",
|
|
6548
|
+
"required": true,
|
|
6549
|
+
"type": "string",
|
|
6550
|
+
"in": "path"
|
|
6551
|
+
},
|
|
6552
|
+
{
|
|
6553
|
+
"name": "name",
|
|
6554
|
+
"description": "",
|
|
6555
|
+
"required": false,
|
|
6556
|
+
"type": "string",
|
|
6557
|
+
"in": "body"
|
|
6558
|
+
},
|
|
6559
|
+
{
|
|
6560
|
+
"name": "description",
|
|
6561
|
+
"description": "",
|
|
6562
|
+
"required": false,
|
|
6563
|
+
"type": "string",
|
|
6564
|
+
"in": "body"
|
|
6565
|
+
}
|
|
6566
|
+
]
|
|
6567
|
+
},
|
|
6568
|
+
"delete-dataset": {
|
|
6569
|
+
serviceClass: "Evaluations",
|
|
6570
|
+
operationId: "deleteDataset",
|
|
6571
|
+
description: "Deletes a dataset, its items, and every eval bound to it. Results of runs that already scored those items keep their frozen copies of the input and expected output.",
|
|
6572
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6573
|
+
httpMethod: "delete",
|
|
6574
|
+
pathParams: ["project_id", "dataset_id"],
|
|
6575
|
+
queryParams: [],
|
|
6576
|
+
flags: [{
|
|
6577
|
+
"name": "project_id",
|
|
6578
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6579
|
+
"required": true,
|
|
6580
|
+
"type": "string",
|
|
6581
|
+
"in": "path"
|
|
6582
|
+
}, {
|
|
6583
|
+
"name": "dataset_id",
|
|
6584
|
+
"description": "Dataset ID",
|
|
6585
|
+
"required": true,
|
|
6586
|
+
"type": "string",
|
|
6587
|
+
"in": "path"
|
|
6588
|
+
}]
|
|
6589
|
+
},
|
|
6590
|
+
"list-dataset-items": {
|
|
6591
|
+
serviceClass: "Evaluations",
|
|
6592
|
+
operationId: "listDatasetItems",
|
|
6593
|
+
description: "Returns the test cases in a dataset, oldest first",
|
|
6594
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6595
|
+
httpMethod: "get",
|
|
6596
|
+
pathParams: ["project_id", "dataset_id"],
|
|
6597
|
+
queryParams: ["limit", "offset"],
|
|
6598
|
+
flags: [
|
|
6599
|
+
{
|
|
6600
|
+
"name": "project_id",
|
|
6601
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6602
|
+
"required": true,
|
|
6603
|
+
"type": "string",
|
|
6604
|
+
"in": "path"
|
|
6605
|
+
},
|
|
6606
|
+
{
|
|
6607
|
+
"name": "dataset_id",
|
|
6608
|
+
"description": "Dataset ID",
|
|
6609
|
+
"required": true,
|
|
6610
|
+
"type": "string",
|
|
6611
|
+
"in": "path"
|
|
6612
|
+
},
|
|
6613
|
+
{
|
|
6614
|
+
"name": "limit",
|
|
6615
|
+
"description": "Maximum number of results to return",
|
|
6616
|
+
"required": false,
|
|
6617
|
+
"type": "integer",
|
|
6618
|
+
"in": "query"
|
|
6619
|
+
},
|
|
6620
|
+
{
|
|
6621
|
+
"name": "offset",
|
|
6622
|
+
"description": "Number of results to skip",
|
|
6623
|
+
"required": false,
|
|
6624
|
+
"type": "integer",
|
|
6625
|
+
"in": "query"
|
|
6626
|
+
}
|
|
6627
|
+
]
|
|
6628
|
+
},
|
|
6629
|
+
"create-dataset-item": {
|
|
6630
|
+
serviceClass: "Evaluations",
|
|
6631
|
+
operationId: "createDatasetItem",
|
|
6632
|
+
description: "Adds one test case. `input` is replayed verbatim as the generation's messages, so it must be a non-empty array of `{ role, content }`.",
|
|
6633
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6634
|
+
httpMethod: "post",
|
|
6635
|
+
pathParams: ["project_id", "dataset_id"],
|
|
6636
|
+
queryParams: [],
|
|
6637
|
+
flags: [
|
|
6638
|
+
{
|
|
6639
|
+
"name": "project_id",
|
|
6640
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6641
|
+
"required": true,
|
|
6642
|
+
"type": "string",
|
|
6643
|
+
"in": "path"
|
|
6644
|
+
},
|
|
6645
|
+
{
|
|
6646
|
+
"name": "dataset_id",
|
|
6647
|
+
"description": "Dataset ID",
|
|
6648
|
+
"required": true,
|
|
6649
|
+
"type": "string",
|
|
6650
|
+
"in": "path"
|
|
6651
|
+
},
|
|
6652
|
+
{
|
|
6653
|
+
"name": "input",
|
|
6654
|
+
"description": "Messages replayed verbatim as the generation's input",
|
|
6655
|
+
"required": true,
|
|
6656
|
+
"type": "array",
|
|
6657
|
+
"in": "body"
|
|
6658
|
+
},
|
|
6659
|
+
{
|
|
6660
|
+
"name": "expected_output",
|
|
6661
|
+
"description": "Reference answer for exact_match / llm_judge scorers",
|
|
6662
|
+
"required": false,
|
|
6663
|
+
"type": "string",
|
|
6664
|
+
"in": "body"
|
|
6665
|
+
},
|
|
6666
|
+
{
|
|
6667
|
+
"name": "metadata",
|
|
6668
|
+
"description": "Free-form tags, opaque to the platform",
|
|
6669
|
+
"required": false,
|
|
6670
|
+
"type": "object",
|
|
6671
|
+
"in": "body"
|
|
6672
|
+
}
|
|
6673
|
+
]
|
|
6674
|
+
},
|
|
6675
|
+
"create-dataset-item-from-generation": {
|
|
6676
|
+
serviceClass: "Evaluations",
|
|
6677
|
+
operationId: "createDatasetItemFromGeneration",
|
|
6678
|
+
description: "Promotes a real, completed generation into a test case: its input messages become the item's `input`, and its own answer becomes `expected_output` unless you supply one. Use it to build an evaluation set out of production traffic rather than hand-authoring fixtures. The item is a **copy**, not a view. It keeps working after the source generation's content is purged, and `source_generation_id` goes null if that generation is deleted — a purge can never quietly stop a suite from being runnable. Requires both `evaluations:CreateDataset` and `generations:GetGeneration`: the call copies content out of a generation, so a principal that may not read that generation may not curate it either. Only a **completed** generation can be promoted (`409 GENERATION_NOT_COMPLETED`), and only while its content is still available: an agent or project running with `trace_content_mode: none` never stored the input, and a purged or expired generation no longer has it (`409 GENERATION_CONTENT_UNAVAILABLE`). Generations that predate input recording answer the same way.",
|
|
6679
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6680
|
+
httpMethod: "post",
|
|
6681
|
+
pathParams: ["project_id", "dataset_id"],
|
|
6682
|
+
queryParams: [],
|
|
6683
|
+
flags: [
|
|
6684
|
+
{
|
|
6685
|
+
"name": "project_id",
|
|
6686
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6687
|
+
"required": true,
|
|
6688
|
+
"type": "string",
|
|
6689
|
+
"in": "path"
|
|
6690
|
+
},
|
|
6691
|
+
{
|
|
6692
|
+
"name": "dataset_id",
|
|
6693
|
+
"description": "Dataset ID",
|
|
6694
|
+
"required": true,
|
|
6695
|
+
"type": "string",
|
|
6696
|
+
"in": "path"
|
|
6697
|
+
},
|
|
6698
|
+
{
|
|
6699
|
+
"name": "generation_id",
|
|
6700
|
+
"description": "The completed generation to promote. Must belong to the same project as the dataset.",
|
|
6701
|
+
"required": true,
|
|
6702
|
+
"type": "string",
|
|
6703
|
+
"in": "body"
|
|
6704
|
+
},
|
|
6705
|
+
{
|
|
6706
|
+
"name": "expected_output",
|
|
6707
|
+
"description": "Reference answer. Omit to use the generation's own answer; pass `null` to store the item with no reference answer.",
|
|
6708
|
+
"required": false,
|
|
6709
|
+
"type": "string",
|
|
6710
|
+
"in": "body"
|
|
6711
|
+
},
|
|
6712
|
+
{
|
|
6713
|
+
"name": "metadata",
|
|
6714
|
+
"description": "Free-form tags, opaque to the platform",
|
|
6715
|
+
"required": false,
|
|
6716
|
+
"type": "object",
|
|
6717
|
+
"in": "body"
|
|
6718
|
+
}
|
|
6719
|
+
]
|
|
6720
|
+
},
|
|
6721
|
+
"update-dataset-item": {
|
|
6722
|
+
serviceClass: "Evaluations",
|
|
6723
|
+
operationId: "updateDatasetItem",
|
|
6724
|
+
description: "Updates a test case. Runs that already scored it are unaffected — each result carries its own frozen copy of the input and expected output.",
|
|
6725
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6726
|
+
httpMethod: "put",
|
|
6727
|
+
pathParams: [
|
|
6728
|
+
"project_id",
|
|
6729
|
+
"dataset_id",
|
|
6730
|
+
"item_id"
|
|
6731
|
+
],
|
|
6732
|
+
queryParams: [],
|
|
6733
|
+
flags: [
|
|
6734
|
+
{
|
|
6735
|
+
"name": "project_id",
|
|
6736
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6737
|
+
"required": true,
|
|
6738
|
+
"type": "string",
|
|
6739
|
+
"in": "path"
|
|
6740
|
+
},
|
|
6741
|
+
{
|
|
6742
|
+
"name": "dataset_id",
|
|
6743
|
+
"description": "Dataset ID",
|
|
6744
|
+
"required": true,
|
|
6745
|
+
"type": "string",
|
|
6746
|
+
"in": "path"
|
|
6747
|
+
},
|
|
6748
|
+
{
|
|
6749
|
+
"name": "item_id",
|
|
6750
|
+
"description": "Dataset item ID",
|
|
6751
|
+
"required": true,
|
|
6752
|
+
"type": "string",
|
|
6753
|
+
"in": "path"
|
|
6754
|
+
},
|
|
6755
|
+
{
|
|
6756
|
+
"name": "input",
|
|
6757
|
+
"description": "Messages replayed verbatim as the generation's input",
|
|
6758
|
+
"required": false,
|
|
6759
|
+
"type": "array",
|
|
6760
|
+
"in": "body"
|
|
6761
|
+
},
|
|
6762
|
+
{
|
|
6763
|
+
"name": "expected_output",
|
|
6764
|
+
"description": "",
|
|
6765
|
+
"required": false,
|
|
6766
|
+
"type": "string",
|
|
6767
|
+
"in": "body"
|
|
6768
|
+
},
|
|
6769
|
+
{
|
|
6770
|
+
"name": "metadata",
|
|
6771
|
+
"description": "",
|
|
6772
|
+
"required": false,
|
|
6773
|
+
"type": "object",
|
|
6774
|
+
"in": "body"
|
|
6775
|
+
}
|
|
6776
|
+
]
|
|
6777
|
+
},
|
|
6778
|
+
"delete-dataset-item": {
|
|
6779
|
+
serviceClass: "Evaluations",
|
|
6780
|
+
operationId: "deleteDatasetItem",
|
|
6781
|
+
description: "Deletes a test case. Results of runs that already scored it stay readable; their `dataset_item_id` becomes null.",
|
|
6782
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6783
|
+
httpMethod: "delete",
|
|
6784
|
+
pathParams: [
|
|
6785
|
+
"project_id",
|
|
6786
|
+
"dataset_id",
|
|
6787
|
+
"item_id"
|
|
6788
|
+
],
|
|
6789
|
+
queryParams: [],
|
|
6790
|
+
flags: [
|
|
6791
|
+
{
|
|
6792
|
+
"name": "project_id",
|
|
6793
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6794
|
+
"required": true,
|
|
6795
|
+
"type": "string",
|
|
6796
|
+
"in": "path"
|
|
6797
|
+
},
|
|
6798
|
+
{
|
|
6799
|
+
"name": "dataset_id",
|
|
6800
|
+
"description": "Dataset ID",
|
|
6801
|
+
"required": true,
|
|
6802
|
+
"type": "string",
|
|
6803
|
+
"in": "path"
|
|
6804
|
+
},
|
|
6805
|
+
{
|
|
6806
|
+
"name": "item_id",
|
|
6807
|
+
"description": "Dataset item ID",
|
|
6808
|
+
"required": true,
|
|
6809
|
+
"type": "string",
|
|
6810
|
+
"in": "path"
|
|
6811
|
+
}
|
|
6812
|
+
]
|
|
6813
|
+
},
|
|
6814
|
+
"list-evals": {
|
|
6815
|
+
serviceClass: "Evaluations",
|
|
6816
|
+
operationId: "listEvals",
|
|
6817
|
+
description: "Returns the evals defined in a project",
|
|
6818
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6819
|
+
httpMethod: "get",
|
|
6820
|
+
pathParams: ["project_id"],
|
|
6821
|
+
queryParams: ["limit", "offset"],
|
|
6822
|
+
flags: [
|
|
6823
|
+
{
|
|
6824
|
+
"name": "project_id",
|
|
6825
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6826
|
+
"required": true,
|
|
6827
|
+
"type": "string",
|
|
6828
|
+
"in": "path"
|
|
6829
|
+
},
|
|
6830
|
+
{
|
|
6831
|
+
"name": "limit",
|
|
6832
|
+
"description": "Maximum number of results to return",
|
|
6833
|
+
"required": false,
|
|
6834
|
+
"type": "integer",
|
|
6835
|
+
"in": "query"
|
|
6836
|
+
},
|
|
6837
|
+
{
|
|
6838
|
+
"name": "offset",
|
|
6839
|
+
"description": "Number of results to skip",
|
|
6840
|
+
"required": false,
|
|
6841
|
+
"type": "integer",
|
|
6842
|
+
"in": "query"
|
|
6843
|
+
}
|
|
6844
|
+
]
|
|
6845
|
+
},
|
|
6846
|
+
"create-eval": {
|
|
6847
|
+
serviceClass: "Evaluations",
|
|
6848
|
+
operationId: "createEval",
|
|
6849
|
+
description: "Binds an agent under test to a dataset and a list of scorers. The agent and the dataset must belong to the same project as the eval; a cross-project reference is rejected with 400. Scorer config is frozen here rather than read from the agent at run time, so two runs of the same eval are always judged by the same criteria and their comparison measures the agent instead of the config drifting underneath it. Each scorer `type` may appear at most once.",
|
|
6850
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6851
|
+
httpMethod: "post",
|
|
6852
|
+
pathParams: ["project_id"],
|
|
6853
|
+
queryParams: [],
|
|
6854
|
+
flags: [
|
|
6855
|
+
{
|
|
6856
|
+
"name": "project_id",
|
|
6857
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6858
|
+
"required": true,
|
|
6859
|
+
"type": "string",
|
|
6860
|
+
"in": "path"
|
|
6861
|
+
},
|
|
6862
|
+
{
|
|
6863
|
+
"name": "name",
|
|
6864
|
+
"description": "Unique name within the project",
|
|
6865
|
+
"required": true,
|
|
6866
|
+
"type": "string",
|
|
6867
|
+
"in": "body"
|
|
6868
|
+
},
|
|
6869
|
+
{
|
|
6870
|
+
"name": "agent_id",
|
|
6871
|
+
"description": "The agent under test",
|
|
6872
|
+
"required": true,
|
|
6873
|
+
"type": "string",
|
|
6874
|
+
"in": "body"
|
|
6875
|
+
},
|
|
6876
|
+
{
|
|
6877
|
+
"name": "dataset_id",
|
|
6878
|
+
"description": "The dataset to run it against",
|
|
6879
|
+
"required": true,
|
|
6880
|
+
"type": "string",
|
|
6881
|
+
"in": "body"
|
|
6882
|
+
},
|
|
6883
|
+
{
|
|
6884
|
+
"name": "scorers",
|
|
6885
|
+
"description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.",
|
|
6886
|
+
"required": true,
|
|
6887
|
+
"type": "array",
|
|
6888
|
+
"in": "body"
|
|
6889
|
+
},
|
|
6890
|
+
{
|
|
6891
|
+
"name": "pass_threshold",
|
|
6892
|
+
"description": "0–1. The run passes iff its pass rate — passed items over non-errored items — is at least this. Null reports scores without gating on them.",
|
|
6893
|
+
"required": false,
|
|
6894
|
+
"type": "number",
|
|
6895
|
+
"in": "body"
|
|
6896
|
+
}
|
|
6897
|
+
]
|
|
6898
|
+
},
|
|
6899
|
+
"get-eval": {
|
|
6900
|
+
serviceClass: "Evaluations",
|
|
6901
|
+
operationId: "getEval",
|
|
6902
|
+
description: "Returns a specific eval",
|
|
6903
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6904
|
+
httpMethod: "get",
|
|
6905
|
+
pathParams: ["project_id", "eval_id"],
|
|
6906
|
+
queryParams: [],
|
|
6907
|
+
flags: [{
|
|
6908
|
+
"name": "project_id",
|
|
6909
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6910
|
+
"required": true,
|
|
6911
|
+
"type": "string",
|
|
6912
|
+
"in": "path"
|
|
6913
|
+
}, {
|
|
6914
|
+
"name": "eval_id",
|
|
6915
|
+
"description": "Eval ID",
|
|
6916
|
+
"required": true,
|
|
6917
|
+
"type": "string",
|
|
6918
|
+
"in": "path"
|
|
6919
|
+
}]
|
|
6920
|
+
},
|
|
6921
|
+
"update-eval": {
|
|
6922
|
+
serviceClass: "Evaluations",
|
|
6923
|
+
operationId: "updateEval",
|
|
6924
|
+
description: "Updates an eval. Changing `agent_id` re-validates the scorers against the new agent, since an `output_schema` scorer that was legal against the old one may not be.",
|
|
6925
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6926
|
+
httpMethod: "put",
|
|
6927
|
+
pathParams: ["project_id", "eval_id"],
|
|
6928
|
+
queryParams: [],
|
|
6929
|
+
flags: [
|
|
6930
|
+
{
|
|
6931
|
+
"name": "project_id",
|
|
6932
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6933
|
+
"required": true,
|
|
6934
|
+
"type": "string",
|
|
6935
|
+
"in": "path"
|
|
6936
|
+
},
|
|
6937
|
+
{
|
|
6938
|
+
"name": "eval_id",
|
|
6939
|
+
"description": "Eval ID",
|
|
6940
|
+
"required": true,
|
|
6941
|
+
"type": "string",
|
|
6942
|
+
"in": "path"
|
|
6943
|
+
},
|
|
6944
|
+
{
|
|
6945
|
+
"name": "name",
|
|
6946
|
+
"description": "",
|
|
6947
|
+
"required": false,
|
|
6948
|
+
"type": "string",
|
|
6949
|
+
"in": "body"
|
|
6950
|
+
},
|
|
6951
|
+
{
|
|
6952
|
+
"name": "agent_id",
|
|
6953
|
+
"description": "",
|
|
6954
|
+
"required": false,
|
|
6955
|
+
"type": "string",
|
|
6956
|
+
"in": "body"
|
|
6957
|
+
},
|
|
6958
|
+
{
|
|
6959
|
+
"name": "dataset_id",
|
|
6960
|
+
"description": "",
|
|
6961
|
+
"required": false,
|
|
6962
|
+
"type": "string",
|
|
6963
|
+
"in": "body"
|
|
6964
|
+
},
|
|
6965
|
+
{
|
|
6966
|
+
"name": "scorers",
|
|
6967
|
+
"description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.",
|
|
6968
|
+
"required": false,
|
|
6969
|
+
"type": "array",
|
|
6970
|
+
"in": "body"
|
|
6971
|
+
},
|
|
6972
|
+
{
|
|
6973
|
+
"name": "pass_threshold",
|
|
6974
|
+
"description": "",
|
|
6975
|
+
"required": false,
|
|
6976
|
+
"type": "number",
|
|
6977
|
+
"in": "body"
|
|
6978
|
+
}
|
|
6979
|
+
]
|
|
6980
|
+
},
|
|
6981
|
+
"delete-eval": {
|
|
6982
|
+
serviceClass: "Evaluations",
|
|
6983
|
+
operationId: "deleteEval",
|
|
6984
|
+
description: "Deletes an eval, its runs, and their results",
|
|
6985
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
6986
|
+
httpMethod: "delete",
|
|
6987
|
+
pathParams: ["project_id", "eval_id"],
|
|
6988
|
+
queryParams: [],
|
|
6989
|
+
flags: [{
|
|
6990
|
+
"name": "project_id",
|
|
6991
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6992
|
+
"required": true,
|
|
6993
|
+
"type": "string",
|
|
6994
|
+
"in": "path"
|
|
6995
|
+
}, {
|
|
6996
|
+
"name": "eval_id",
|
|
6997
|
+
"description": "Eval ID",
|
|
6998
|
+
"required": true,
|
|
6999
|
+
"type": "string",
|
|
7000
|
+
"in": "path"
|
|
7001
|
+
}]
|
|
7002
|
+
},
|
|
7003
|
+
"list-eval-runs": {
|
|
7004
|
+
serviceClass: "Evaluations",
|
|
7005
|
+
operationId: "listEvalRuns",
|
|
7006
|
+
description: "Returns an eval's runs, newest first",
|
|
7007
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
7008
|
+
httpMethod: "get",
|
|
7009
|
+
pathParams: ["project_id", "eval_id"],
|
|
7010
|
+
queryParams: ["limit", "offset"],
|
|
7011
|
+
flags: [
|
|
7012
|
+
{
|
|
7013
|
+
"name": "project_id",
|
|
7014
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7015
|
+
"required": true,
|
|
7016
|
+
"type": "string",
|
|
7017
|
+
"in": "path"
|
|
7018
|
+
},
|
|
7019
|
+
{
|
|
7020
|
+
"name": "eval_id",
|
|
7021
|
+
"description": "Eval ID",
|
|
7022
|
+
"required": true,
|
|
7023
|
+
"type": "string",
|
|
7024
|
+
"in": "path"
|
|
7025
|
+
},
|
|
7026
|
+
{
|
|
7027
|
+
"name": "limit",
|
|
7028
|
+
"description": "Maximum number of results to return",
|
|
7029
|
+
"required": false,
|
|
7030
|
+
"type": "integer",
|
|
7031
|
+
"in": "query"
|
|
7032
|
+
},
|
|
7033
|
+
{
|
|
7034
|
+
"name": "offset",
|
|
7035
|
+
"description": "Number of results to skip",
|
|
7036
|
+
"required": false,
|
|
7037
|
+
"type": "integer",
|
|
7038
|
+
"in": "query"
|
|
7039
|
+
}
|
|
7040
|
+
]
|
|
7041
|
+
},
|
|
7042
|
+
"start-eval-run": {
|
|
7043
|
+
serviceClass: "Evaluations",
|
|
7044
|
+
operationId: "startEvalRun",
|
|
7045
|
+
description: "Runs the eval against its dataset, creating one real agent generation per item and scoring the outputs. `wait: true` executes the run synchronously and returns it terminal, with its scores. The dataset is capped at 25 items for a synchronous run; a larger one is rejected with 400 rather than partially scored. `wait: false` (the default) enqueues one task per item and returns immediately with `status: \"queued\"`. A worker executes the items and the run settles itself; poll `GET /evals/{eval_id}/runs/{eval_run_id}` for the terminal status. There is no item cap on a queued run. The whole run is pinned to **one** agent version, stamped on `agent_version`: pass one explicitly to evaluate a canary before promoting it, or omit it to use the active release's stable version (or the live draft when no release is in effect). Without the pin, release assignment would bucket each item independently and blend two configs into a single score. With `baseline_run_id`, the finished run's `aggregate_scores.baseline` carries per-scorer deltas against that run, computed over the items present and scorable in **both** runs, with the divergence counted. A delta over a shifted dataset is therefore never presented as a clean comparison.",
|
|
7046
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
7047
|
+
httpMethod: "post",
|
|
7048
|
+
pathParams: ["project_id", "eval_id"],
|
|
7049
|
+
queryParams: [],
|
|
7050
|
+
flags: [
|
|
7051
|
+
{
|
|
7052
|
+
"name": "project_id",
|
|
7053
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7054
|
+
"required": true,
|
|
7055
|
+
"type": "string",
|
|
7056
|
+
"in": "path"
|
|
7057
|
+
},
|
|
7058
|
+
{
|
|
7059
|
+
"name": "eval_id",
|
|
7060
|
+
"description": "Eval ID",
|
|
7061
|
+
"required": true,
|
|
7062
|
+
"type": "string",
|
|
7063
|
+
"in": "path"
|
|
7064
|
+
},
|
|
7065
|
+
{
|
|
7066
|
+
"name": "wait",
|
|
7067
|
+
"description": "True runs the eval synchronously (25-item cap) and returns a terminal run with its scores. False — the default — enqueues the items and returns a `queued` run immediately.",
|
|
7068
|
+
"required": false,
|
|
7069
|
+
"type": "boolean",
|
|
7070
|
+
"in": "body"
|
|
7071
|
+
},
|
|
7072
|
+
{
|
|
7073
|
+
"name": "agent_version",
|
|
7074
|
+
"description": "An archived agent version to evaluate. Defaults to the active release's stable version, or the live draft version when no release is in effect.",
|
|
7075
|
+
"required": false,
|
|
7076
|
+
"type": "integer",
|
|
7077
|
+
"in": "body"
|
|
7078
|
+
},
|
|
7079
|
+
{
|
|
7080
|
+
"name": "baseline_run_id",
|
|
7081
|
+
"description": "A terminal run of the same eval to compare against. The finished run's `aggregate_scores.baseline` reports per-scorer deltas over the item intersection. A run of a different eval is rejected with 400.",
|
|
7082
|
+
"required": false,
|
|
7083
|
+
"type": "string",
|
|
7084
|
+
"in": "body"
|
|
7085
|
+
}
|
|
7086
|
+
]
|
|
7087
|
+
},
|
|
7088
|
+
"get-eval-run": {
|
|
7089
|
+
serviceClass: "Evaluations",
|
|
7090
|
+
operationId: "getEvalRun",
|
|
7091
|
+
description: "Returns a run's status, counts, and aggregate scores",
|
|
7092
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
7093
|
+
httpMethod: "get",
|
|
7094
|
+
pathParams: [
|
|
7095
|
+
"project_id",
|
|
7096
|
+
"eval_id",
|
|
7097
|
+
"eval_run_id"
|
|
7098
|
+
],
|
|
7099
|
+
queryParams: [],
|
|
7100
|
+
flags: [
|
|
7101
|
+
{
|
|
7102
|
+
"name": "project_id",
|
|
7103
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7104
|
+
"required": true,
|
|
7105
|
+
"type": "string",
|
|
7106
|
+
"in": "path"
|
|
7107
|
+
},
|
|
7108
|
+
{
|
|
7109
|
+
"name": "eval_id",
|
|
7110
|
+
"description": "Eval ID",
|
|
7111
|
+
"required": true,
|
|
7112
|
+
"type": "string",
|
|
7113
|
+
"in": "path"
|
|
7114
|
+
},
|
|
7115
|
+
{
|
|
7116
|
+
"name": "eval_run_id",
|
|
7117
|
+
"description": "Eval run ID",
|
|
7118
|
+
"required": true,
|
|
7119
|
+
"type": "string",
|
|
7120
|
+
"in": "path"
|
|
7121
|
+
}
|
|
7122
|
+
]
|
|
7123
|
+
},
|
|
7124
|
+
"list-eval-results": {
|
|
7125
|
+
serviceClass: "Evaluations",
|
|
7126
|
+
operationId: "listEvalResults",
|
|
7127
|
+
description: "Returns the per-item results of a run, oldest first",
|
|
7128
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
7129
|
+
httpMethod: "get",
|
|
7130
|
+
pathParams: [
|
|
7131
|
+
"project_id",
|
|
7132
|
+
"eval_id",
|
|
7133
|
+
"eval_run_id"
|
|
7134
|
+
],
|
|
7135
|
+
queryParams: ["limit", "offset"],
|
|
7136
|
+
flags: [
|
|
7137
|
+
{
|
|
7138
|
+
"name": "project_id",
|
|
7139
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7140
|
+
"required": true,
|
|
7141
|
+
"type": "string",
|
|
7142
|
+
"in": "path"
|
|
7143
|
+
},
|
|
7144
|
+
{
|
|
7145
|
+
"name": "eval_id",
|
|
7146
|
+
"description": "Eval ID",
|
|
7147
|
+
"required": true,
|
|
7148
|
+
"type": "string",
|
|
7149
|
+
"in": "path"
|
|
7150
|
+
},
|
|
7151
|
+
{
|
|
7152
|
+
"name": "eval_run_id",
|
|
7153
|
+
"description": "Eval run ID",
|
|
7154
|
+
"required": true,
|
|
7155
|
+
"type": "string",
|
|
7156
|
+
"in": "path"
|
|
7157
|
+
},
|
|
7158
|
+
{
|
|
7159
|
+
"name": "limit",
|
|
7160
|
+
"description": "Maximum number of results to return",
|
|
7161
|
+
"required": false,
|
|
7162
|
+
"type": "integer",
|
|
7163
|
+
"in": "query"
|
|
7164
|
+
},
|
|
7165
|
+
{
|
|
7166
|
+
"name": "offset",
|
|
7167
|
+
"description": "Number of results to skip",
|
|
7168
|
+
"required": false,
|
|
7169
|
+
"type": "integer",
|
|
7170
|
+
"in": "query"
|
|
7171
|
+
}
|
|
7172
|
+
]
|
|
7173
|
+
},
|
|
7174
|
+
"cancel-eval-run": {
|
|
7175
|
+
serviceClass: "Evaluations",
|
|
7176
|
+
operationId: "cancelEvalRun",
|
|
7177
|
+
description: "Cancels a queued or running run: its outstanding item tasks are dropped so it stops consuming provider budget, and the run settles as `canceled`. Results already written are kept — they are real measurements of generations that were really paid for — and `completed_count` / `errored_count` report what ran. `aggregate_scores` is deliberately left null: a partial roll-up in the same field a completed run uses would read as a whole-dataset verdict. A run that has already finished is rejected with 400.",
|
|
7178
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
|
|
7179
|
+
httpMethod: "post",
|
|
7180
|
+
pathParams: [
|
|
7181
|
+
"project_id",
|
|
7182
|
+
"eval_id",
|
|
7183
|
+
"eval_run_id"
|
|
7184
|
+
],
|
|
7185
|
+
queryParams: [],
|
|
7186
|
+
flags: [
|
|
7187
|
+
{
|
|
7188
|
+
"name": "project_id",
|
|
7189
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7190
|
+
"required": true,
|
|
7191
|
+
"type": "string",
|
|
7192
|
+
"in": "path"
|
|
7193
|
+
},
|
|
7194
|
+
{
|
|
7195
|
+
"name": "eval_id",
|
|
7196
|
+
"description": "Eval ID",
|
|
7197
|
+
"required": true,
|
|
7198
|
+
"type": "string",
|
|
7199
|
+
"in": "path"
|
|
7200
|
+
},
|
|
7201
|
+
{
|
|
7202
|
+
"name": "eval_run_id",
|
|
7203
|
+
"description": "Eval run ID",
|
|
7204
|
+
"required": true,
|
|
7205
|
+
"type": "string",
|
|
7206
|
+
"in": "path"
|
|
7207
|
+
}
|
|
7208
|
+
]
|
|
7209
|
+
},
|
|
7210
|
+
"list-generations": {
|
|
7211
|
+
serviceClass: "Generations",
|
|
7212
|
+
operationId: "listGenerations",
|
|
7213
|
+
description: "Returns generations the caller can access, optionally filtered by agent, trace, and status. Replaces the former per-trace generations endpoint (use the trace_id query filter).",
|
|
7214
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/generations",
|
|
7215
|
+
httpMethod: "get",
|
|
7216
|
+
pathParams: ["project_id"],
|
|
7217
|
+
queryParams: [
|
|
7218
|
+
"agent_id",
|
|
7219
|
+
"trace_id",
|
|
7220
|
+
"initiator_generation_id",
|
|
7221
|
+
"status",
|
|
7222
|
+
"limit",
|
|
7223
|
+
"offset"
|
|
6081
7224
|
],
|
|
6082
7225
|
flags: [
|
|
6083
7226
|
{
|
|
@@ -6418,6 +7561,122 @@ const routes = {
|
|
|
6418
7561
|
"in": "path"
|
|
6419
7562
|
}]
|
|
6420
7563
|
},
|
|
7564
|
+
"list-models": {
|
|
7565
|
+
serviceClass: "Models",
|
|
7566
|
+
operationId: "listModels",
|
|
7567
|
+
description: "Lists catalog models, sorted by id. Filter by vendor, provider, input/output modality, status, or `managed` — the last being the axis that decides whether a model is usable without bringing your own provider credentials, so `?managed=true&status=available` is the set a project can enable today.",
|
|
7568
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/models",
|
|
7569
|
+
httpMethod: "get",
|
|
7570
|
+
pathParams: [],
|
|
7571
|
+
queryParams: [
|
|
7572
|
+
"limit",
|
|
7573
|
+
"cursor",
|
|
7574
|
+
"vendor",
|
|
7575
|
+
"provider",
|
|
7576
|
+
"modality",
|
|
7577
|
+
"status",
|
|
7578
|
+
"managed"
|
|
7579
|
+
],
|
|
7580
|
+
flags: [
|
|
7581
|
+
{
|
|
7582
|
+
"name": "limit",
|
|
7583
|
+
"description": "Maximum items per page — an integer from 1 to 100 (default 20).",
|
|
7584
|
+
"required": false,
|
|
7585
|
+
"type": "integer",
|
|
7586
|
+
"in": "query"
|
|
7587
|
+
},
|
|
7588
|
+
{
|
|
7589
|
+
"name": "cursor",
|
|
7590
|
+
"description": "Opaque pagination cursor from a previous response's next_cursor.",
|
|
7591
|
+
"required": false,
|
|
7592
|
+
"type": "string",
|
|
7593
|
+
"in": "query"
|
|
7594
|
+
},
|
|
7595
|
+
{
|
|
7596
|
+
"name": "vendor",
|
|
7597
|
+
"description": "Filter by model maker (e.g. anthropic, amazon, meta).",
|
|
7598
|
+
"required": false,
|
|
7599
|
+
"type": "string",
|
|
7600
|
+
"in": "query"
|
|
7601
|
+
},
|
|
7602
|
+
{
|
|
7603
|
+
"name": "provider",
|
|
7604
|
+
"description": "Filter by the provider slug that serves the model.",
|
|
7605
|
+
"required": false,
|
|
7606
|
+
"type": "string",
|
|
7607
|
+
"in": "query"
|
|
7608
|
+
},
|
|
7609
|
+
{
|
|
7610
|
+
"name": "modality",
|
|
7611
|
+
"description": "Filter to models whose input or output modalities include this value (e.g. text, image, embedding, speech).\n",
|
|
7612
|
+
"required": false,
|
|
7613
|
+
"type": "string",
|
|
7614
|
+
"in": "query"
|
|
7615
|
+
},
|
|
7616
|
+
{
|
|
7617
|
+
"name": "status",
|
|
7618
|
+
"description": "Filter by lifecycle status.",
|
|
7619
|
+
"required": false,
|
|
7620
|
+
"type": "string",
|
|
7621
|
+
"in": "query"
|
|
7622
|
+
},
|
|
7623
|
+
{
|
|
7624
|
+
"name": "managed",
|
|
7625
|
+
"description": "Filter by whether the model can be enabled as a naturali-managed provider — `managed=true` is the set you can pass to `POST /v1/projects/{project_id}/models/{model_id}/providers`. Omit to leave the catalog unfiltered on this axis; `false` returns only the BYOK-only models. Any other value is a 400.\n",
|
|
7626
|
+
"required": false,
|
|
7627
|
+
"type": "boolean",
|
|
7628
|
+
"in": "query"
|
|
7629
|
+
}
|
|
7630
|
+
]
|
|
7631
|
+
},
|
|
7632
|
+
"get-model": {
|
|
7633
|
+
serviceClass: "Models",
|
|
7634
|
+
operationId: "getModel",
|
|
7635
|
+
description: "Get a model",
|
|
7636
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/models",
|
|
7637
|
+
httpMethod: "get",
|
|
7638
|
+
pathParams: ["model_id"],
|
|
7639
|
+
queryParams: [],
|
|
7640
|
+
flags: [{
|
|
7641
|
+
"name": "model_id",
|
|
7642
|
+
"description": "Public model id.",
|
|
7643
|
+
"required": true,
|
|
7644
|
+
"type": "string",
|
|
7645
|
+
"in": "path"
|
|
7646
|
+
}]
|
|
7647
|
+
},
|
|
7648
|
+
"enable-managed-model": {
|
|
7649
|
+
serviceClass: "Models",
|
|
7650
|
+
operationId: "enableManagedModel",
|
|
7651
|
+
description: "Provisions a managed provider running this model in the project. The provider needs no credentials of yours — it runs on naturali's own model access — and is priced from the catalog the moment it is created, so its usage is metered from the first generation. The created resource is an ordinary provider: read, update and delete it through [`GET /v1/projects/{project_id}/ai-providers/{ai_provider_id}`](/docs/api/ai-providers/get-ai-provider) like any other. Requires the `admin` role in the project. Only models with `managed: true` can be enabled; anything else is a 400.",
|
|
7652
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/models",
|
|
7653
|
+
httpMethod: "post",
|
|
7654
|
+
pathParams: ["project_id", "model_id"],
|
|
7655
|
+
queryParams: [],
|
|
7656
|
+
flags: [
|
|
7657
|
+
{
|
|
7658
|
+
"name": "project_id",
|
|
7659
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7660
|
+
"required": true,
|
|
7661
|
+
"type": "string",
|
|
7662
|
+
"in": "path"
|
|
7663
|
+
},
|
|
7664
|
+
{
|
|
7665
|
+
"name": "model_id",
|
|
7666
|
+
"description": "Public model id.",
|
|
7667
|
+
"required": true,
|
|
7668
|
+
"type": "string",
|
|
7669
|
+
"in": "path"
|
|
7670
|
+
},
|
|
7671
|
+
{
|
|
7672
|
+
"name": "name",
|
|
7673
|
+
"description": "Provider configuration name. Defaults to the model id.",
|
|
7674
|
+
"required": false,
|
|
7675
|
+
"type": "string",
|
|
7676
|
+
"in": "body"
|
|
7677
|
+
}
|
|
7678
|
+
]
|
|
7679
|
+
},
|
|
6421
7680
|
"list-projects": {
|
|
6422
7681
|
serviceClass: "Projects",
|
|
6423
7682
|
operationId: "listProjects",
|
|
@@ -7634,6 +8893,114 @@ const routes = {
|
|
|
7634
8893
|
}
|
|
7635
8894
|
]
|
|
7636
8895
|
},
|
|
8896
|
+
"list-traces": {
|
|
8897
|
+
serviceClass: "Traces",
|
|
8898
|
+
operationId: "listTraces",
|
|
8899
|
+
description: "Returns a paginated list of execution traces for the project.",
|
|
8900
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
|
|
8901
|
+
httpMethod: "get",
|
|
8902
|
+
pathParams: ["project_id"],
|
|
8903
|
+
queryParams: ["limit", "offset"],
|
|
8904
|
+
flags: [
|
|
8905
|
+
{
|
|
8906
|
+
"name": "project_id",
|
|
8907
|
+
"description": "Project public ID (proj_ prefix).",
|
|
8908
|
+
"required": true,
|
|
8909
|
+
"type": "string",
|
|
8910
|
+
"in": "path"
|
|
8911
|
+
},
|
|
8912
|
+
{
|
|
8913
|
+
"name": "limit",
|
|
8914
|
+
"description": "Maximum number of results to return",
|
|
8915
|
+
"required": false,
|
|
8916
|
+
"type": "integer",
|
|
8917
|
+
"in": "query"
|
|
8918
|
+
},
|
|
8919
|
+
{
|
|
8920
|
+
"name": "offset",
|
|
8921
|
+
"description": "Number of results to skip",
|
|
8922
|
+
"required": false,
|
|
8923
|
+
"type": "integer",
|
|
8924
|
+
"in": "query"
|
|
8925
|
+
}
|
|
8926
|
+
]
|
|
8927
|
+
},
|
|
8928
|
+
"get-trace": {
|
|
8929
|
+
serviceClass: "Traces",
|
|
8930
|
+
operationId: "getTrace",
|
|
8931
|
+
description: "Returns a single trace by ID.",
|
|
8932
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
|
|
8933
|
+
httpMethod: "get",
|
|
8934
|
+
pathParams: ["project_id", "trace_id"],
|
|
8935
|
+
queryParams: [],
|
|
8936
|
+
flags: [{
|
|
8937
|
+
"name": "project_id",
|
|
8938
|
+
"description": "Project public ID (proj_ prefix).",
|
|
8939
|
+
"required": true,
|
|
8940
|
+
"type": "string",
|
|
8941
|
+
"in": "path"
|
|
8942
|
+
}, {
|
|
8943
|
+
"name": "trace_id",
|
|
8944
|
+
"description": "Public ID of the trace",
|
|
8945
|
+
"required": true,
|
|
8946
|
+
"type": "string",
|
|
8947
|
+
"in": "path"
|
|
8948
|
+
}]
|
|
8949
|
+
},
|
|
8950
|
+
"get-trace-tree": {
|
|
8951
|
+
serviceClass: "Traces",
|
|
8952
|
+
operationId: "getTraceTree",
|
|
8953
|
+
description: "Returns the full execution tree rooted at the given trace (or its root if the given trace is a child). Each node represents one agent's execution session. The `children` array contains traces triggered by sub-agent tool calls from that trace.",
|
|
8954
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
|
|
8955
|
+
httpMethod: "get",
|
|
8956
|
+
pathParams: ["project_id", "trace_id"],
|
|
8957
|
+
queryParams: ["include"],
|
|
8958
|
+
flags: [
|
|
8959
|
+
{
|
|
8960
|
+
"name": "project_id",
|
|
8961
|
+
"description": "Project public ID (proj_ prefix).",
|
|
8962
|
+
"required": true,
|
|
8963
|
+
"type": "string",
|
|
8964
|
+
"in": "path"
|
|
8965
|
+
},
|
|
8966
|
+
{
|
|
8967
|
+
"name": "trace_id",
|
|
8968
|
+
"description": "Public ID of any trace in the tree (root or child)",
|
|
8969
|
+
"required": true,
|
|
8970
|
+
"type": "string",
|
|
8971
|
+
"in": "path"
|
|
8972
|
+
},
|
|
8973
|
+
{
|
|
8974
|
+
"name": "include",
|
|
8975
|
+
"description": "Comma-separated list of related resources to embed on each node. Supported value: `generations` — attaches all generations that belong to each trace node (including sub-agent generations linked via `initiator_generation_id`).\n",
|
|
8976
|
+
"required": false,
|
|
8977
|
+
"type": "string",
|
|
8978
|
+
"in": "query"
|
|
8979
|
+
}
|
|
8980
|
+
]
|
|
8981
|
+
},
|
|
8982
|
+
"purge-trace-content": {
|
|
8983
|
+
serviceClass: "Traces",
|
|
8984
|
+
operationId: "purgeTraceContent",
|
|
8985
|
+
description: "Deletes the trace's steps object from storage and clears its content columns (`file_id`, `error`), cascading to every descendant trace and to all of their generations. A descendant holds its own steps object covering the same run, so the cascade is what makes the erasure complete rather than merely partial. The rows survive as auditable skeletons with `content_redacted_at` set — ids, timestamps, step counts, and the generations' usage-attribution fields are preserved, because the billing and audit ledger must outlive a tenant's erasure of the content. A purged trace therefore reads back as a skeleton, not a 404: a 404 would prove nothing. Idempotent — purging an already-purged trace succeeds and leaves the original `content_redacted_at` in place.",
|
|
8986
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
|
|
8987
|
+
httpMethod: "delete",
|
|
8988
|
+
pathParams: ["project_id", "trace_id"],
|
|
8989
|
+
queryParams: [],
|
|
8990
|
+
flags: [{
|
|
8991
|
+
"name": "project_id",
|
|
8992
|
+
"description": "Project public ID (proj_ prefix).",
|
|
8993
|
+
"required": true,
|
|
8994
|
+
"type": "string",
|
|
8995
|
+
"in": "path"
|
|
8996
|
+
}, {
|
|
8997
|
+
"name": "trace_id",
|
|
8998
|
+
"description": "Public ID of the trace",
|
|
8999
|
+
"required": true,
|
|
9000
|
+
"type": "string",
|
|
9001
|
+
"in": "path"
|
|
9002
|
+
}]
|
|
9003
|
+
},
|
|
7637
9004
|
"get-current-user": {
|
|
7638
9005
|
serviceClass: "Users",
|
|
7639
9006
|
operationId: "getCurrentUser",
|