Skip to content

Commit bef6c7d

Browse files
release: 0.1.0 (#7)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 87089cf commit bef6c7d

File tree

23 files changed

+126
-580
lines changed

23 files changed

+126
-580
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.2"
2+
".": "0.1.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 39
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-448bcb901d30570e0b3162114cc74ba9578f8179f00363c32a5a2b7f56b17841.yml
1+
configured_endpoints: 33
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-4ed32c3243ce7a772e55bb1ba204736fc3fb1d712d8ca0eb91bac0c7ac626938.yml

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.1.0 (2025-01-15)
4+
5+
Full Changelog: [v0.1.0-alpha.2...v0.1.0](https://github.com/ContextualAI/contextual-client-node/compare/v0.1.0-alpha.2...v0.1.0)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([#6](https://github.com/ContextualAI/contextual-client-node/issues/6)) ([c4716b9](https://github.com/ContextualAI/contextual-client-node/commit/c4716b9941567e8194e7a423d3964bb10f9b0eb8))
10+
* **api:** update via SDK Studio ([#8](https://github.com/ContextualAI/contextual-client-node/issues/8)) ([b0ff25d](https://github.com/ContextualAI/contextual-client-node/commit/b0ff25db12010d4b6e2b8adf1dc08b2c03041499))
11+
* **api:** update via SDK Studio ([#9](https://github.com/ContextualAI/contextual-client-node/issues/9)) ([a2cb696](https://github.com/ContextualAI/contextual-client-node/commit/a2cb696735d01fe00508f2d6d5dfd40d30bebb9f))
12+
313
## 0.1.0-alpha.2 (2025-01-14)
414

515
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/ContextualAI/contextual-client-node/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Alternatively, you can request a single page at a time:
153153

154154
```ts
155155
let page = await client.agents.list();
156-
for (const agent of page.data) {
156+
for (const agent of page.agents) {
157157
console.log(agent);
158158
}
159159

api.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,6 @@ Types:
9898
- <code><a href="./src/resources/agents/datasets/datasets.ts">DatasetMetadata</a></code>
9999
- <code><a href="./src/resources/agents/datasets/datasets.ts">ListDatasetsResponse</a></code>
100100

101-
### Tune
102-
103-
Types:
104-
105-
- <code><a href="./src/resources/agents/datasets/tune.ts">TuneDeleteResponse</a></code>
106-
107-
Methods:
108-
109-
- <code title="post /agents/{agent_id}/datasets/tune">client.agents.datasets.tune.<a href="./src/resources/agents/datasets/tune.ts">create</a>(agentId, { ...params }) -> CreateDatasetResponse</code>
110-
- <code title="get /agents/{agent_id}/datasets/tune/{dataset_name}">client.agents.datasets.tune.<a href="./src/resources/agents/datasets/tune.ts">retrieve</a>(agentId, datasetName, { ...params }) -> Response</code>
111-
- <code title="put /agents/{agent_id}/datasets/tune/{dataset_name}">client.agents.datasets.tune.<a href="./src/resources/agents/datasets/tune.ts">update</a>(agentId, datasetName, { ...params }) -> CreateDatasetResponse</code>
112-
- <code title="get /agents/{agent_id}/datasets/tune">client.agents.datasets.tune.<a href="./src/resources/agents/datasets/tune.ts">list</a>(agentId, { ...params }) -> ListDatasetsResponse</code>
113-
- <code title="delete /agents/{agent_id}/datasets/tune/{dataset_name}">client.agents.datasets.tune.<a href="./src/resources/agents/datasets/tune.ts">delete</a>(agentId, datasetName) -> unknown</code>
114-
- <code title="get /agents/{agent_id}/datasets/tune/{dataset_name}/metadata">client.agents.datasets.tune.<a href="./src/resources/agents/datasets/tune.ts">metadata</a>(agentId, datasetName, { ...params }) -> DatasetMetadata</code>
115-
116101
### Evaluate
117102

118103
Types:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contextual-client",
3-
"version": "0.1.0-alpha.2",
3+
"version": "0.1.0",
44
"description": "The official TypeScript library for the Contextual AI API",
55
"author": "Contextual AI <support@contextual.ai>",
66
"types": "dist/index.d.ts",

src/pagination.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class DocumentsPage<Item> extends AbstractPage<Item> implements Documents
117117
}
118118

119119
export interface PageResponse<Item> {
120-
data: Array<Item>;
120+
agents: Array<Item>;
121121

122122
next_cursor: string;
123123
}
@@ -129,19 +129,19 @@ export interface PageParams {
129129
}
130130

131131
export class Page<Item> extends AbstractPage<Item> implements PageResponse<Item> {
132-
data: Array<Item>;
132+
agents: Array<Item>;
133133

134134
next_cursor: string;
135135

136136
constructor(client: APIClient, response: Response, body: PageResponse<Item>, options: FinalRequestOptions) {
137137
super(client, response, body, options);
138138

139-
this.data = body.data || [];
139+
this.agents = body.agents || [];
140140
this.next_cursor = body.next_cursor || '';
141141
}
142142

143143
getPaginatedItems(): Item[] {
144-
return this.data ?? [];
144+
return this.agents ?? [];
145145
}
146146

147147
// @deprecated Please use `nextPageInfo()` instead

src/resources/agents/agents.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export class Agents extends APIResource {
3232
/**
3333
* Create a new `Agent` with a specific configuration.
3434
*
35-
* This creates a specialized RAG `Agent` which queries over a `Datastore` to
36-
* retrieve relevant data on which its generations are grounded.
35+
* This creates a specialized RAG `Agent` which queries over one or multiple
36+
* `Datastores` to retrieve relevant data on which its generations are grounded.
3737
*
3838
* Retrieval and generation parameters are defined in the provided `Agent`
3939
* configuration.
@@ -128,10 +128,9 @@ export interface AgentMetadata {
128128
description?: string;
129129

130130
/**
131-
* Optional model ID of a tuned model to use for generation. Model must have been
132-
* tuned on this agent; tuned models cannot be used across agents. Uses default
133-
* model if none is specified. Set to `default` to deactivate the tuned model and
134-
* use the default model.
131+
* The model ID to use for generation. Tuned models can only be used for the agents
132+
* on which they were tuned. If no model is specified, the default model is used.
133+
* Set to `default` to switch from a tuned model to the default model.
135134
*/
136135
llm_model_id?: string;
137136

@@ -176,7 +175,7 @@ export interface ListAgentsResponse {
176175
/**
177176
* List of active agents
178177
*/
179-
data?: Array<Agent>;
178+
agents?: Array<Agent>;
180179

181180
/**
182181
* Next cursor to continue pagination. Omitted if there are no more agents to
@@ -228,10 +227,9 @@ export interface AgentUpdateParams {
228227
datastore_ids?: Array<string>;
229228

230229
/**
231-
* Optional model ID of a tuned model to use for generation. Model must have been
232-
* tuned on this agent; tuned models cannot be used across agents. Uses default
233-
* model if none is specified. Set to `default` to deactivate the tuned model and
234-
* use the default model.
230+
* The model ID to use for generation. Tuned models can only be used for the agents
231+
* on which they were tuned. If no model is specified, the default model is used.
232+
* Set to `default` to switch from a tuned model to the default model.
235233
*/
236234
llm_model_id?: string;
237235

src/resources/agents/datasets/datasets.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,8 @@ import {
1111
EvaluateRetrieveParams,
1212
EvaluateUpdateParams,
1313
} from './evaluate';
14-
import * as TuneAPI from './tune';
15-
import {
16-
Tune,
17-
TuneCreateParams,
18-
TuneDeleteResponse,
19-
TuneListParams,
20-
TuneMetadataParams,
21-
TuneRetrieveParams,
22-
TuneUpdateParams,
23-
} from './tune';
2414

2515
export class Datasets extends APIResource {
26-
tune: TuneAPI.Tune = new TuneAPI.Tune(this._client);
2716
evaluate: EvaluateAPI.Evaluate = new EvaluateAPI.Evaluate(this._client);
2817
}
2918

@@ -136,7 +125,6 @@ export namespace ListDatasetsResponse {
136125
}
137126
}
138127

139-
Datasets.Tune = Tune;
140128
Datasets.Evaluate = Evaluate;
141129

142130
export declare namespace Datasets {
@@ -146,16 +134,6 @@ export declare namespace Datasets {
146134
type ListDatasetsResponse as ListDatasetsResponse,
147135
};
148136

149-
export {
150-
Tune as Tune,
151-
type TuneDeleteResponse as TuneDeleteResponse,
152-
type TuneCreateParams as TuneCreateParams,
153-
type TuneRetrieveParams as TuneRetrieveParams,
154-
type TuneUpdateParams as TuneUpdateParams,
155-
type TuneListParams as TuneListParams,
156-
type TuneMetadataParams as TuneMetadataParams,
157-
};
158-
159137
export {
160138
Evaluate as Evaluate,
161139
type EvaluateDeleteResponse as EvaluateDeleteResponse,

src/resources/agents/datasets/evaluate.ts

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@ export class Evaluate extends APIResource {
1818
* defined for the `dataset_type`.
1919
*
2020
* File schema for `dataset_type` `evaluation_set` is a JSONL or CSV file where
21-
* each line is one JSON object with the following keys:
21+
* each line is one JSON object with the following required keys:
2222
*
2323
* - `prompt` (required, `string`): Prompt or question
2424
*
25-
* - `response` (optional, `string`): Optional response to evaluate
26-
*
2725
* - `reference` (required, `string`): Required reference or ground truth response
28-
*
29-
* - `guideline` (optional, `string`): Optional evaluation guidelines
30-
*
31-
* - `knowledge` (optional, `string`): Optional retrieved context for evaluation,
32-
* as a list of string text chunks
3326
*/
3427
create(
3528
agentId: string,
@@ -49,9 +42,13 @@ export class Evaluate extends APIResource {
4942
* The `Dataset` content is downloaded in batches. Batch size can be configured to
5043
* meet specific processing requirements.
5144
*
52-
* Returns a `StreamingResponse`, an asynchronous stream of `Dataset` content
53-
* with: - Content-Type: application/octet-stream - Content-Disposition:
54-
* attachment - Chunked transfer encoding
45+
* Returns a `StreamingResponse`, an asynchronous stream of `Dataset` content with:
46+
*
47+
* - Content-Type: application/octet-stream
48+
*
49+
* - Content-Disposition: attachment
50+
*
51+
* - Chunked transfer encoding
5552
*/
5653
retrieve(
5754
agentId: string,
@@ -84,18 +81,11 @@ export class Evaluate extends APIResource {
8481
* validating against its schema.
8582
*
8683
* File schema for `dataset_type` `evaluation_set` is a JSONL file where each line
87-
* is one JSON object with the following keys:
88-
*
89-
* - `prompt` (required, `string`): Prompt or question
90-
*
91-
* - `response` (optional, `string`): Optional response to evaluate
92-
*
93-
* - `reference` (required, `string`): Required reference or ground truth response
84+
* is one JSON object with the following required keys:
9485
*
95-
* - `guideline` (optional, `string`): Optional evaluation guidelines
86+
* - `prompt` (`string`): Prompt or question
9687
*
97-
* - `knowledge` (optional, `string`): Optional retrieved context for evaluation,
98-
* as a list of string text chunks
88+
* - `reference` (`string`): Required reference or ground truth response
9989
*/
10090
update(
10191
agentId: string,

0 commit comments

Comments
 (0)