MessagesMessageParamContentUnion1 - TypeScript SDK

MessagesMessageParamContentUnion1 type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Supported Types

models.AnthropicTextBlockParam

1const value: models.AnthropicTextBlockParam = {
2 text: "Hello, world!",
3 type: "text",
4};

models.AnthropicImageBlockParam

1const value: models.AnthropicImageBlockParam = {
2 source: {
3 data: "/9j/4AAQ...",
4 mediaType: "image/jpeg",
5 type: "base64",
6 },
7 type: "image",
8};

models.ContentToolReference

1const value: models.ContentToolReference = {
2 toolName: "<value>",
3 type: "tool_reference",
4};

models.AnthropicSearchResultBlockParam

1const value: models.AnthropicSearchResultBlockParam = {
2 content: [
3 {
4 text: "Result content",
5 type: "text",
6 },
7 ],
8 source: "example_source",
9 title: "Example Result",
10 type: "search_result",
11};

models.AnthropicDocumentBlockParam

1const value: models.AnthropicDocumentBlockParam = {
2 source: {
3 data: "Hello, world!",
4 mediaType: "text/plain",
5 type: "text",
6 },
7 type: "document",
8};