Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.2"
".": "0.1.0-alpha.3"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 175
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-cb3bf9b21459cad24410206c27a32fd31ef6cf86711700597549dbbd0d634002.yml
openapi_spec_hash: 6a9149a81ba15e7c5c5c1f4d77daad92
config_hash: bad49c3bf949d5168ec3896bedff253a
configured_endpoints: 189
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-0778b2e9d56c826f92ee69ef081d8d73fd94c139b85e11becaa88bf1cbe95fb9.yml
openapi_spec_hash: 49daca0dd735cad7200ca1c741a5dd43
config_hash: fad48c8ac796b240fe3b90181586d1a4
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 0.1.0-alpha.3 (2025-12-17)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/digitalocean/gradient-typescript/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

### Features

* add waitForAgentReady helper for agent deployment polling ([#9](https://github.com/digitalocean/gradient-typescript/issues/9)) ([48a9366](https://github.com/digitalocean/gradient-typescript/commit/48a9366dbb8879bb6a4be7b59a6bba26840d50d9))
* **api:** include indexing jobs ([b283f6f](https://github.com/digitalocean/gradient-typescript/commit/b283f6f123067b864841df1eb21e5f1d6da51c93))
* **api:** manual updates ([5c777eb](https://github.com/digitalocean/gradient-typescript/commit/5c777ebfe13fa14902807c294c0c526b875e5213))
* **api:** manual updates ([8438034](https://github.com/digitalocean/gradient-typescript/commit/84380346540b47a0ca718615203a977cce8a4fd5))
* knowledge base indexing poller ([#14](https://github.com/digitalocean/gradient-typescript/issues/14)) ([04e35f0](https://github.com/digitalocean/gradient-typescript/commit/04e35f0553c622fe33b422f611bb7f1592346510))
* **knowledge-bases:** add waitForDatabase polling helper ([#8](https://github.com/digitalocean/gradient-typescript/issues/8)) ([12d1af3](https://github.com/digitalocean/gradient-typescript/commit/12d1af3c82962f420eef7160b8ac043aa96087f7))


### Bug Fixes

* **docs:** remove extraneous example object fields ([567e164](https://github.com/digitalocean/gradient-typescript/commit/567e16465f480fa863752fe01c1fa9aeadf5c6e2))
* **mcp:** correct code tool API endpoint ([5f8590e](https://github.com/digitalocean/gradient-typescript/commit/5f8590e624c7ccb2f6828716da50348854c60df5))
* **mcp:** return correct lines on typescript errors ([8319037](https://github.com/digitalocean/gradient-typescript/commit/8319037b19e6053a35eb81458d031db739e83e19))


### Chores

* **client:** fix logger property type ([8fd08d8](https://github.com/digitalocean/gradient-typescript/commit/8fd08d8830ec5a7443751eaf33eb11b6bf12114e))
* formatting fixes ([b2388ec](https://github.com/digitalocean/gradient-typescript/commit/b2388ec757d21bdb00365969af5b083ae1e574b0))
* **internal:** codegen related update ([7f7aade](https://github.com/digitalocean/gradient-typescript/commit/7f7aade29a94a1ea9284b1f63967c94b33c6d6b4))
* **internal:** codegen related update ([7e9ea70](https://github.com/digitalocean/gradient-typescript/commit/7e9ea70cca7d7cc04be9e3981461972c51bfc89f))
* **internal:** upgrade eslint ([e5f9760](https://github.com/digitalocean/gradient-typescript/commit/e5f976075b297f41de5b8280aefa231c5eecf750))


### Refactors

* normalize wait-for implementations ([#20](https://github.com/digitalocean/gradient-typescript/issues/20)) ([30419d1](https://github.com/digitalocean/gradient-typescript/commit/30419d1f1b238a5d2fcb4720c9599c66daa78ce9))

## 0.1.0-alpha.2 (2025-10-16)

Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/digitalocean/gradient-typescript/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
Expand Down
68 changes: 58 additions & 10 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,6 @@ Methods:
- <code title="get /v2/gen-ai/workspaces/{workspace_uuid}/agents">client.agents.evaluationMetrics.workspaces.agents.<a href="./src/resources/agents/evaluation-metrics/workspaces/agents.ts">list</a>(workspaceUuid, { ...params }) -> AgentListResponse</code>
- <code title="put /v2/gen-ai/workspaces/{workspace_uuid}/agents">client.agents.evaluationMetrics.workspaces.agents.<a href="./src/resources/agents/evaluation-metrics/workspaces/agents.ts">move</a>(workspaceUuid, { ...params }) -> AgentMoveResponse</code>

### Models

Types:

- <code><a href="./src/resources/agents/evaluation-metrics/models.ts">ModelListResponse</a></code>

Methods:

- <code title="get /v2/gen-ai/models">client.agents.evaluationMetrics.models.<a href="./src/resources/agents/evaluation-metrics/models.ts">list</a>({ ...params }) -> ModelListResponse</code>

### Anthropic

#### Keys
Expand Down Expand Up @@ -211,6 +201,20 @@ Methods:

- <code title="post /v2/gen-ai/oauth2/dropbox/tokens">client.agents.evaluationMetrics.oauth2.dropbox.<a href="./src/resources/agents/evaluation-metrics/oauth2/dropbox.ts">createTokens</a>({ ...params }) -> DropboxCreateTokensResponse</code>

### ScheduledIndexing

Types:

- <code><a href="./src/resources/agents/evaluation-metrics/scheduled-indexing.ts">ScheduledIndexingCreateResponse</a></code>
- <code><a href="./src/resources/agents/evaluation-metrics/scheduled-indexing.ts">ScheduledIndexingRetrieveResponse</a></code>
- <code><a href="./src/resources/agents/evaluation-metrics/scheduled-indexing.ts">ScheduledIndexingDeleteResponse</a></code>

Methods:

- <code title="post /v2/gen-ai/scheduled-indexing">client.agents.evaluationMetrics.scheduledIndexing.<a href="./src/resources/agents/evaluation-metrics/scheduled-indexing.ts">create</a>({ ...params }) -> ScheduledIndexingCreateResponse</code>
- <code title="get /v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}">client.agents.evaluationMetrics.scheduledIndexing.<a href="./src/resources/agents/evaluation-metrics/scheduled-indexing.ts">retrieve</a>(knowledgeBaseUuid) -> ScheduledIndexingRetrieveResponse</code>
- <code title="delete /v2/gen-ai/scheduled-indexing/{uuid}">client.agents.evaluationMetrics.scheduledIndexing.<a href="./src/resources/agents/evaluation-metrics/scheduled-indexing.ts">delete</a>(uuid) -> ScheduledIndexingDeleteResponse</code>

## EvaluationRuns

Types:
Expand Down Expand Up @@ -700,6 +704,7 @@ Types:
- <code><a href="./src/resources/knowledge-bases/knowledge-bases.ts">KnowledgeBaseUpdateResponse</a></code>
- <code><a href="./src/resources/knowledge-bases/knowledge-bases.ts">KnowledgeBaseListResponse</a></code>
- <code><a href="./src/resources/knowledge-bases/knowledge-bases.ts">KnowledgeBaseDeleteResponse</a></code>
- <code><a href="./src/resources/knowledge-bases/knowledge-bases.ts">KnowledgeBaseListIndexingJobsResponse</a></code>

Methods:

Expand All @@ -708,6 +713,7 @@ Methods:
- <code title="put /v2/gen-ai/knowledge_bases/{uuid}">client.knowledgeBases.<a href="./src/resources/knowledge-bases/knowledge-bases.ts">update</a>(pathUuid, { ...params }) -> KnowledgeBaseUpdateResponse</code>
- <code title="get /v2/gen-ai/knowledge_bases">client.knowledgeBases.<a href="./src/resources/knowledge-bases/knowledge-bases.ts">list</a>({ ...params }) -> KnowledgeBaseListResponse</code>
- <code title="delete /v2/gen-ai/knowledge_bases/{uuid}">client.knowledgeBases.<a href="./src/resources/knowledge-bases/knowledge-bases.ts">delete</a>(uuid) -> KnowledgeBaseDeleteResponse</code>
- <code title="get /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/indexing_jobs">client.knowledgeBases.<a href="./src/resources/knowledge-bases/knowledge-bases.ts">listIndexingJobs</a>(knowledgeBaseUuid) -> KnowledgeBaseListIndexingJobsResponse</code>

## DataSources

Expand Down Expand Up @@ -740,6 +746,7 @@ Types:
- <code><a href="./src/resources/knowledge-bases/indexing-jobs.ts">IndexingJobRetrieveResponse</a></code>
- <code><a href="./src/resources/knowledge-bases/indexing-jobs.ts">IndexingJobListResponse</a></code>
- <code><a href="./src/resources/knowledge-bases/indexing-jobs.ts">IndexingJobRetrieveDataSourcesResponse</a></code>
- <code><a href="./src/resources/knowledge-bases/indexing-jobs.ts">IndexingJobRetrieveSignedURLResponse</a></code>
- <code><a href="./src/resources/knowledge-bases/indexing-jobs.ts">IndexingJobUpdateCancelResponse</a></code>

Methods:
Expand All @@ -748,6 +755,7 @@ Methods:
- <code title="get /v2/gen-ai/indexing_jobs/{uuid}">client.knowledgeBases.indexingJobs.<a href="./src/resources/knowledge-bases/indexing-jobs.ts">retrieve</a>(uuid) -> IndexingJobRetrieveResponse</code>
- <code title="get /v2/gen-ai/indexing_jobs">client.knowledgeBases.indexingJobs.<a href="./src/resources/knowledge-bases/indexing-jobs.ts">list</a>({ ...params }) -> IndexingJobListResponse</code>
- <code title="get /v2/gen-ai/indexing_jobs/{indexing_job_uuid}/data_sources">client.knowledgeBases.indexingJobs.<a href="./src/resources/knowledge-bases/indexing-jobs.ts">retrieveDataSources</a>(indexingJobUuid) -> IndexingJobRetrieveDataSourcesResponse</code>
- <code title="get /v2/gen-ai/indexing_jobs/{indexing_job_uuid}/details_signed_url">client.knowledgeBases.indexingJobs.<a href="./src/resources/knowledge-bases/indexing-jobs.ts">retrieveSignedURL</a>(indexingJobUuid) -> IndexingJobRetrieveSignedURLResponse</code>
- <code title="put /v2/gen-ai/indexing_jobs/{uuid}/cancel">client.knowledgeBases.indexingJobs.<a href="./src/resources/knowledge-bases/indexing-jobs.ts">updateCancel</a>(pathUuid, { ...params }) -> IndexingJobUpdateCancelResponse</code>
- <code title="polling helper">client.knowledgeBases.indexingJobs.<a href="./src/resources/knowledge-bases/indexing-jobs.ts">waitForCompletion</a>(uuid, { ...options }) -> IndexingJobRetrieveResponse</code>

Expand Down Expand Up @@ -835,3 +843,43 @@ Methods:
- <code title="put /v2/databases/{database_cluster_uuid}/schema-registry/config">client.databases.schemaRegistry.config.<a href="./src/resources/databases/schema-registry/config.ts">update</a>(databaseClusterUuid, { ...params }) -> ConfigUpdateResponse</code>
- <code title="get /v2/databases/{database_cluster_uuid}/schema-registry/config/{subject_name}">client.databases.schemaRegistry.config.<a href="./src/resources/databases/schema-registry/config.ts">retrieveSubject</a>(subjectName, { ...params }) -> ConfigRetrieveSubjectResponse</code>
- <code title="put /v2/databases/{database_cluster_uuid}/schema-registry/config/{subject_name}">client.databases.schemaRegistry.config.<a href="./src/resources/databases/schema-registry/config.ts">updateSubject</a>(subjectName, { ...params }) -> ConfigUpdateSubjectResponse</code>

# Nfs

Types:

- <code><a href="./src/resources/nfs/nfs.ts">NfCreateResponse</a></code>
- <code><a href="./src/resources/nfs/nfs.ts">NfRetrieveResponse</a></code>
- <code><a href="./src/resources/nfs/nfs.ts">NfListResponse</a></code>
- <code><a href="./src/resources/nfs/nfs.ts">NfInitiateActionResponse</a></code>

Methods:

- <code title="post /v2/nfs">client.nfs.<a href="./src/resources/nfs/nfs.ts">create</a>({ ...params }) -> NfCreateResponse</code>
- <code title="get /v2/nfs/{nfs_id}">client.nfs.<a href="./src/resources/nfs/nfs.ts">retrieve</a>(nfsID, { ...params }) -> NfRetrieveResponse</code>
- <code title="get /v2/nfs">client.nfs.<a href="./src/resources/nfs/nfs.ts">list</a>({ ...params }) -> NfListResponse</code>
- <code title="delete /v2/nfs/{nfs_id}">client.nfs.<a href="./src/resources/nfs/nfs.ts">delete</a>(nfsID, { ...params }) -> void</code>
- <code title="post /v2/nfs/{nfs_id}/actions">client.nfs.<a href="./src/resources/nfs/nfs.ts">initiateAction</a>(nfsID, { ...params }) -> NfInitiateActionResponse</code>

## Snapshots

Types:

- <code><a href="./src/resources/nfs/snapshots.ts">SnapshotRetrieveResponse</a></code>
- <code><a href="./src/resources/nfs/snapshots.ts">SnapshotListResponse</a></code>

Methods:

- <code title="get /v2/nfs/snapshots/{nfs_snapshot_id}">client.nfs.snapshots.<a href="./src/resources/nfs/snapshots.ts">retrieve</a>(nfsSnapshotID, { ...params }) -> SnapshotRetrieveResponse</code>
- <code title="get /v2/nfs/snapshots">client.nfs.snapshots.<a href="./src/resources/nfs/snapshots.ts">list</a>({ ...params }) -> SnapshotListResponse</code>
- <code title="delete /v2/nfs/snapshots/{nfs_snapshot_id}">client.nfs.snapshots.<a href="./src/resources/nfs/snapshots.ts">delete</a>(nfsSnapshotID, { ...params }) -> void</code>

# Retrieve

Types:

- <code><a href="./src/resources/retrieve.ts">RetrieveDocumentsResponse</a></code>

Methods:

- <code title="post /{knowledgeBaseId}/retrieve">client.retrieve.<a href="./src/resources/retrieve.ts">documents</a>(knowledgeBaseID, { ...params }) -> RetrieveDocumentsResponse</code>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digitalocean/gradient",
"version": "0.1.0-alpha.2",
"version": "0.1.0-alpha.3",
"description": "The official TypeScript library for the Gradient API",
"author": "DigitalOcean, LLC <dev@digitalocean.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -35,7 +35,7 @@
"@types/node": "^20.17.6",
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.20.1",
"eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"iconv-lite": "^0.6.3",
Expand Down
51 changes: 50 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
Images,
} from './resources/images';
import { RegionListParams, RegionListResponse, Regions } from './resources/regions';
import { Retrieve, RetrieveDocumentsParams, RetrieveDocumentsResponse } from './resources/retrieve';
import {
APIAgent,
APIAgentAPIKeyInfo,
Expand Down Expand Up @@ -73,6 +74,7 @@ import {
KnowledgeBaseCreateParams,
KnowledgeBaseCreateResponse,
KnowledgeBaseDeleteResponse,
KnowledgeBaseListIndexingJobsResponse,
KnowledgeBaseListParams,
KnowledgeBaseListResponse,
KnowledgeBaseRetrieveResponse,
Expand All @@ -88,6 +90,18 @@ import {
ModelListResponse,
Models,
} from './resources/models/models';
import {
NfCreateParams,
NfCreateResponse,
NfDeleteParams,
NfInitiateActionParams,
NfInitiateActionResponse,
NfListParams,
NfListResponse,
NfRetrieveParams,
NfRetrieveResponse,
Nfs,
} from './resources/nfs/nfs';
import { type Fetch } from './internal/builtin-types';
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
Expand Down Expand Up @@ -127,6 +141,11 @@ export interface ClientOptions {
*/
inferenceEndpoint?: string | null | undefined;

/**
* Defaults to process.env['GRADIENT_KBASS_ENDPOINT'].
*/
kbassEndpoint?: string | null | undefined;

/**
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
*
Expand Down Expand Up @@ -205,11 +224,12 @@ export class Gradient {
agentAccessKey: string | null;
agentEndpoint: string | null;
inferenceEndpoint: string | null;
kbassEndpoint: string | null;

baseURL: string;
maxRetries: number;
timeout: number;
logger: Logger | undefined;
logger: Logger;
logLevel: LogLevel | undefined;
fetchOptions: MergedRequestInit | undefined;

Expand All @@ -226,6 +246,7 @@ export class Gradient {
* @param {string | null | undefined} [opts.agentAccessKey=process.env['GRADIENT_AGENT_ACCESS_KEY'] ?? null]
* @param {string | null | undefined} [opts.agentEndpoint=process.env['GRADIENT_AGENT_ENDPOINT'] ?? null]
* @param {string | null | undefined} [opts.inferenceEndpoint=process.env['GRADIENT_INFERENCE_ENDPOINT'] ?? inference.do-ai.run]
* @param {string | null | undefined} [opts.kbassEndpoint=process.env['GRADIENT_KBASS_ENDPOINT'] ?? kbaas.do-ai.run]
* @param {string} [opts.baseURL=process.env['GRADIENT_BASE_URL'] ?? https://api.digitalocean.com] - Override the default base URL for the API.
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
Expand All @@ -241,6 +262,7 @@ export class Gradient {
agentAccessKey = readEnv('GRADIENT_AGENT_ACCESS_KEY') ?? null,
agentEndpoint = readEnv('GRADIENT_AGENT_ENDPOINT') ?? null,
inferenceEndpoint = readEnv('GRADIENT_INFERENCE_ENDPOINT') ?? 'inference.do-ai.run',
kbassEndpoint = readEnv('GRADIENT_KBASS_ENDPOINT') ?? 'kbaas.do-ai.run',
...opts
}: ClientOptions = {}) {
const options: ClientOptions = {
Expand All @@ -249,6 +271,7 @@ export class Gradient {
agentAccessKey,
agentEndpoint,
inferenceEndpoint,
kbassEndpoint,
...opts,
baseURL: baseURL || `https://api.digitalocean.com`,
};
Expand All @@ -275,6 +298,7 @@ export class Gradient {
this.agentAccessKey = agentAccessKey;
this.agentEndpoint = agentEndpoint;
this.inferenceEndpoint = inferenceEndpoint;
this.kbassEndpoint = kbassEndpoint;
}

/**
Expand All @@ -295,6 +319,7 @@ export class Gradient {
agentAccessKey: this.agentAccessKey,
agentEndpoint: this.agentEndpoint,
inferenceEndpoint: this.inferenceEndpoint,
kbassEndpoint: this.kbassEndpoint,
...options,
});
return client;
Expand Down Expand Up @@ -871,6 +896,8 @@ export class Gradient {
models: API.Models = new API.Models(this);
regions: API.Regions = new API.Regions(this);
databases: API.Databases = new API.Databases(this);
nfs: API.Nfs = new API.Nfs(this);
retrieve: API.Retrieve = new API.Retrieve(this);
}

Gradient.Agents = Agents;
Expand All @@ -882,6 +909,8 @@ Gradient.KnowledgeBases = KnowledgeBases;
Gradient.Models = Models;
Gradient.Regions = Regions;
Gradient.Databases = Databases;
Gradient.Nfs = Nfs;
Gradient.Retrieve = Retrieve;

export declare namespace Gradient {
export type RequestOptions = Opts.RequestOptions;
Expand Down Expand Up @@ -948,6 +977,7 @@ export declare namespace Gradient {
type KnowledgeBaseUpdateResponse as KnowledgeBaseUpdateResponse,
type KnowledgeBaseListResponse as KnowledgeBaseListResponse,
type KnowledgeBaseDeleteResponse as KnowledgeBaseDeleteResponse,
type KnowledgeBaseListIndexingJobsResponse as KnowledgeBaseListIndexingJobsResponse,
type KnowledgeBaseCreateParams as KnowledgeBaseCreateParams,
type KnowledgeBaseUpdateParams as KnowledgeBaseUpdateParams,
type KnowledgeBaseListParams as KnowledgeBaseListParams,
Expand All @@ -970,6 +1000,25 @@ export declare namespace Gradient {

export { Databases as Databases };

export {
Nfs as Nfs,
type NfCreateResponse as NfCreateResponse,
type NfRetrieveResponse as NfRetrieveResponse,
type NfListResponse as NfListResponse,
type NfInitiateActionResponse as NfInitiateActionResponse,
type NfCreateParams as NfCreateParams,
type NfRetrieveParams as NfRetrieveParams,
type NfListParams as NfListParams,
type NfDeleteParams as NfDeleteParams,
type NfInitiateActionParams as NfInitiateActionParams,
};

export {
Retrieve as Retrieve,
type RetrieveDocumentsResponse as RetrieveDocumentsResponse,
type RetrieveDocumentsParams as RetrieveDocumentsParams,
};

export type Action = API.Action;
export type ActionLink = API.ActionLink;
export type APILinks = API.APILinks;
Expand Down
Loading