Skip to content

Commit 32c703f

Browse files
docs(api): updates to API spec
1 parent a1c6989 commit 32c703f

14 files changed

Lines changed: 73 additions & 64 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-d15316b8a3a086ae9ec8eea0d436b0885262df9bcf23b9587ad059e50357c220.yml
3-
openapi_spec_hash: 4f81a4f4840438f80eff345e76ead962
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai%2Fwriter-a8e20e751972f7b8c948a833764b02d0835b380189eaf7393d63eb2250dbd598.yml
3+
openapi_spec_hash: 6f27335468bc5bf01fbcd1454330fb07
44
config_hash: ee2e5a914fd298a6f4c740f5ce187f87

src/resources/applications/applications.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ export class Applications extends APIResource {
2626
graphs: GraphsAPI.Graphs = new GraphsAPI.Graphs(this._client);
2727

2828
/**
29-
* Retrieves detailed information for a specific no-code application, including its
30-
* configuration and current status.
29+
* Retrieves detailed information for a specific no-code agent (formerly called
30+
* no-code applications), including its configuration and current status.
3131
*/
3232
retrieve(applicationID: string, options?: RequestOptions): APIPromise<ApplicationRetrieveResponse> {
3333
return this._client.get(path`/v1/applications/${applicationID}`, options);
3434
}
3535

3636
/**
37-
* Retrieves a paginated list of no-code applications with optional filtering and
38-
* sorting capabilities.
37+
* Retrieves a paginated list of no-code agents (formerly called no-code
38+
* applications) with optional filtering and sorting capabilities.
3939
*/
4040
list(
4141
query: ApplicationListParams | null | undefined = {},
@@ -48,7 +48,8 @@ export class Applications extends APIResource {
4848
}
4949

5050
/**
51-
* Generate content from an existing no-code application with inputs.
51+
* Generate content from an existing no-code agent (formerly called no-code
52+
* applications) with inputs.
5253
*/
5354
generateContent(
5455
applicationID: string,
@@ -479,10 +480,10 @@ export namespace ApplicationGenerateContentParams {
479480
*
480481
* If the input type is "File upload", you must pass the `file_id` of an uploaded
481482
* file. You cannot pass a file object directly. See the
482-
* [file upload endpoint](/api-guides/api-reference/file-api/upload-files) for
483-
* instructions on uploading files or the
484-
* [list files endpoint](/api-guides/api-reference/file-api/get-all-files) for how
485-
* to see a list of uploaded files and their IDs.
483+
* [file upload endpoint](https://dev.writer.com/api-guides/api-reference/file-api/upload-files)
484+
* for instructions on uploading files or the
485+
* [list files endpoint](https://dev.writer.com/api-guides/api-reference/file-api/get-all-files)
486+
* for how to see a list of uploaded files and their IDs.
486487
*/
487488
value: Array<string>;
488489
}

src/resources/applications/graphs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { path } from '../../internal/utils/path';
77

88
export class Graphs extends APIResource {
99
/**
10-
* Updates the Knowledge Graphs listed and associates them with the no-code chat
11-
* app to be used.
10+
* Updates the Knowledge Graphs listed and associates them with the no-code agent.
1211
*/
1312
update(
1413
applicationID: string,
@@ -19,7 +18,8 @@ export class Graphs extends APIResource {
1918
}
2019

2120
/**
22-
* Retrieve Knowledge Graphs associated with a no-code chat application.
21+
* Retrieve Knowledge Graphs associated with a no-code agent that has chat
22+
* capabilities.
2323
*/
2424
list(applicationID: string, options?: RequestOptions): APIPromise<ApplicationGraphsResponse> {
2525
return this._client.get(path`/v1/applications/${applicationID}/graphs`, options);

src/resources/applications/jobs.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { path } from '../../internal/utils/path';
99

1010
export class Jobs extends APIResource {
1111
/**
12-
* Generate content asynchronously from an existing application with inputs.
12+
* Generate content asynchronously from an existing no-code agent (formerly called
13+
* no-code applications) with inputs.
1314
*/
1415
create(
1516
applicationID: string,
@@ -176,10 +177,10 @@ export namespace JobCreateParams {
176177
*
177178
* If the input type is "File upload", you must pass the `file_id` of an uploaded
178179
* file. You cannot pass a file object directly. See the
179-
* [file upload endpoint](/api-guides/api-reference/file-api/upload-files) for
180-
* instructions on uploading files or the
181-
* [list files endpoint](/api-guides/api-reference/file-api/get-all-files) for how
182-
* to see a list of uploaded files and their IDs.
180+
* [file upload endpoint](https://dev.writer.com/api-guides/api-reference/file-api/upload-files)
181+
* for instructions on uploading files or the
182+
* [list files endpoint](https://dev.writer.com/api-guides/api-reference/file-api/get-all-files)
183+
* for how to see a list of uploaded files and their IDs.
183184
*/
184185
value: Array<string>;
185186
}

src/resources/chat.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Chat extends APIResource {
1414
/**
1515
* Generate a chat completion based on the provided messages. The response shown
1616
* below is for non-streaming. To learn about streaming responses, see the
17-
* [chat completion guide](/api-guides/chat-completion).
17+
* [chat completion guide](https://dev.writer.com/api-guides/chat-completion).
1818
*/
1919
chat(body: ChatChatParamsNonStreaming, options?: RequestOptions): APIPromise<ChatCompletion>;
2020
chat(body: ChatChatParamsStreaming, options?: RequestOptions): APIPromise<Stream<ChatCompletionChunk>>;
@@ -282,10 +282,10 @@ export interface ChatCompletionParams {
282282
messages: Array<ChatCompletionParams.Message>;
283283

284284
/**
285-
* Specifies the model to be used for generating responses. The chat model is
286-
* always `palmyra-x-004` for conversational use.
285+
* The [ID of the model](https://dev.writer.com/home/models) to use for creating
286+
* the chat completion.
287287
*/
288-
model: string;
288+
model: 'palmyra-x-004' | 'palmyra-fin' | 'palmyra-med' | 'palmyra-creative' | 'palmyra-x-003-instruct';
289289

290290
/**
291291
* Specifies whether to return log probabilities of the output tokens.
@@ -301,7 +301,7 @@ export interface ChatCompletionParams {
301301

302302
/**
303303
* Specifies the number of completions (responses) to generate from the model in a
304-
* single request. This parameter allows multiple responses to be generated,
304+
* single request. This parameter allows for generating multiple responses,
305305
* offering a variety of potential replies from which to choose.
306306
*/
307307
n?: number;
@@ -344,7 +344,9 @@ export interface ChatCompletionParams {
344344
* generate responses. The tool definitions use JSON schema. You can define your
345345
* own functions or use one of the built-in `graph`, `llm`, or `vision` tools. Note
346346
* that you can only use one built-in tool type in the array (only one of `graph`,
347-
* `llm`, or `vision`).
347+
* `llm`, or `vision`). You can pass multiple custom
348+
* tools](https://dev.writer.com/api-guides/tool-calling) of type `function` in the
349+
* same request.
348350
*/
349351
tools?: Array<Shared.ToolParam>;
350352

@@ -362,7 +364,8 @@ export namespace ChatCompletionParams {
362364
/**
363365
* The role of the chat message. You can provide a system prompt by setting the
364366
* role to `system`, or specify that a message is the result of a
365-
* [tool call](/api-guides/tool-calling) by setting the role to `tool`.
367+
* [tool call](https://dev.writer.com/api-guides/tool-calling) by setting the role
368+
* to `tool`.
366369
*/
367370
role: 'user' | 'assistant' | 'system' | 'tool';
368371

@@ -426,10 +429,10 @@ export interface ChatChatParamsBase {
426429
messages: Array<ChatChatParams.Message>;
427430

428431
/**
429-
* Specifies the model to be used for generating responses. The chat model is
430-
* always `palmyra-x-004` for conversational use.
432+
* The [ID of the model](https://dev.writer.com/home/models) to use for creating
433+
* the chat completion.
431434
*/
432-
model: string;
435+
model: 'palmyra-x-004' | 'palmyra-fin' | 'palmyra-med' | 'palmyra-creative' | 'palmyra-x-003-instruct';
433436

434437
/**
435438
* Specifies whether to return log probabilities of the output tokens.
@@ -445,7 +448,7 @@ export interface ChatChatParamsBase {
445448

446449
/**
447450
* Specifies the number of completions (responses) to generate from the model in a
448-
* single request. This parameter allows multiple responses to be generated,
451+
* single request. This parameter allows for generating multiple responses,
449452
* offering a variety of potential replies from which to choose.
450453
*/
451454
n?: number;
@@ -488,7 +491,9 @@ export interface ChatChatParamsBase {
488491
* generate responses. The tool definitions use JSON schema. You can define your
489492
* own functions or use one of the built-in `graph`, `llm`, or `vision` tools. Note
490493
* that you can only use one built-in tool type in the array (only one of `graph`,
491-
* `llm`, or `vision`).
494+
* `llm`, or `vision`). You can pass multiple custom
495+
* tools](https://dev.writer.com/api-guides/tool-calling) of type `function` in the
496+
* same request.
492497
*/
493498
tools?: Array<Shared.ToolParam>;
494499

@@ -506,7 +511,8 @@ export namespace ChatChatParams {
506511
/**
507512
* The role of the chat message. You can provide a system prompt by setting the
508513
* role to `system`, or specify that a message is the result of a
509-
* [tool call](/api-guides/tool-calling) by setting the role to `tool`.
514+
* [tool call](https://dev.writer.com/api-guides/tool-calling) by setting the role
515+
* to `tool`.
510516
*/
511517
role: 'user' | 'assistant' | 'system' | 'tool';
512518

src/resources/completions.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ export interface CompletionChunk {
6262

6363
export interface CompletionParams {
6464
/**
65-
* The identifier of the model to be used for processing the request.
65+
* The [ID of the model](https://dev.writer.com/home/models) to use for generating
66+
* text.
6667
*/
67-
model: string;
68+
model: 'palmyra-x-004' | 'palmyra-fin' | 'palmyra-med' | 'palmyra-creative' | 'palmyra-x-003-instruct';
6869

6970
/**
7071
* The input text that the model will process to generate a response.
@@ -120,9 +121,10 @@ export type CompletionCreateParams = CompletionCreateParamsNonStreaming | Comple
120121

121122
export interface CompletionCreateParamsBase {
122123
/**
123-
* The identifier of the model to be used for processing the request.
124+
* The [ID of the model](https://dev.writer.com/home/models) to use for generating
125+
* text.
124126
*/
125-
model: string;
127+
model: 'palmyra-x-004' | 'palmyra-fin' | 'palmyra-med' | 'palmyra-creative' | 'palmyra-x-003-instruct';
126128

127129
/**
128130
* The input text that the model will process to generate a response.

src/resources/files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export interface FileListParams extends CursorPageParams {
143143

144144
export interface FileRetryParams {
145145
/**
146-
* The unique identifier of the files to be retried.
146+
* The unique identifier of the files to retry.
147147
*/
148148
file_ids: Array<string>;
149149
}

src/resources/graphs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ export type GraphQuestionParams = GraphQuestionParamsNonStreaming | GraphQuestio
311311

312312
export interface GraphQuestionParamsBase {
313313
/**
314-
* The unique identifiers of the Knowledge Graphs to be queried.
314+
* The unique identifiers of the Knowledge Graphs to query.
315315
*/
316316
graph_ids: Array<string>;
317317

318318
/**
319-
* The question to be answered using the Knowledge Graph.
319+
* The question to answer using the Knowledge Graph.
320320
*/
321321
question: string;
322322

src/resources/models.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export class Models extends APIResource {
1515

1616
export interface ModelListResponse {
1717
/**
18-
* The identifier of the model to be used for processing the request.
18+
* The [ID of the model](https://dev.writer.com/home/models) to use for processing
19+
* the request.
1920
*/
2021
models: Array<ModelListResponse.Model>;
2122
}

src/resources/shared.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export namespace ToolParam {
188188
*/
189189
export interface Function {
190190
/**
191-
* An array of graph IDs to be used in the tool.
191+
* An array of graph IDs to use in the tool.
192192
*/
193193
graph_ids: Array<string>;
194194

@@ -222,12 +222,12 @@ export namespace ToolParam {
222222
*/
223223
export interface Function {
224224
/**
225-
* A description of the model to be used.
225+
* A description of the model to use.
226226
*/
227227
description: string;
228228

229229
/**
230-
* The model to be used.
230+
* The model to use.
231231
*/
232232
model: string;
233233
}
@@ -251,17 +251,17 @@ export namespace ToolParam {
251251
*/
252252
export interface Function {
253253
/**
254-
* The model to be used for image analysis. Must be `palmyra-vision`.
254+
* The model to use for image analysis.
255255
*/
256-
model: string;
256+
model: 'palmyra-vision';
257257

258258
variables: Array<Function.Variable>;
259259
}
260260

261261
export namespace Function {
262262
export interface Variable {
263263
/**
264-
* The File ID of the image to be analyzed. The file must be uploaded to the Writer
264+
* The File ID of the image to analyze. The file must be uploaded to the Writer
265265
* platform before you use it with the Vision tool.
266266
*/
267267
file_id: string;

0 commit comments

Comments
 (0)