@puku-ai/sdk 3.0.3 → 3.0.5
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/README.md +1 -1
- package/package.json +3 -2
- package/sdk.cjs +65 -72
- package/sdk.cjs.map +34 -34
- package/sdk.d.ts +198 -228
- package/sdk.mjs +21 -21
- package/sdk.mjs.map +34 -34
package/sdk.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
16
16
|
* - Defaults to process.env['PUKU_API_KEY'].
|
|
17
17
|
* - When a function is provided, it is invoked before each request so you can rotate
|
|
18
18
|
* or refresh credentials at runtime.
|
|
19
|
-
* - The function must return a non-empty string; otherwise
|
|
20
|
-
* - If the function throws, the error is wrapped in
|
|
19
|
+
* - The function must return a non-empty string; otherwise a PukuError is thrown.
|
|
20
|
+
* - If the function throws, the error is wrapped in a PukuError with the original
|
|
21
21
|
* error available as `cause`.
|
|
22
22
|
*/
|
|
23
23
|
apiKey?: string | ApiKeySetter | null | undefined;
|
|
@@ -95,7 +95,7 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
95
95
|
declare const AI_PROMPT = "\\n\\nAssistant:";
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* Base class for
|
|
98
|
+
* Base class for Puku API clients.
|
|
99
99
|
*/
|
|
100
100
|
declare class BasePuku {
|
|
101
101
|
#private;
|
|
@@ -179,12 +179,10 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
179
179
|
private buildHeaders;
|
|
180
180
|
private _makeAbort;
|
|
181
181
|
private buildBody;
|
|
182
|
-
static Anthropic: typeof BasePuku;
|
|
183
182
|
static PukuAI: typeof BasePuku;
|
|
184
183
|
static HUMAN_PROMPT: string;
|
|
185
184
|
static AI_PROMPT: string;
|
|
186
185
|
static DEFAULT_TIMEOUT: number;
|
|
187
|
-
static AnthropicError: typeof Errors.AnthropicError;
|
|
188
186
|
static PukuError: typeof Errors.PukuError;
|
|
189
187
|
static APIError: typeof Errors.APIError;
|
|
190
188
|
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
@@ -202,12 +200,10 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
202
200
|
}
|
|
203
201
|
|
|
204
202
|
/**
|
|
205
|
-
* API Client for interfacing with the
|
|
203
|
+
* API Client for interfacing with the Puku API.
|
|
206
204
|
*
|
|
207
|
-
* Public-facing
|
|
208
|
-
*
|
|
209
|
-
* `import PukuAI from "@puku-ai/sdk"`. `Anthropic` is kept as a static
|
|
210
|
-
* property pointing to the same class for source-compat.
|
|
205
|
+
* Public-facing class: `PukuAI`. Consumers of @puku-ai/sdk do
|
|
206
|
+
* `import PukuAI from "@puku-ai/sdk"`.
|
|
211
207
|
*/
|
|
212
208
|
declare class PukuAI extends BasePuku {
|
|
213
209
|
completions: API.Completions;
|
|
@@ -241,8 +237,8 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
241
237
|
asResponse(): Promise<Response>;
|
|
242
238
|
/**
|
|
243
239
|
* Gets the parsed response data, the raw `Response` instance and the ID of the request,
|
|
244
|
-
* returned via the `request-id` header which is useful for debugging requests and
|
|
245
|
-
* issues
|
|
240
|
+
* returned via the `request-id` header which is useful for debugging requests and reporting
|
|
241
|
+
* issues.
|
|
246
242
|
*
|
|
247
243
|
* If you just want to get the raw `Response` instance without parsing it,
|
|
248
244
|
* you can use {@link asResponse()}.
|
|
@@ -262,18 +258,6 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
262
258
|
finally(onfinally?: (() => void) | undefined | null): Promise<WithRequestID<T>>;
|
|
263
259
|
}
|
|
264
260
|
|
|
265
|
-
/**
|
|
266
|
-
* Legacy base error class, kept for backward compatibility with code
|
|
267
|
-
* imported from the Anthropic SDK. `PukuError` (the new branded base)
|
|
268
|
-
* extends this so `instanceof AnthropicError` continues to work for
|
|
269
|
-
* every error the SDK throws.
|
|
270
|
-
*
|
|
271
|
-
* @deprecated Import `PukuError` instead. Will be removed in the next
|
|
272
|
-
* major version.
|
|
273
|
-
*/
|
|
274
|
-
declare class AnthropicError extends Error {
|
|
275
|
-
}
|
|
276
|
-
|
|
277
261
|
/**
|
|
278
262
|
* Branded base error class for the Puku SDK. Every error the SDK throws
|
|
279
263
|
* is an instance of `PukuError`, so `err.toString()` and stack traces
|
|
@@ -283,7 +267,7 @@ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
|
|
283
267
|
* `Error.prototype.toString()` (which reads `.name`) produces
|
|
284
268
|
* `PukuError: …` instead of the default `Error: …`.
|
|
285
269
|
*/
|
|
286
|
-
declare class PukuError extends
|
|
270
|
+
declare class PukuError extends Error {
|
|
287
271
|
constructor(message?: string);
|
|
288
272
|
}
|
|
289
273
|
|
|
@@ -502,7 +486,7 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
502
486
|
* to the `.toolRunner()` method. The schema is used to automatically validate
|
|
503
487
|
* the input arguments for the tool.
|
|
504
488
|
*
|
|
505
|
-
* Mirrors
|
|
489
|
+
* Mirrors `@puku-ai/sdk`'s `betaTool`: `run` may take an
|
|
506
490
|
* optional `BetaToolRunContext` and `close` is honored on the resulting
|
|
507
491
|
* `BetaRunnableTool` so callers that hold resources (e.g. a persistent
|
|
508
492
|
* shell) can clean them up when iteration ends.
|
|
@@ -644,20 +628,20 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
644
628
|
}
|
|
645
629
|
|
|
646
630
|
/**
|
|
647
|
-
* Error thrown when an MCP value cannot be converted to a format supported by the
|
|
631
|
+
* Error thrown when an MCP value cannot be converted to a format supported by the API.
|
|
648
632
|
*/
|
|
649
633
|
declare class UnsupportedMCPValueError extends Error {
|
|
650
634
|
constructor(message: string);
|
|
651
635
|
}
|
|
652
636
|
|
|
653
637
|
/**
|
|
654
|
-
* Converts an MCP tool to a BetaRunnableTool for use with
|
|
638
|
+
* Converts an MCP tool to a BetaRunnableTool for use with this SDK's
|
|
655
639
|
* `toolRunner()` method.
|
|
656
640
|
*
|
|
657
641
|
* @param tool The MCP tool definition from `mcpClient.listTools()`
|
|
658
642
|
* @param mcpClient The MCP client instance used to call the tool
|
|
659
|
-
* @param extraProps Additional
|
|
660
|
-
* @returns A runnable tool for use with `
|
|
643
|
+
* @param extraProps Additional API properties to include in the tool definition
|
|
644
|
+
* @returns A runnable tool for use with `client.beta.messages.toolRunner()`
|
|
661
645
|
* @throws {UnsupportedMCPValueError} When the tool returns unsupported content types
|
|
662
646
|
* @throws {UnsupportedMCPValueError} When the tool returns unsupported resource links
|
|
663
647
|
* @throws {UnsupportedMCPValueError} When the tool returns resources with unsupported MIME types
|
|
@@ -665,15 +649,15 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
665
649
|
* @example
|
|
666
650
|
* ```ts
|
|
667
651
|
* import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
668
|
-
* import
|
|
669
|
-
* import { mcpTool } from "@
|
|
652
|
+
* import PukuAI from "@puku-ai/sdk";
|
|
653
|
+
* import { mcpTool } from "@puku-ai/sdk/helpers/beta/mcp";
|
|
670
654
|
*
|
|
671
655
|
* const mcpClient = new Client({ name: "example", version: "1.0.0" });
|
|
672
|
-
* const
|
|
656
|
+
* const client = new PukuAI();
|
|
673
657
|
*
|
|
674
658
|
* const tools = await mcpClient.listTools();
|
|
675
|
-
* const runner = await
|
|
676
|
-
* model: "
|
|
659
|
+
* const runner = await client.beta.messages.toolRunner({
|
|
660
|
+
* model: "gpt-5",
|
|
677
661
|
* max_tokens: 1024,
|
|
678
662
|
* tools: tools.tools.map(tool => mcpTool(tool, mcpClient)),
|
|
679
663
|
* messages: [{ role: "user", content: "Use the available tools" }],
|
|
@@ -687,14 +671,14 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
687
671
|
*
|
|
688
672
|
* @param tools Array of MCP tool definitions from `mcpClient.listTools()`
|
|
689
673
|
* @param mcpClient The MCP client instance used to call the tools
|
|
690
|
-
* @param extraProps Additional
|
|
691
|
-
* @returns An array of runnable tools for use with `
|
|
674
|
+
* @param extraProps Additional API properties to include in each tool definition
|
|
675
|
+
* @returns An array of runnable tools for use with `client.beta.messages.toolRunner()`
|
|
692
676
|
*
|
|
693
677
|
* @example
|
|
694
678
|
* ```ts
|
|
695
679
|
* const { tools } = await mcpClient.listTools();
|
|
696
|
-
* const runner = await
|
|
697
|
-
* model: "
|
|
680
|
+
* const runner = await client.beta.messages.toolRunner({
|
|
681
|
+
* model: "gpt-5",
|
|
698
682
|
* max_tokens: 1024,
|
|
699
683
|
* tools: mcpTools(tools, mcpClient),
|
|
700
684
|
* messages: [{ role: "user", content: "Use the available tools" }],
|
|
@@ -704,11 +688,11 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
704
688
|
declare function mcpTools(tools: MCPToolLike[], mcpClient: MCPClientLike, extraProps?: Partial<Omit<BetaTool, 'name' | 'description' | 'input_schema'>>): BetaRunnableTool<Record<string, unknown>>[];
|
|
705
689
|
|
|
706
690
|
/**
|
|
707
|
-
* Converts an MCP prompt message to
|
|
691
|
+
* Converts an MCP prompt message to a BetaMessageParam.
|
|
708
692
|
*
|
|
709
693
|
* @param mcpMessage The MCP prompt message from `mcpClient.getPrompt()`
|
|
710
|
-
* @param extraProps Additional
|
|
711
|
-
* @returns A message parameter for use with `
|
|
694
|
+
* @param extraProps Additional API properties to include in content blocks (e.g., `cache_control`)
|
|
695
|
+
* @returns A message parameter for use with `client.beta.messages.create()`
|
|
712
696
|
* @throws {UnsupportedMCPValueError} When the message contains unsupported content types
|
|
713
697
|
* @throws {UnsupportedMCPValueError} When the message contains unsupported resource links
|
|
714
698
|
* @throws {UnsupportedMCPValueError} When the message contains resources with unsupported MIME types
|
|
@@ -716,19 +700,19 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
716
700
|
* @example
|
|
717
701
|
* ```ts
|
|
718
702
|
* import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
719
|
-
* import
|
|
720
|
-
* import { mcpMessage } from "@
|
|
703
|
+
* import PukuAI from "@puku-ai/sdk";
|
|
704
|
+
* import { mcpMessage } from "@puku-ai/sdk/helpers/beta/mcp";
|
|
721
705
|
*
|
|
722
706
|
* const mcpClient = new Client({ name: "example", version: "1.0.0" });
|
|
723
|
-
* const
|
|
707
|
+
* const client = new PukuAI();
|
|
724
708
|
*
|
|
725
709
|
* const prompt = await mcpClient.getPrompt({
|
|
726
710
|
* name: "example-prompt",
|
|
727
711
|
* arguments: { arg1: "value" },
|
|
728
712
|
* });
|
|
729
713
|
*
|
|
730
|
-
* await
|
|
731
|
-
* model: "
|
|
714
|
+
* await client.beta.messages.create({
|
|
715
|
+
* model: "gpt-5",
|
|
732
716
|
* max_tokens: 1024,
|
|
733
717
|
* messages: prompt.messages.map(msg => mcpMessage(msg)),
|
|
734
718
|
* });
|
|
@@ -737,11 +721,11 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
737
721
|
declare function mcpMessage(mcpMessage: MCPPromptMessageLike, extraProps?: Partial<Omit<BetaTextBlockParam, 'type' | 'text' | 'source'> & Omit<BetaImageBlockParam, 'type' | 'source'> & Omit<BetaRequestDocumentBlock, 'type' | 'source'>>): BetaMessageParam;
|
|
738
722
|
|
|
739
723
|
/**
|
|
740
|
-
* Converts an array of MCP prompt messages to
|
|
724
|
+
* Converts an array of MCP prompt messages to BetaMessageParams.
|
|
741
725
|
*
|
|
742
726
|
* @param messages Array of MCP prompt messages from `mcpClient.getPrompt()`
|
|
743
|
-
* @param extraProps Additional
|
|
744
|
-
* @returns An array of message parameters for use with `
|
|
727
|
+
* @param extraProps Additional API properties to include in content blocks (e.g., `cache_control`)
|
|
728
|
+
* @returns An array of message parameters for use with `client.beta.messages.create()`
|
|
745
729
|
* @throws {UnsupportedMCPValueError} When any message contains unsupported content types
|
|
746
730
|
* @throws {UnsupportedMCPValueError} When any message contains unsupported resource links
|
|
747
731
|
* @throws {UnsupportedMCPValueError} When any message contains resources with unsupported MIME types
|
|
@@ -749,8 +733,8 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
749
733
|
* @example
|
|
750
734
|
* ```ts
|
|
751
735
|
* const { messages } = await mcpClient.getPrompt({ name: "example-prompt" });
|
|
752
|
-
* await
|
|
753
|
-
* model: "
|
|
736
|
+
* await client.beta.messages.create({
|
|
737
|
+
* model: "gpt-5",
|
|
754
738
|
* max_tokens: 1024,
|
|
755
739
|
* messages: mcpMessages(messages),
|
|
756
740
|
* });
|
|
@@ -759,11 +743,11 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
759
743
|
declare function mcpMessages(messages: MCPPromptMessageLike[], extraProps?: Partial<Omit<BetaTextBlockParam, 'type' | 'text' | 'source'> & Omit<BetaImageBlockParam, 'type' | 'source'> & Omit<BetaRequestDocumentBlock, 'type' | 'source'>>): BetaMessageParam[];
|
|
760
744
|
|
|
761
745
|
/**
|
|
762
|
-
* Converts a single MCP prompt content item to
|
|
746
|
+
* Converts a single MCP prompt content item to a content block.
|
|
763
747
|
*
|
|
764
748
|
* @param content The MCP content item (text, image, or embedded resource)
|
|
765
|
-
* @param extraProps Additional
|
|
766
|
-
* @returns A
|
|
749
|
+
* @param extraProps Additional API properties to include in the content block (e.g., `cache_control`)
|
|
750
|
+
* @returns A content block for use in a message's content array
|
|
767
751
|
* @throws {UnsupportedMCPValueError} When the content type is not supported (e.g., 'audio')
|
|
768
752
|
* @throws {UnsupportedMCPValueError} When resource links use non-http/https protocols
|
|
769
753
|
* @throws {UnsupportedMCPValueError} When resources have unsupported MIME types
|
|
@@ -772,8 +756,8 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
772
756
|
* ```ts
|
|
773
757
|
* const { messages } = await mcpClient.getPrompt({ name: "my-prompt" });
|
|
774
758
|
* // If you need to mix MCP content with other content:
|
|
775
|
-
* await
|
|
776
|
-
* model: "
|
|
759
|
+
* await client.beta.messages.create({
|
|
760
|
+
* model: "gpt-5",
|
|
777
761
|
* max_tokens: 1024,
|
|
778
762
|
* messages: [{
|
|
779
763
|
* role: "user",
|
|
@@ -788,29 +772,29 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
788
772
|
declare function mcpContent(content: MCPPromptContentLike, extraProps?: Partial<Omit<BetaTextBlockParam, 'type' | 'text' | 'source'> & Omit<BetaImageBlockParam, 'type' | 'source'> & Omit<BetaRequestDocumentBlock, 'type' | 'source'>>): BetaTextBlockParam | BetaImageBlockParam | BetaRequestDocumentBlock;
|
|
789
773
|
|
|
790
774
|
/**
|
|
791
|
-
* Converts MCP resource contents to
|
|
775
|
+
* Converts MCP resource contents to a content block.
|
|
792
776
|
*
|
|
793
777
|
* This helper is useful when you have resource contents from `mcpClient.readResource()`
|
|
794
778
|
* and want to include them in a message or as a document source. It automatically
|
|
795
779
|
* finds the first resource with a supported MIME type.
|
|
796
780
|
*
|
|
797
781
|
* @param result The result from `mcpClient.readResource()`
|
|
798
|
-
* @param extraProps Additional
|
|
799
|
-
* @returns A
|
|
782
|
+
* @param extraProps Additional API properties to include in the content block (e.g., `cache_control`)
|
|
783
|
+
* @returns A content block
|
|
800
784
|
* @throws {UnsupportedMCPValueError} When contents array is empty or none have a supported MIME type
|
|
801
785
|
*
|
|
802
786
|
* @example
|
|
803
787
|
* ```ts
|
|
804
788
|
* import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
805
|
-
* import
|
|
806
|
-
* import { mcpResourceToContent } from "@
|
|
789
|
+
* import PukuAI from "@puku-ai/sdk";
|
|
790
|
+
* import { mcpResourceToContent } from "@puku-ai/sdk/helpers/beta/mcp";
|
|
807
791
|
*
|
|
808
792
|
* const mcpClient = new Client({ name: "example", version: "1.0.0" });
|
|
809
|
-
* const
|
|
793
|
+
* const client = new PukuAI();
|
|
810
794
|
*
|
|
811
795
|
* const resource = await mcpClient.readResource({ uri: "file:///example.txt" });
|
|
812
|
-
* await
|
|
813
|
-
* model: "
|
|
796
|
+
* await client.beta.messages.create({
|
|
797
|
+
* model: "gpt-5",
|
|
814
798
|
* max_tokens: 1024,
|
|
815
799
|
* messages: [{
|
|
816
800
|
* role: "user",
|
|
@@ -822,24 +806,24 @@ type NoInfer<T> = T extends infer R ? R : never;
|
|
|
822
806
|
declare function mcpResourceToContent(result: MCPReadResourceResultLike, extraProps?: Partial<Omit<BetaRequestDocumentBlock, 'type' | 'source'>>): BetaTextBlockParam | BetaImageBlockParam | BetaRequestDocumentBlock;
|
|
823
807
|
|
|
824
808
|
/**
|
|
825
|
-
* Converts an MCP resource to a File object suitable for uploading via `
|
|
809
|
+
* Converts an MCP resource to a File object suitable for uploading via `client.beta.files.upload()`.
|
|
826
810
|
*
|
|
827
811
|
* @param result The result from `mcpClient.readResource()`
|
|
828
|
-
* @returns A File object for use with `
|
|
812
|
+
* @returns A File object for use with `client.beta.files.upload()`
|
|
829
813
|
* @throws {UnsupportedMCPValueError} When contents array is empty
|
|
830
814
|
*
|
|
831
815
|
* @example
|
|
832
816
|
* ```ts
|
|
833
817
|
* import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
834
|
-
* import
|
|
835
|
-
* import { mcpResourceToFile } from "@
|
|
818
|
+
* import PukuAI from "@puku-ai/sdk";
|
|
819
|
+
* import { mcpResourceToFile } from "@puku-ai/sdk/helpers/beta/mcp";
|
|
836
820
|
*
|
|
837
821
|
* const mcpClient = new Client({ name: "example", version: "1.0.0" });
|
|
838
|
-
* const
|
|
822
|
+
* const client = new PukuAI();
|
|
839
823
|
*
|
|
840
824
|
* const resource = await mcpClient.readResource({ uri: "file:///document.pdf" });
|
|
841
825
|
*
|
|
842
|
-
* const uploaded = await
|
|
826
|
+
* const uploaded = await client.beta.files.upload({
|
|
843
827
|
* file: mcpResourceToFile(resource),
|
|
844
828
|
* });
|
|
845
829
|
* ```
|
|
@@ -1337,7 +1321,7 @@ type LogFn = (message: string, ...rest: unknown[]) => void;
|
|
|
1337
1321
|
message: (message: BetaMessage) => void;
|
|
1338
1322
|
contentBlock: (content: BetaContentBlock) => void;
|
|
1339
1323
|
finalMessage: (message: BetaMessage) => void;
|
|
1340
|
-
error: (error:
|
|
1324
|
+
error: (error: PukuError) => void;
|
|
1341
1325
|
abort: (error: APIUserAbortError) => void;
|
|
1342
1326
|
end: () => void;
|
|
1343
1327
|
}
|
|
@@ -1356,8 +1340,8 @@ type LogFn = (message: string, ...rest: unknown[]) => void;
|
|
|
1356
1340
|
get request_id(): string | null | undefined;
|
|
1357
1341
|
/**
|
|
1358
1342
|
* Returns the `MessageStream` data, the raw `Response` instance and the ID of the request,
|
|
1359
|
-
* returned vie the `request-id` header which is useful for debugging requests and
|
|
1360
|
-
* issues
|
|
1343
|
+
* returned vie the `request-id` header which is useful for debugging requests and reporting
|
|
1344
|
+
* issues.
|
|
1361
1345
|
*
|
|
1362
1346
|
* This is the same as the `APIPromise.withResponse()` method.
|
|
1363
1347
|
*
|
|
@@ -1456,8 +1440,8 @@ type LogFn = (message: string, ...rest: unknown[]) => void;
|
|
|
1456
1440
|
get request_id(): string | null | undefined;
|
|
1457
1441
|
/**
|
|
1458
1442
|
* Returns the `MessageStream` data, the raw `Response` instance and the ID of the request,
|
|
1459
|
-
* returned vie the `request-id` header which is useful for debugging requests and
|
|
1460
|
-
* issues
|
|
1443
|
+
* returned vie the `request-id` header which is useful for debugging requests and reporting
|
|
1444
|
+
* issues.
|
|
1461
1445
|
*
|
|
1462
1446
|
* This is the same as the `APIPromise.withResponse()` method.
|
|
1463
1447
|
*
|
|
@@ -1666,7 +1650,7 @@ type StainlessHelperObject = {
|
|
|
1666
1650
|
* tool-use block that triggered the run, an optional abort signal, and a
|
|
1667
1651
|
* deprecated alias for `toolUse`.
|
|
1668
1652
|
*
|
|
1669
|
-
* The shape is intentionally minimal: the upstream
|
|
1653
|
+
* The shape is intentionally minimal: the upstream SDK also wires
|
|
1670
1654
|
* managed-agents events through this type, but @puku-ai/sdk does not yet
|
|
1671
1655
|
* vendor that resource surface, so the type falls back to a
|
|
1672
1656
|
* `BetaToolUseBlock`.
|
|
@@ -1733,7 +1717,6 @@ type StainlessHelperObject = {
|
|
|
1733
1717
|
* @example
|
|
1734
1718
|
* // Direct parameter update
|
|
1735
1719
|
* runner.setMessagesParams({
|
|
1736
|
-
* model: 'claude-haiku-4-5',
|
|
1737
1720
|
* max_tokens: 500,
|
|
1738
1721
|
* });
|
|
1739
1722
|
*
|
|
@@ -1783,7 +1766,7 @@ type StainlessHelperObject = {
|
|
|
1783
1766
|
* * If the iterator has been consumed, waits for it to complete and returns the final message.
|
|
1784
1767
|
*
|
|
1785
1768
|
* @returns A promise that resolves to the final BetaMessage from the conversation
|
|
1786
|
-
* @throws {
|
|
1769
|
+
* @throws {PukuError} If no messages were processed during the conversation
|
|
1787
1770
|
*
|
|
1788
1771
|
* @example
|
|
1789
1772
|
* const finalMessage = await runner.runUntilDone();
|
|
@@ -1907,7 +1890,7 @@ type StainlessHelperObject = {
|
|
|
1907
1890
|
skills: SkillsAPI.Skills;
|
|
1908
1891
|
}
|
|
1909
1892
|
|
|
1910
|
-
type
|
|
1893
|
+
type PukuBeta = (string & {}) | 'message-batches-2024-09-24' | 'prompt-caching-2024-07-31' | 'computer-use-2024-10-22' | 'computer-use-2025-01-24' | 'pdfs-2024-09-25' | 'token-counting-2024-11-01' | 'token-efficient-tools-2025-02-19' | 'output-128k-2025-02-19' | 'files-api-2025-04-14' | 'mcp-client-2025-04-04' | 'mcp-client-2025-11-20' | 'dev-full-thinking-2025-05-14' | 'interleaved-thinking-2025-05-14' | 'code-execution-2025-05-22' | 'extended-cache-ttl-2025-04-11' | 'context-1m-2025-08-07' | 'context-management-2025-06-27' | 'model-context-window-exceeded-2025-08-26' | 'skills-2025-10-02' | 'fast-mode-2026-02-01' | 'output-300k-2026-03-24';
|
|
1911
1894
|
|
|
1912
1895
|
interface BetaAPIError {
|
|
1913
1896
|
message: string;
|
|
@@ -2077,28 +2060,28 @@ type StainlessHelperObject = {
|
|
|
2077
2060
|
/**
|
|
2078
2061
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
2079
2062
|
*/
|
|
2080
|
-
betas?: Array<BetaAPI.
|
|
2063
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2081
2064
|
}
|
|
2082
2065
|
|
|
2083
2066
|
interface FileDeleteParams {
|
|
2084
2067
|
/**
|
|
2085
2068
|
* Optional header to specify the beta version(s) you want to use.
|
|
2086
2069
|
*/
|
|
2087
|
-
betas?: Array<BetaAPI.
|
|
2070
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2088
2071
|
}
|
|
2089
2072
|
|
|
2090
2073
|
interface FileDownloadParams {
|
|
2091
2074
|
/**
|
|
2092
2075
|
* Optional header to specify the beta version(s) you want to use.
|
|
2093
2076
|
*/
|
|
2094
|
-
betas?: Array<BetaAPI.
|
|
2077
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2095
2078
|
}
|
|
2096
2079
|
|
|
2097
2080
|
interface FileRetrieveMetadataParams {
|
|
2098
2081
|
/**
|
|
2099
2082
|
* Optional header to specify the beta version(s) you want to use.
|
|
2100
2083
|
*/
|
|
2101
|
-
betas?: Array<BetaAPI.
|
|
2084
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2102
2085
|
}
|
|
2103
2086
|
|
|
2104
2087
|
interface FileUploadParams {
|
|
@@ -2109,7 +2092,7 @@ type StainlessHelperObject = {
|
|
|
2109
2092
|
/**
|
|
2110
2093
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
2111
2094
|
*/
|
|
2112
|
-
betas?: Array<BetaAPI.
|
|
2095
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2113
2096
|
}
|
|
2114
2097
|
|
|
2115
2098
|
declare class Batches extends APIResource {
|
|
@@ -2120,8 +2103,7 @@ type StainlessHelperObject = {
|
|
|
2120
2103
|
* once. Once a Message Batch is created, it begins processing immediately. Batches
|
|
2121
2104
|
* can take up to 24 hours to complete.
|
|
2122
2105
|
*
|
|
2123
|
-
* Learn more about the Message Batches API in
|
|
2124
|
-
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
|
|
2106
|
+
* Learn more about the Message Batches API in the SDK README.
|
|
2125
2107
|
*
|
|
2126
2108
|
* @example
|
|
2127
2109
|
* ```ts
|
|
@@ -2135,7 +2117,7 @@ type StainlessHelperObject = {
|
|
|
2135
2117
|
* messages: [
|
|
2136
2118
|
* { content: 'Hello, world', role: 'user' },
|
|
2137
2119
|
* ],
|
|
2138
|
-
* model: '
|
|
2120
|
+
* model: 'gpt-5',
|
|
2139
2121
|
* },
|
|
2140
2122
|
* },
|
|
2141
2123
|
* ],
|
|
@@ -2148,8 +2130,7 @@ type StainlessHelperObject = {
|
|
|
2148
2130
|
* completion. To access the results of a Message Batch, make a request to the
|
|
2149
2131
|
* `results_url` field in the response.
|
|
2150
2132
|
*
|
|
2151
|
-
* Learn more about the Message Batches API in
|
|
2152
|
-
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
|
|
2133
|
+
* Learn more about the Message Batches API in the SDK README.
|
|
2153
2134
|
*
|
|
2154
2135
|
* @example
|
|
2155
2136
|
* ```ts
|
|
@@ -2164,8 +2145,7 @@ type StainlessHelperObject = {
|
|
|
2164
2145
|
* List all Message Batches within a Workspace. Most recently created batches are
|
|
2165
2146
|
* returned first.
|
|
2166
2147
|
*
|
|
2167
|
-
* Learn more about the Message Batches API in
|
|
2168
|
-
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
|
|
2148
|
+
* Learn more about the Message Batches API in the SDK README.
|
|
2169
2149
|
*
|
|
2170
2150
|
* @example
|
|
2171
2151
|
* ```ts
|
|
@@ -2182,8 +2162,7 @@ type StainlessHelperObject = {
|
|
|
2182
2162
|
* Message Batches can only be deleted once they've finished processing. If you'd
|
|
2183
2163
|
* like to delete an in-progress batch, you must first cancel it.
|
|
2184
2164
|
*
|
|
2185
|
-
* Learn more about the Message Batches API in
|
|
2186
|
-
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
|
|
2165
|
+
* Learn more about the Message Batches API in the SDK README.
|
|
2187
2166
|
*
|
|
2188
2167
|
* @example
|
|
2189
2168
|
* ```ts
|
|
@@ -2205,8 +2184,7 @@ type StainlessHelperObject = {
|
|
|
2205
2184
|
* Note that cancellation may not result in any canceled requests if they were
|
|
2206
2185
|
* non-interruptible.
|
|
2207
2186
|
*
|
|
2208
|
-
* Learn more about the Message Batches API in
|
|
2209
|
-
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
|
|
2187
|
+
* Learn more about the Message Batches API in the SDK README.
|
|
2210
2188
|
*
|
|
2211
2189
|
* @example
|
|
2212
2190
|
* ```ts
|
|
@@ -2224,8 +2202,7 @@ type StainlessHelperObject = {
|
|
|
2224
2202
|
* in the Message Batch. Results are not guaranteed to be in the same order as
|
|
2225
2203
|
* requests. Use the `custom_id` field to match results to requests.
|
|
2226
2204
|
*
|
|
2227
|
-
* Learn more about the Message Batches API in
|
|
2228
|
-
* [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
|
|
2205
|
+
* Learn more about the Message Batches API in the SDK README.
|
|
2229
2206
|
*
|
|
2230
2207
|
* @example
|
|
2231
2208
|
* ```ts
|
|
@@ -2405,42 +2382,42 @@ type StainlessHelperObject = {
|
|
|
2405
2382
|
/**
|
|
2406
2383
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
2407
2384
|
*/
|
|
2408
|
-
betas?: Array<BetaAPI.
|
|
2385
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2409
2386
|
}
|
|
2410
2387
|
|
|
2411
2388
|
interface BatchRetrieveParams {
|
|
2412
2389
|
/**
|
|
2413
2390
|
* Optional header to specify the beta version(s) you want to use.
|
|
2414
2391
|
*/
|
|
2415
|
-
betas?: Array<BetaAPI.
|
|
2392
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2416
2393
|
}
|
|
2417
2394
|
|
|
2418
2395
|
interface BatchListParams extends PageParams {
|
|
2419
2396
|
/**
|
|
2420
2397
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
2421
2398
|
*/
|
|
2422
|
-
betas?: Array<BetaAPI.
|
|
2399
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2423
2400
|
}
|
|
2424
2401
|
|
|
2425
2402
|
interface BatchDeleteParams {
|
|
2426
2403
|
/**
|
|
2427
2404
|
* Optional header to specify the beta version(s) you want to use.
|
|
2428
2405
|
*/
|
|
2429
|
-
betas?: Array<BetaAPI.
|
|
2406
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2430
2407
|
}
|
|
2431
2408
|
|
|
2432
2409
|
interface BatchCancelParams {
|
|
2433
2410
|
/**
|
|
2434
2411
|
* Optional header to specify the beta version(s) you want to use.
|
|
2435
2412
|
*/
|
|
2436
|
-
betas?: Array<BetaAPI.
|
|
2413
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2437
2414
|
}
|
|
2438
2415
|
|
|
2439
2416
|
interface BatchResultsParams {
|
|
2440
2417
|
/**
|
|
2441
2418
|
* Optional header to specify the beta version(s) you want to use.
|
|
2442
2419
|
*/
|
|
2443
|
-
betas?: Array<BetaAPI.
|
|
2420
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
2444
2421
|
}
|
|
2445
2422
|
|
|
2446
2423
|
declare class Messages extends APIResource {
|
|
@@ -2453,7 +2430,7 @@ type StainlessHelperObject = {
|
|
|
2453
2430
|
* conversations.
|
|
2454
2431
|
*
|
|
2455
2432
|
* Learn more about the Messages API in our
|
|
2456
|
-
*
|
|
2433
|
+
* See the SDK README for details.
|
|
2457
2434
|
*
|
|
2458
2435
|
* @example
|
|
2459
2436
|
* ```ts
|
|
@@ -2495,7 +2472,7 @@ type StainlessHelperObject = {
|
|
|
2495
2472
|
* including tools, images, and documents, without creating it.
|
|
2496
2473
|
*
|
|
2497
2474
|
* Learn more about token counting in our
|
|
2498
|
-
*
|
|
2475
|
+
* See the SDK README for details.
|
|
2499
2476
|
*
|
|
2500
2477
|
* @example
|
|
2501
2478
|
* ```ts
|
|
@@ -3433,7 +3410,7 @@ type StainlessHelperObject = {
|
|
|
3433
3410
|
* Example:
|
|
3434
3411
|
*
|
|
3435
3412
|
* ```json
|
|
3436
|
-
* [{ "type": "text", "text": "Hi, I'm
|
|
3413
|
+
* [{ "type": "text", "text": "Hi, I'm the assistant." }]
|
|
3437
3414
|
* ```
|
|
3438
3415
|
*
|
|
3439
3416
|
* If the request input `messages` ended with an `assistant` turn, then the
|
|
@@ -3467,7 +3444,7 @@ type StainlessHelperObject = {
|
|
|
3467
3444
|
context_management: BetaContextManagementResponse | null;
|
|
3468
3445
|
/**
|
|
3469
3446
|
* The model that will complete your prompt.\n\nSee
|
|
3470
|
-
*
|
|
3447
|
+
* See the SDK README for additional
|
|
3471
3448
|
* details and options.
|
|
3472
3449
|
*/
|
|
3473
3450
|
model: MessagesAPI.Model;
|
|
@@ -3511,7 +3488,7 @@ type StainlessHelperObject = {
|
|
|
3511
3488
|
/**
|
|
3512
3489
|
* Billing and rate-limit usage.
|
|
3513
3490
|
*
|
|
3514
|
-
*
|
|
3491
|
+
* The API bills and rate-limits by token counts, as tokens represent the
|
|
3515
3492
|
* underlying cost to our systems.
|
|
3516
3493
|
*
|
|
3517
3494
|
* Under the hood, the API transforms requests into a format suitable for the
|
|
@@ -3520,7 +3497,7 @@ type StainlessHelperObject = {
|
|
|
3520
3497
|
* with the exact visible content of an API request or response.
|
|
3521
3498
|
*
|
|
3522
3499
|
* For example, `output_tokens` will be non-zero, even for an empty string response
|
|
3523
|
-
* from
|
|
3500
|
+
* from the model.
|
|
3524
3501
|
*
|
|
3525
3502
|
* Total input tokens in a request is the summation of `input_tokens`,
|
|
3526
3503
|
* `cache_creation_input_tokens`, and `cache_read_input_tokens`.
|
|
@@ -3613,7 +3590,7 @@ type StainlessHelperObject = {
|
|
|
3613
3590
|
/**
|
|
3614
3591
|
* An external identifier for the user who is associated with the request.
|
|
3615
3592
|
*
|
|
3616
|
-
* This should be a uuid, hash value, or other opaque identifier.
|
|
3593
|
+
* This should be a uuid, hash value, or other opaque identifier. The service may use
|
|
3617
3594
|
* this id to help detect abuse. Do not include any identifying information such as
|
|
3618
3595
|
* name, email address, or phone number.
|
|
3619
3596
|
*/
|
|
@@ -3626,8 +3603,8 @@ type StainlessHelperObject = {
|
|
|
3626
3603
|
*/
|
|
3627
3604
|
effort?: 'low' | 'medium' | 'high' | 'max' | null;
|
|
3628
3605
|
/**
|
|
3629
|
-
* A schema to specify
|
|
3630
|
-
*
|
|
3606
|
+
* A schema to specify the model's output format in responses. See
|
|
3607
|
+
* the SDK README for more details on structured outputs.
|
|
3631
3608
|
*/
|
|
3632
3609
|
format?: BetaJSONOutputFormat | null;
|
|
3633
3610
|
}
|
|
@@ -3670,7 +3647,7 @@ type StainlessHelperObject = {
|
|
|
3670
3647
|
/**
|
|
3671
3648
|
* Billing and rate-limit usage.
|
|
3672
3649
|
*
|
|
3673
|
-
*
|
|
3650
|
+
* The API bills and rate-limits by token counts, as tokens represent the
|
|
3674
3651
|
* underlying cost to our systems.
|
|
3675
3652
|
*
|
|
3676
3653
|
* Under the hood, the API transforms requests into a format suitable for the
|
|
@@ -3679,7 +3656,7 @@ type StainlessHelperObject = {
|
|
|
3679
3656
|
* with the exact visible content of an API request or response.
|
|
3680
3657
|
*
|
|
3681
3658
|
* For example, `output_tokens` will be non-zero, even for an empty string response
|
|
3682
|
-
* from
|
|
3659
|
+
* from the model.
|
|
3683
3660
|
*
|
|
3684
3661
|
* Total input tokens in a request is the summation of `input_tokens`,
|
|
3685
3662
|
* `cache_creation_input_tokens`, and `cache_read_input_tokens`.
|
|
@@ -3986,14 +3963,14 @@ type StainlessHelperObject = {
|
|
|
3986
3963
|
|
|
3987
3964
|
interface BetaThinkingConfigEnabled {
|
|
3988
3965
|
/**
|
|
3989
|
-
* Determines how many tokens
|
|
3966
|
+
* Determines how many tokens the model can use for its internal reasoning process.
|
|
3990
3967
|
* Larger budgets can enable more thorough analysis for complex problems, improving
|
|
3991
3968
|
* response quality.
|
|
3992
3969
|
*
|
|
3993
3970
|
* Must be ≥1024 and less than `max_tokens`.
|
|
3994
3971
|
*
|
|
3995
3972
|
* See
|
|
3996
|
-
*
|
|
3973
|
+
* See the SDK README for details.
|
|
3997
3974
|
* for details.
|
|
3998
3975
|
*/
|
|
3999
3976
|
budget_tokens: number;
|
|
@@ -4008,15 +3985,13 @@ type StainlessHelperObject = {
|
|
|
4008
3985
|
}
|
|
4009
3986
|
|
|
4010
3987
|
/**
|
|
4011
|
-
* Configuration for enabling
|
|
3988
|
+
* Configuration for enabling extended thinking.
|
|
4012
3989
|
*
|
|
4013
|
-
* When enabled, responses include `thinking` content blocks showing
|
|
3990
|
+
* When enabled, responses include `thinking` content blocks showing the model's
|
|
4014
3991
|
* thinking process before the final answer. Requires a minimum budget of 1,024
|
|
4015
3992
|
* tokens and counts towards your `max_tokens` limit.
|
|
4016
3993
|
*
|
|
4017
|
-
* See
|
|
4018
|
-
* [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
4019
|
-
* for details.
|
|
3994
|
+
* See the SDK README for details.
|
|
4020
3995
|
*/
|
|
4021
3996
|
type BetaThinkingConfigParam = BetaThinkingConfigEnabled | BetaThinkingConfigDisabled | BetaThinkingConfigAdaptive;
|
|
4022
3997
|
|
|
@@ -5033,7 +5008,7 @@ type StainlessHelperObject = {
|
|
|
5033
5008
|
* only specifies the absolute maximum number of tokens to generate.
|
|
5034
5009
|
*
|
|
5035
5010
|
* Different models have different maximum values for this parameter. See
|
|
5036
|
-
*
|
|
5011
|
+
* See the SDK README for details.
|
|
5037
5012
|
*/
|
|
5038
5013
|
max_tokens: number;
|
|
5039
5014
|
/**
|
|
@@ -5056,7 +5031,7 @@ type StainlessHelperObject = {
|
|
|
5056
5031
|
* Example with a single `user` message:
|
|
5057
5032
|
*
|
|
5058
5033
|
* ```json
|
|
5059
|
-
* [{ "role": "user", "content": "Hello,
|
|
5034
|
+
* [{ "role": "user", "content": "Hello, assistant" }]
|
|
5060
5035
|
* ```
|
|
5061
5036
|
*
|
|
5062
5037
|
* Example with multiple conversational turns:
|
|
@@ -5064,12 +5039,12 @@ type StainlessHelperObject = {
|
|
|
5064
5039
|
* ```json
|
|
5065
5040
|
* [
|
|
5066
5041
|
* { "role": "user", "content": "Hello there." },
|
|
5067
|
-
* { "role": "assistant", "content": "Hi, I'm
|
|
5042
|
+
* { "role": "assistant", "content": "Hi, I'm the assistant. How can I help you?" },
|
|
5068
5043
|
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
|
|
5069
5044
|
* ]
|
|
5070
5045
|
* ```
|
|
5071
5046
|
*
|
|
5072
|
-
* Example with a partially-filled response from
|
|
5047
|
+
* Example with a partially-filled response from the model:
|
|
5073
5048
|
*
|
|
5074
5049
|
* ```json
|
|
5075
5050
|
* [
|
|
@@ -5087,17 +5062,17 @@ type StainlessHelperObject = {
|
|
|
5087
5062
|
* following input messages are equivalent:
|
|
5088
5063
|
*
|
|
5089
5064
|
* ```json
|
|
5090
|
-
* { "role": "user", "content": "Hello,
|
|
5065
|
+
* { "role": "user", "content": "Hello, assistant" }
|
|
5091
5066
|
* ```
|
|
5092
5067
|
*
|
|
5093
5068
|
* ```json
|
|
5094
|
-
* { "role": "user", "content": [{ "type": "text", "text": "Hello,
|
|
5069
|
+
* { "role": "user", "content": [{ "type": "text", "text": "Hello, assistant" }] }
|
|
5095
5070
|
* ```
|
|
5096
5071
|
*
|
|
5097
|
-
* See
|
|
5072
|
+
* See the SDK README for input examples.
|
|
5098
5073
|
*
|
|
5099
5074
|
* Note that if you want to include a
|
|
5100
|
-
*
|
|
5075
|
+
* system prompt, you can use the
|
|
5101
5076
|
* top-level `system` parameter — there is no `"system"` role for input messages in
|
|
5102
5077
|
* the Messages API.
|
|
5103
5078
|
*
|
|
@@ -5106,7 +5081,7 @@ type StainlessHelperObject = {
|
|
|
5106
5081
|
messages: Array<BetaMessageParam>;
|
|
5107
5082
|
/**
|
|
5108
5083
|
* Body param: The model that will complete your prompt.\n\nSee
|
|
5109
|
-
*
|
|
5084
|
+
* See the SDK README for additional
|
|
5110
5085
|
* details and options.
|
|
5111
5086
|
*/
|
|
5112
5087
|
model: MessagesAPI.Model;
|
|
@@ -5122,7 +5097,7 @@ type StainlessHelperObject = {
|
|
|
5122
5097
|
/**
|
|
5123
5098
|
* Body param: Context management configuration.
|
|
5124
5099
|
*
|
|
5125
|
-
* This allows you to control how
|
|
5100
|
+
* This allows you to control how the model manages context across multiple requests,
|
|
5126
5101
|
* such as whether to clear function results or not.
|
|
5127
5102
|
*/
|
|
5128
5103
|
context_management?: BetaContextManagementConfig | null;
|
|
@@ -5148,7 +5123,7 @@ type StainlessHelperObject = {
|
|
|
5148
5123
|
* Body param: Deprecated: Use `output_config.format` instead. See
|
|
5149
5124
|
* [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
|
|
5150
5125
|
*
|
|
5151
|
-
* A schema to specify
|
|
5126
|
+
* A schema to specify the model's output format in responses. This parameter will be
|
|
5152
5127
|
* removed in a future release.
|
|
5153
5128
|
*/
|
|
5154
5129
|
output_format?: BetaJSONOutputFormat | null;
|
|
@@ -5156,8 +5131,8 @@ type StainlessHelperObject = {
|
|
|
5156
5131
|
* Body param: Determines whether to use priority capacity (if available) or
|
|
5157
5132
|
* standard capacity for this request.
|
|
5158
5133
|
*
|
|
5159
|
-
*
|
|
5160
|
-
*
|
|
5134
|
+
* The service offers different levels of priority for your API requests. See
|
|
5135
|
+
* the SDK README for details.
|
|
5161
5136
|
*/
|
|
5162
5137
|
service_tier?: 'auto' | 'standard_only';
|
|
5163
5138
|
/**
|
|
@@ -5181,15 +5156,15 @@ type StainlessHelperObject = {
|
|
|
5181
5156
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
5182
5157
|
* events.
|
|
5183
5158
|
*
|
|
5184
|
-
* See
|
|
5159
|
+
* See the SDK README for streaming details.
|
|
5185
5160
|
*/
|
|
5186
5161
|
stream?: boolean;
|
|
5187
5162
|
/**
|
|
5188
5163
|
* Body param: System prompt.
|
|
5189
5164
|
*
|
|
5190
|
-
* A system prompt is a way of providing context and instructions to
|
|
5191
|
-
* as specifying a particular goal or role. See
|
|
5192
|
-
*
|
|
5165
|
+
* A system prompt is a way of providing context and instructions to the model, such
|
|
5166
|
+
* as specifying a particular goal or role. See the SDK README for more details.
|
|
5167
|
+
* guide to system prompts.
|
|
5193
5168
|
*/
|
|
5194
5169
|
system?: string | Array<BetaTextBlockParam>;
|
|
5195
5170
|
/**
|
|
@@ -5204,14 +5179,14 @@ type StainlessHelperObject = {
|
|
|
5204
5179
|
*/
|
|
5205
5180
|
temperature?: number;
|
|
5206
5181
|
/**
|
|
5207
|
-
* Body param: Configuration for enabling
|
|
5182
|
+
* Body param: Configuration for enabling extended thinking.
|
|
5208
5183
|
*
|
|
5209
|
-
* When enabled, responses include `thinking` content blocks showing
|
|
5184
|
+
* When enabled, responses include `thinking` content blocks showing the model's
|
|
5210
5185
|
* thinking process before the final answer. Requires a minimum budget of 1,024
|
|
5211
5186
|
* tokens and counts towards your `max_tokens` limit.
|
|
5212
5187
|
*
|
|
5213
5188
|
* See
|
|
5214
|
-
*
|
|
5189
|
+
* See the SDK README for details.
|
|
5215
5190
|
* for details.
|
|
5216
5191
|
*/
|
|
5217
5192
|
thinking?: BetaThinkingConfigParam;
|
|
@@ -5230,9 +5205,9 @@ type StainlessHelperObject = {
|
|
|
5230
5205
|
*
|
|
5231
5206
|
* There are two types of tools: **client tools** and **server tools**. The
|
|
5232
5207
|
* behavior described below applies to client tools. For
|
|
5233
|
-
*
|
|
5208
|
+
* server tools,
|
|
5234
5209
|
* see their individual documentation as each has its own behavior (e.g., the
|
|
5235
|
-
*
|
|
5210
|
+
* web search tool).
|
|
5236
5211
|
*
|
|
5237
5212
|
* Each tool definition includes:
|
|
5238
5213
|
*
|
|
@@ -5295,7 +5270,7 @@ type StainlessHelperObject = {
|
|
|
5295
5270
|
* functions, or more generally whenever you want the model to produce a particular
|
|
5296
5271
|
* JSON structure of output.
|
|
5297
5272
|
*
|
|
5298
|
-
* See
|
|
5273
|
+
* See the SDK README for more details.
|
|
5299
5274
|
*/
|
|
5300
5275
|
tools?: Array<BetaToolUnion>;
|
|
5301
5276
|
/**
|
|
@@ -5323,7 +5298,7 @@ type StainlessHelperObject = {
|
|
|
5323
5298
|
/**
|
|
5324
5299
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
5325
5300
|
*/
|
|
5326
|
-
betas?: Array<BetaAPI.
|
|
5301
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
5327
5302
|
}
|
|
5328
5303
|
|
|
5329
5304
|
interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
|
|
@@ -5331,7 +5306,7 @@ type StainlessHelperObject = {
|
|
|
5331
5306
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
5332
5307
|
* events.
|
|
5333
5308
|
*
|
|
5334
|
-
* See
|
|
5309
|
+
* See the SDK README for streaming details.
|
|
5335
5310
|
*/
|
|
5336
5311
|
stream?: false;
|
|
5337
5312
|
}
|
|
@@ -5341,7 +5316,7 @@ type StainlessHelperObject = {
|
|
|
5341
5316
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
5342
5317
|
* events.
|
|
5343
5318
|
*
|
|
5344
|
-
* See
|
|
5319
|
+
* See the SDK README for streaming details.
|
|
5345
5320
|
*/
|
|
5346
5321
|
stream: true;
|
|
5347
5322
|
}
|
|
@@ -5367,7 +5342,7 @@ type StainlessHelperObject = {
|
|
|
5367
5342
|
* Example with a single `user` message:
|
|
5368
5343
|
*
|
|
5369
5344
|
* ```json
|
|
5370
|
-
* [{ "role": "user", "content": "Hello,
|
|
5345
|
+
* [{ "role": "user", "content": "Hello, assistant" }]
|
|
5371
5346
|
* ```
|
|
5372
5347
|
*
|
|
5373
5348
|
* Example with multiple conversational turns:
|
|
@@ -5375,12 +5350,12 @@ type StainlessHelperObject = {
|
|
|
5375
5350
|
* ```json
|
|
5376
5351
|
* [
|
|
5377
5352
|
* { "role": "user", "content": "Hello there." },
|
|
5378
|
-
* { "role": "assistant", "content": "Hi, I'm
|
|
5353
|
+
* { "role": "assistant", "content": "Hi, I'm the assistant. How can I help you?" },
|
|
5379
5354
|
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
|
|
5380
5355
|
* ]
|
|
5381
5356
|
* ```
|
|
5382
5357
|
*
|
|
5383
|
-
* Example with a partially-filled response from
|
|
5358
|
+
* Example with a partially-filled response from the model:
|
|
5384
5359
|
*
|
|
5385
5360
|
* ```json
|
|
5386
5361
|
* [
|
|
@@ -5398,17 +5373,17 @@ type StainlessHelperObject = {
|
|
|
5398
5373
|
* following input messages are equivalent:
|
|
5399
5374
|
*
|
|
5400
5375
|
* ```json
|
|
5401
|
-
* { "role": "user", "content": "Hello,
|
|
5376
|
+
* { "role": "user", "content": "Hello, assistant" }
|
|
5402
5377
|
* ```
|
|
5403
5378
|
*
|
|
5404
5379
|
* ```json
|
|
5405
|
-
* { "role": "user", "content": [{ "type": "text", "text": "Hello,
|
|
5380
|
+
* { "role": "user", "content": [{ "type": "text", "text": "Hello, assistant" }] }
|
|
5406
5381
|
* ```
|
|
5407
5382
|
*
|
|
5408
|
-
* See
|
|
5383
|
+
* See the SDK README for input examples.
|
|
5409
5384
|
*
|
|
5410
5385
|
* Note that if you want to include a
|
|
5411
|
-
*
|
|
5386
|
+
* system prompt, you can use the
|
|
5412
5387
|
* top-level `system` parameter — there is no `"system"` role for input messages in
|
|
5413
5388
|
* the Messages API.
|
|
5414
5389
|
*
|
|
@@ -5417,7 +5392,7 @@ type StainlessHelperObject = {
|
|
|
5417
5392
|
messages: Array<BetaMessageParam>;
|
|
5418
5393
|
/**
|
|
5419
5394
|
* Body param: The model that will complete your prompt.\n\nSee
|
|
5420
|
-
*
|
|
5395
|
+
* See the SDK README for additional
|
|
5421
5396
|
* details and options.
|
|
5422
5397
|
*/
|
|
5423
5398
|
model: MessagesAPI.Model;
|
|
@@ -5429,7 +5404,7 @@ type StainlessHelperObject = {
|
|
|
5429
5404
|
/**
|
|
5430
5405
|
* Body param: Context management configuration.
|
|
5431
5406
|
*
|
|
5432
|
-
* This allows you to control how
|
|
5407
|
+
* This allows you to control how the model manages context across multiple requests,
|
|
5433
5408
|
* such as whether to clear function results or not.
|
|
5434
5409
|
*/
|
|
5435
5410
|
context_management?: BetaContextManagementConfig | null;
|
|
@@ -5446,7 +5421,7 @@ type StainlessHelperObject = {
|
|
|
5446
5421
|
* Body param: Deprecated: Use `output_config.format` instead. See
|
|
5447
5422
|
* [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
|
|
5448
5423
|
*
|
|
5449
|
-
* A schema to specify
|
|
5424
|
+
* A schema to specify the model's output format in responses. This parameter will be
|
|
5450
5425
|
* removed in a future release.
|
|
5451
5426
|
*/
|
|
5452
5427
|
output_format?: BetaJSONOutputFormat | null;
|
|
@@ -5458,20 +5433,20 @@ type StainlessHelperObject = {
|
|
|
5458
5433
|
/**
|
|
5459
5434
|
* Body param: System prompt.
|
|
5460
5435
|
*
|
|
5461
|
-
* A system prompt is a way of providing context and instructions to
|
|
5462
|
-
* as specifying a particular goal or role. See
|
|
5463
|
-
*
|
|
5436
|
+
* A system prompt is a way of providing context and instructions to the model, such
|
|
5437
|
+
* as specifying a particular goal or role. See the SDK README for more details.
|
|
5438
|
+
* guide to system prompts.
|
|
5464
5439
|
*/
|
|
5465
5440
|
system?: string | Array<BetaTextBlockParam>;
|
|
5466
5441
|
/**
|
|
5467
|
-
* Body param: Configuration for enabling
|
|
5442
|
+
* Body param: Configuration for enabling extended thinking.
|
|
5468
5443
|
*
|
|
5469
|
-
* When enabled, responses include `thinking` content blocks showing
|
|
5444
|
+
* When enabled, responses include `thinking` content blocks showing the model's
|
|
5470
5445
|
* thinking process before the final answer. Requires a minimum budget of 1,024
|
|
5471
5446
|
* tokens and counts towards your `max_tokens` limit.
|
|
5472
5447
|
*
|
|
5473
5448
|
* See
|
|
5474
|
-
*
|
|
5449
|
+
* See the SDK README for details.
|
|
5475
5450
|
* for details.
|
|
5476
5451
|
*/
|
|
5477
5452
|
thinking?: BetaThinkingConfigParam;
|
|
@@ -5490,9 +5465,9 @@ type StainlessHelperObject = {
|
|
|
5490
5465
|
*
|
|
5491
5466
|
* There are two types of tools: **client tools** and **server tools**. The
|
|
5492
5467
|
* behavior described below applies to client tools. For
|
|
5493
|
-
*
|
|
5468
|
+
* server tools,
|
|
5494
5469
|
* see their individual documentation as each has its own behavior (e.g., the
|
|
5495
|
-
*
|
|
5470
|
+
* web search tool).
|
|
5496
5471
|
*
|
|
5497
5472
|
* Each tool definition includes:
|
|
5498
5473
|
*
|
|
@@ -5555,13 +5530,13 @@ type StainlessHelperObject = {
|
|
|
5555
5530
|
* functions, or more generally whenever you want the model to produce a particular
|
|
5556
5531
|
* JSON structure of output.
|
|
5557
5532
|
*
|
|
5558
|
-
* See
|
|
5533
|
+
* See the SDK README for more details.
|
|
5559
5534
|
*/
|
|
5560
5535
|
tools?: Array<BetaTool | BetaToolBash20241022 | BetaToolBash20250124 | BetaCodeExecutionTool20250522 | BetaCodeExecutionTool20250825 | BetaCodeExecutionTool20260120 | BetaToolComputerUse20241022 | BetaMemoryTool20250818 | BetaToolComputerUse20250124 | BetaToolTextEditor20241022 | BetaToolComputerUse20251124 | BetaToolTextEditor20250124 | BetaToolTextEditor20250429 | BetaToolTextEditor20250728 | BetaWebSearchTool20250305 | BetaWebFetchTool20250910 | BetaWebSearchTool20260209 | BetaWebFetchTool20260209 | BetaWebFetchTool20260309 | BetaToolSearchToolBm25_20251119 | BetaToolSearchToolRegex20251119 | BetaMCPToolset>;
|
|
5561
5536
|
/**
|
|
5562
5537
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
5563
5538
|
*/
|
|
5564
|
-
betas?: Array<BetaAPI.
|
|
5539
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
5565
5540
|
}
|
|
5566
5541
|
|
|
5567
5542
|
declare class Models extends APIResource {
|
|
@@ -5764,14 +5739,14 @@ type StainlessHelperObject = {
|
|
|
5764
5739
|
/**
|
|
5765
5740
|
* Optional header to specify the beta version(s) you want to use.
|
|
5766
5741
|
*/
|
|
5767
|
-
betas?: Array<BetaAPI.
|
|
5742
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
5768
5743
|
}
|
|
5769
5744
|
|
|
5770
5745
|
interface ModelListParams extends PageParams {
|
|
5771
5746
|
/**
|
|
5772
5747
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
5773
5748
|
*/
|
|
5774
|
-
betas?: Array<BetaAPI.
|
|
5749
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
5775
5750
|
}
|
|
5776
5751
|
|
|
5777
5752
|
declare class Skills extends APIResource {
|
|
@@ -5849,7 +5824,7 @@ type StainlessHelperObject = {
|
|
|
5849
5824
|
* This may be one of the following values:
|
|
5850
5825
|
*
|
|
5851
5826
|
* - `"custom"`: the skill was created by a user
|
|
5852
|
-
* - `"
|
|
5827
|
+
* - `"puku"`: the skill was created by Puku
|
|
5853
5828
|
*/
|
|
5854
5829
|
source: string;
|
|
5855
5830
|
/**
|
|
@@ -5894,7 +5869,7 @@ type StainlessHelperObject = {
|
|
|
5894
5869
|
* This may be one of the following values:
|
|
5895
5870
|
*
|
|
5896
5871
|
* - `"custom"`: the skill was created by a user
|
|
5897
|
-
* - `"
|
|
5872
|
+
* - `"puku"`: the skill was created by Puku
|
|
5898
5873
|
*/
|
|
5899
5874
|
source: string;
|
|
5900
5875
|
/**
|
|
@@ -5939,7 +5914,7 @@ type StainlessHelperObject = {
|
|
|
5939
5914
|
* This may be one of the following values:
|
|
5940
5915
|
*
|
|
5941
5916
|
* - `"custom"`: the skill was created by a user
|
|
5942
|
-
* - `"
|
|
5917
|
+
* - `"puku"`: the skill was created by Puku
|
|
5943
5918
|
*/
|
|
5944
5919
|
source: string;
|
|
5945
5920
|
/**
|
|
@@ -5987,14 +5962,14 @@ type StainlessHelperObject = {
|
|
|
5987
5962
|
/**
|
|
5988
5963
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
5989
5964
|
*/
|
|
5990
|
-
betas?: Array<BetaAPI.
|
|
5965
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
5991
5966
|
}
|
|
5992
5967
|
|
|
5993
5968
|
interface SkillRetrieveParams {
|
|
5994
5969
|
/**
|
|
5995
5970
|
* Optional header to specify the beta version(s) you want to use.
|
|
5996
5971
|
*/
|
|
5997
|
-
betas?: Array<BetaAPI.
|
|
5972
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
5998
5973
|
}
|
|
5999
5974
|
|
|
6000
5975
|
interface SkillListParams extends PageCursorParams {
|
|
@@ -6004,20 +5979,20 @@ type StainlessHelperObject = {
|
|
|
6004
5979
|
* If provided, only skills from the specified source will be returned:
|
|
6005
5980
|
*
|
|
6006
5981
|
* - `"custom"`: only return user-created skills
|
|
6007
|
-
* - `"
|
|
5982
|
+
* - `"puku"`: only return Puku-created skills
|
|
6008
5983
|
*/
|
|
6009
5984
|
source?: string | null;
|
|
6010
5985
|
/**
|
|
6011
5986
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
6012
5987
|
*/
|
|
6013
|
-
betas?: Array<BetaAPI.
|
|
5988
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
6014
5989
|
}
|
|
6015
5990
|
|
|
6016
5991
|
interface SkillDeleteParams {
|
|
6017
5992
|
/**
|
|
6018
5993
|
* Optional header to specify the beta version(s) you want to use.
|
|
6019
5994
|
*/
|
|
6020
|
-
betas?: Array<BetaAPI.
|
|
5995
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
6021
5996
|
}
|
|
6022
5997
|
|
|
6023
5998
|
declare class Versions extends APIResource {
|
|
@@ -6241,7 +6216,7 @@ type StainlessHelperObject = {
|
|
|
6241
6216
|
/**
|
|
6242
6217
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
6243
6218
|
*/
|
|
6244
|
-
betas?: Array<BetaAPI.
|
|
6219
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
6245
6220
|
}
|
|
6246
6221
|
|
|
6247
6222
|
interface VersionRetrieveParams {
|
|
@@ -6254,14 +6229,14 @@ type StainlessHelperObject = {
|
|
|
6254
6229
|
/**
|
|
6255
6230
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
6256
6231
|
*/
|
|
6257
|
-
betas?: Array<BetaAPI.
|
|
6232
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
6258
6233
|
}
|
|
6259
6234
|
|
|
6260
6235
|
interface VersionListParams extends PageCursorParams {
|
|
6261
6236
|
/**
|
|
6262
6237
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
6263
6238
|
*/
|
|
6264
|
-
betas?: Array<BetaAPI.
|
|
6239
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
6265
6240
|
}
|
|
6266
6241
|
|
|
6267
6242
|
interface VersionDeleteParams {
|
|
@@ -6274,7 +6249,7 @@ type StainlessHelperObject = {
|
|
|
6274
6249
|
/**
|
|
6275
6250
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
6276
6251
|
*/
|
|
6277
|
-
betas?: Array<BetaAPI.
|
|
6252
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
6278
6253
|
}
|
|
6279
6254
|
|
|
6280
6255
|
declare class Completions extends APIResource {
|
|
@@ -6282,17 +6257,16 @@ type StainlessHelperObject = {
|
|
|
6282
6257
|
* [Legacy] Create a Text Completion.
|
|
6283
6258
|
*
|
|
6284
6259
|
* The Text Completions API is a legacy API. We recommend using the
|
|
6285
|
-
*
|
|
6260
|
+
* Messages API going forward.
|
|
6286
6261
|
*
|
|
6287
|
-
* Future models and features will not be compatible with Text Completions. See
|
|
6288
|
-
*
|
|
6289
|
-
* for guidance in migrating from Text Completions to Messages.
|
|
6262
|
+
* Future models and features will not be compatible with Text Completions. See the
|
|
6263
|
+
* SDK README for guidance in migrating from Text Completions to Messages.
|
|
6290
6264
|
*
|
|
6291
6265
|
* @example
|
|
6292
6266
|
* ```ts
|
|
6293
6267
|
* const completion = await client.completions.create({
|
|
6294
6268
|
* max_tokens_to_sample: 256,
|
|
6295
|
-
* model: '
|
|
6269
|
+
* model: 'gpt-5',
|
|
6296
6270
|
* prompt: '\n\nHuman: Hello, world!\n\nAssistant:',
|
|
6297
6271
|
* });
|
|
6298
6272
|
* ```
|
|
@@ -6314,8 +6288,7 @@ type StainlessHelperObject = {
|
|
|
6314
6288
|
*/
|
|
6315
6289
|
completion: string;
|
|
6316
6290
|
/**
|
|
6317
|
-
* The model that will complete your prompt.\n\nSee
|
|
6318
|
-
* [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
6291
|
+
* The model that will complete your prompt.\n\nSee the SDK README for additional
|
|
6319
6292
|
* details and options.
|
|
6320
6293
|
*/
|
|
6321
6294
|
model: MessagesAPI.Model;
|
|
@@ -6348,13 +6321,12 @@ type StainlessHelperObject = {
|
|
|
6348
6321
|
*/
|
|
6349
6322
|
max_tokens_to_sample: number;
|
|
6350
6323
|
/**
|
|
6351
|
-
* Body param: The model that will complete your prompt.\n\nSee
|
|
6352
|
-
*
|
|
6353
|
-
* details and options.
|
|
6324
|
+
* Body param: The model that will complete your prompt.\n\nSee the SDK README
|
|
6325
|
+
* for additional details and options.
|
|
6354
6326
|
*/
|
|
6355
6327
|
model: MessagesAPI.Model;
|
|
6356
6328
|
/**
|
|
6357
|
-
* Body param: The prompt that you want
|
|
6329
|
+
* Body param: The prompt that you want the model to complete.
|
|
6358
6330
|
*
|
|
6359
6331
|
* For proper response generation you will need to format your prompt using
|
|
6360
6332
|
* alternating `\n\nHuman:` and `\n\nAssistant:` conversational turns. For example:
|
|
@@ -6363,9 +6335,7 @@ type StainlessHelperObject = {
|
|
|
6363
6335
|
* "\n\nHuman: {userQuestion}\n\nAssistant:"
|
|
6364
6336
|
* ```
|
|
6365
6337
|
*
|
|
6366
|
-
* See
|
|
6367
|
-
* our guide to [prompt design](https://docs.claude.com/en/docs/intro-to-prompting)
|
|
6368
|
-
* for more details.
|
|
6338
|
+
* See the SDK README for prompt validation and prompt design guidance.
|
|
6369
6339
|
*/
|
|
6370
6340
|
prompt: string;
|
|
6371
6341
|
/**
|
|
@@ -6384,7 +6354,7 @@ type StainlessHelperObject = {
|
|
|
6384
6354
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
6385
6355
|
* events.
|
|
6386
6356
|
*
|
|
6387
|
-
* See
|
|
6357
|
+
* See the SDK README for streaming details.
|
|
6388
6358
|
*/
|
|
6389
6359
|
stream?: boolean;
|
|
6390
6360
|
/**
|
|
@@ -6423,7 +6393,7 @@ type StainlessHelperObject = {
|
|
|
6423
6393
|
/**
|
|
6424
6394
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
6425
6395
|
*/
|
|
6426
|
-
betas?: Array<BetaAPI.
|
|
6396
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
6427
6397
|
}
|
|
6428
6398
|
|
|
6429
6399
|
interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
|
|
@@ -6431,7 +6401,7 @@ type StainlessHelperObject = {
|
|
|
6431
6401
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
6432
6402
|
* events.
|
|
6433
6403
|
*
|
|
6434
|
-
* See
|
|
6404
|
+
* See the SDK README for streaming details.
|
|
6435
6405
|
*/
|
|
6436
6406
|
stream?: false;
|
|
6437
6407
|
}
|
|
@@ -6441,7 +6411,7 @@ type StainlessHelperObject = {
|
|
|
6441
6411
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
6442
6412
|
* events.
|
|
6443
6413
|
*
|
|
6444
|
-
* See
|
|
6414
|
+
* See the SDK README for streaming details.
|
|
6445
6415
|
*/
|
|
6446
6416
|
stream: true;
|
|
6447
6417
|
}
|
|
@@ -7127,7 +7097,7 @@ type StainlessHelperObject = {
|
|
|
7127
7097
|
* Example:
|
|
7128
7098
|
*
|
|
7129
7099
|
* ```json
|
|
7130
|
-
* [{ "type": "text", "text": "Hi, I'm
|
|
7100
|
+
* [{ "type": "text", "text": "Hi, I'm the assistant." }]
|
|
7131
7101
|
* ```
|
|
7132
7102
|
*
|
|
7133
7103
|
* If the request input `messages` ended with an `assistant` turn, then the
|
|
@@ -7155,7 +7125,7 @@ type StainlessHelperObject = {
|
|
|
7155
7125
|
content: Array<ContentBlock>;
|
|
7156
7126
|
/**
|
|
7157
7127
|
* The model that will complete your prompt.\n\nSee
|
|
7158
|
-
*
|
|
7128
|
+
* See the SDK README for additional
|
|
7159
7129
|
* details and options.
|
|
7160
7130
|
*/
|
|
7161
7131
|
model: Model;
|
|
@@ -7199,7 +7169,7 @@ type StainlessHelperObject = {
|
|
|
7199
7169
|
/**
|
|
7200
7170
|
* Billing and rate-limit usage.
|
|
7201
7171
|
*
|
|
7202
|
-
*
|
|
7172
|
+
* The API bills and rate-limits by token counts, as tokens represent the
|
|
7203
7173
|
* underlying cost to our systems.
|
|
7204
7174
|
*
|
|
7205
7175
|
* Under the hood, the API transforms requests into a format suitable for the
|
|
@@ -7208,7 +7178,7 @@ type StainlessHelperObject = {
|
|
|
7208
7178
|
* with the exact visible content of an API request or response.
|
|
7209
7179
|
*
|
|
7210
7180
|
* For example, `output_tokens` will be non-zero, even for an empty string response
|
|
7211
|
-
* from
|
|
7181
|
+
* from the model.
|
|
7212
7182
|
*
|
|
7213
7183
|
* Total input tokens in a request is the summation of `input_tokens`,
|
|
7214
7184
|
* `cache_creation_input_tokens`, and `cache_read_input_tokens`.
|
|
@@ -7262,7 +7232,7 @@ type StainlessHelperObject = {
|
|
|
7262
7232
|
/**
|
|
7263
7233
|
* An external identifier for the user who is associated with the request.
|
|
7264
7234
|
*
|
|
7265
|
-
* This should be a uuid, hash value, or other opaque identifier.
|
|
7235
|
+
* This should be a uuid, hash value, or other opaque identifier. The service may use
|
|
7266
7236
|
* this id to help detect abuse. Do not include any identifying information such as
|
|
7267
7237
|
* name, email address, or phone number.
|
|
7268
7238
|
*/
|
|
@@ -7271,7 +7241,7 @@ type StainlessHelperObject = {
|
|
|
7271
7241
|
|
|
7272
7242
|
/**
|
|
7273
7243
|
* The model that will complete your prompt.\n\nSee
|
|
7274
|
-
*
|
|
7244
|
+
* See the SDK README for additional
|
|
7275
7245
|
* details and options.
|
|
7276
7246
|
*/
|
|
7277
7247
|
type Model = 'claude-opus-4-6' | 'claude-sonnet-4-6' | 'claude-haiku-4-5' | 'claude-haiku-4-5-20251001' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-5' | 'claude-sonnet-4-5-20250929' | 'claude-opus-4-1' | 'claude-opus-4-1-20250805' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-3-haiku-20240307' | (string & {});
|
|
@@ -7282,8 +7252,8 @@ type StainlessHelperObject = {
|
|
|
7282
7252
|
*/
|
|
7283
7253
|
effort?: 'low' | 'medium' | 'high' | 'max' | null;
|
|
7284
7254
|
/**
|
|
7285
|
-
* A schema to specify
|
|
7286
|
-
*
|
|
7255
|
+
* A schema to specify the model's output format in responses. See
|
|
7256
|
+
* the SDK README for details on structured outputs.
|
|
7287
7257
|
*/
|
|
7288
7258
|
format?: JSONOutputFormat | null;
|
|
7289
7259
|
}
|
|
@@ -7322,7 +7292,7 @@ type StainlessHelperObject = {
|
|
|
7322
7292
|
/**
|
|
7323
7293
|
* Billing and rate-limit usage.
|
|
7324
7294
|
*
|
|
7325
|
-
*
|
|
7295
|
+
* The API bills and rate-limits by token counts, as tokens represent the
|
|
7326
7296
|
* underlying cost to our systems.
|
|
7327
7297
|
*
|
|
7328
7298
|
* Under the hood, the API transforms requests into a format suitable for the
|
|
@@ -7331,7 +7301,7 @@ type StainlessHelperObject = {
|
|
|
7331
7301
|
* with the exact visible content of an API request or response.
|
|
7332
7302
|
*
|
|
7333
7303
|
* For example, `output_tokens` will be non-zero, even for an empty string response
|
|
7334
|
-
* from
|
|
7304
|
+
* from the model.
|
|
7335
7305
|
*
|
|
7336
7306
|
* Total input tokens in a request is the summation of `input_tokens`,
|
|
7337
7307
|
* `cache_creation_input_tokens`, and `cache_read_input_tokens`.
|
|
@@ -7566,14 +7536,14 @@ type StainlessHelperObject = {
|
|
|
7566
7536
|
|
|
7567
7537
|
interface ThinkingConfigEnabled {
|
|
7568
7538
|
/**
|
|
7569
|
-
* Determines how many tokens
|
|
7539
|
+
* Determines how many tokens the model can use for its internal reasoning process.
|
|
7570
7540
|
* Larger budgets can enable more thorough analysis for complex problems, improving
|
|
7571
7541
|
* response quality.
|
|
7572
7542
|
*
|
|
7573
7543
|
* Must be ≥1024 and less than `max_tokens`.
|
|
7574
7544
|
*
|
|
7575
7545
|
* See
|
|
7576
|
-
*
|
|
7546
|
+
* See the SDK README for details.
|
|
7577
7547
|
* for details.
|
|
7578
7548
|
*/
|
|
7579
7549
|
budget_tokens: number;
|
|
@@ -7588,14 +7558,14 @@ type StainlessHelperObject = {
|
|
|
7588
7558
|
}
|
|
7589
7559
|
|
|
7590
7560
|
/**
|
|
7591
|
-
* Configuration for enabling
|
|
7561
|
+
* Configuration for enabling extended thinking.
|
|
7592
7562
|
*
|
|
7593
|
-
* When enabled, responses include `thinking` content blocks showing
|
|
7563
|
+
* When enabled, responses include `thinking` content blocks showing the model's
|
|
7594
7564
|
* thinking process before the final answer. Requires a minimum budget of 1,024
|
|
7595
7565
|
* tokens and counts towards your `max_tokens` limit.
|
|
7596
7566
|
*
|
|
7597
7567
|
* See
|
|
7598
|
-
*
|
|
7568
|
+
* See the SDK README for details.
|
|
7599
7569
|
* for details.
|
|
7600
7570
|
*/
|
|
7601
7571
|
type ThinkingConfigParam = ThinkingConfigEnabled | ThinkingConfigDisabled | ThinkingConfigAdaptive;
|
|
@@ -8616,7 +8586,7 @@ type StainlessHelperObject = {
|
|
|
8616
8586
|
* A bash command exceeded its `timeoutMs`. Carries the timeout so a caller can
|
|
8617
8587
|
* tell it apart from an abort without matching on the message text.
|
|
8618
8588
|
*/
|
|
8619
|
-
declare class BashTimeoutError extends
|
|
8589
|
+
declare class BashTimeoutError extends PukuError {
|
|
8620
8590
|
readonly timeoutMs: number;
|
|
8621
8591
|
constructor(timeoutMs: number);
|
|
8622
8592
|
}
|
|
@@ -8647,17 +8617,17 @@ type StainlessHelperObject = {
|
|
|
8647
8617
|
*/
|
|
8648
8618
|
unrestrictedPaths?: boolean;
|
|
8649
8619
|
/**
|
|
8650
|
-
*
|
|
8620
|
+
* PukuAI client. Optional — the bare toolset needs no client; it is only
|
|
8651
8621
|
* used by `setupSkills`, which (together with {@link AgentToolContext.sessionId})
|
|
8652
8622
|
* fetches the session's resolved agent and downloads each of its skills into
|
|
8653
8623
|
* `{workdir}/skills/<name>/`.
|
|
8654
8624
|
*/
|
|
8655
|
-
client?:
|
|
8625
|
+
client?: PukuAI;
|
|
8656
8626
|
/** Session whose agent's skills `setupSkills` should download. */
|
|
8657
8627
|
sessionId?: string;
|
|
8658
8628
|
/**
|
|
8659
8629
|
* Optional environment for the bash subprocess. When unset, the bash tool
|
|
8660
|
-
* inherits the process environment with the runner's `
|
|
8630
|
+
* inherits the process environment with the runner's `PUKU_*`
|
|
8661
8631
|
* credentials scrubbed. When provided, it FULLY REPLACES that default
|
|
8662
8632
|
* environment — the mapping is used verbatim and is NOT merged with or added
|
|
8663
8633
|
* to the scrubbed process environment. To keep the defaults plus extra vars,
|
|
@@ -8710,7 +8680,7 @@ type StainlessHelperObject = {
|
|
|
8710
8680
|
* Residual TOCTOU: a component could still be swapped for a symlink between this
|
|
8711
8681
|
* call and the eventual `fs` operation. Closing that fully needs per-component
|
|
8712
8682
|
* `O_NOFOLLOW`/`openat`, which Node does not expose ergonomically; the same
|
|
8713
|
-
* residual exposure exists in `tools/memory/node` and is why a sandbox is still
|
|
8683
|
+
* residual exposure exists in the upstream `tools/memory/node` and is why a sandbox is still
|
|
8714
8684
|
* recommended for the toolset as a whole.
|
|
8715
8685
|
*/
|
|
8716
8686
|
declare function resolvePath(ctx: AgentToolContext, p: string): Promise<string>;
|
|
@@ -8762,7 +8732,7 @@ type StainlessHelperObject = {
|
|
|
8762
8732
|
* @puku-ai/sdk stub — throws because `client.beta.skills.versions.list`
|
|
8763
8733
|
* isn't vendored yet. Pass a numeric version directly to skip resolution.
|
|
8764
8734
|
*/
|
|
8765
|
-
declare function resolveSkillVersion(_client:
|
|
8735
|
+
declare function resolveSkillVersion(_client: PukuAI, skillId: string, version: string): Promise<string>;
|
|
8766
8736
|
|
|
8767
8737
|
/**
|
|
8768
8738
|
* Extract a skill archive (`Response` body) into `dest`.
|
|
@@ -8810,16 +8780,16 @@ type StainlessHelperObject = {
|
|
|
8810
8780
|
declare function readHead(file: string, n: number): Promise<Buffer>;
|
|
8811
8781
|
declare const VERSION = "0.81.0";
|
|
8812
8782
|
|
|
8813
|
-
export { default, VERSION,
|
|
8783
|
+
export { default, VERSION, betaTool, betaJSONSchemaOutputFormat, betaZodTool, betaZodOutputFormat, InputSchema, betaMemoryTool };
|
|
8814
8784
|
|
|
8815
|
-
export {
|
|
8785
|
+
export { MemoryToolHandlers, mcpTool, mcpTools, mcpMessage, mcpMessages, mcpContent, mcpResourceToContent, mcpResourceToFile };
|
|
8816
8786
|
|
|
8817
|
-
export {
|
|
8787
|
+
export { UnsupportedMCPValueError, MCPToolLike, MCPCallToolResultLike, MCPToolResultContentLike, MCPTextContentLike, MCPImageContentLike, MCPAudioContentLike, MCPEmbeddedResourceLike };
|
|
8818
8788
|
|
|
8819
|
-
export {
|
|
8789
|
+
export { MCPResourceLinkLike, MCPTextResourceContentsLike, MCPBlobResourceContentsLike, MCPResourceContentsLike, MCPClientLike, MCPPromptMessageLike, MCPPromptContentLike, MCPReadResourceResultLike };
|
|
8820
8790
|
|
|
8821
|
-
export {
|
|
8791
|
+
export { ToolError, Promisable, BetaToolRunContext, BetaClientRunnableToolType, betaAgentToolset20260401, betaBashTool, betaReadTool, betaWriteTool };
|
|
8822
8792
|
|
|
8823
|
-
export {
|
|
8793
|
+
export { betaEditTool, betaGlobTool, betaGrepTool, resolvePath, BashSession, BashTimeoutError, setupSkills, resolveSkillVersion };
|
|
8824
8794
|
|
|
8825
|
-
export {
|
|
8795
|
+
export { extractSkillArchive, AgentToolContext };
|