From 029e485d74f09582484de149825b93f46096878e Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 1 Nov 2024 00:43:58 +0000 Subject: [PATCH] refactor: use type imports for type-only imports (#580) --- src/index.ts | 227 ++++++++++++------ src/resources/beta/beta.ts | 145 +++++++---- src/resources/beta/index.ts | 90 +++---- src/resources/beta/messages/batches.ts | 35 +-- src/resources/beta/messages/index.ts | 102 ++++---- src/resources/beta/messages/messages.ts | 127 ++++++---- src/resources/beta/prompt-caching/index.ts | 30 +-- src/resources/beta/prompt-caching/messages.ts | 32 +-- .../beta/prompt-caching/prompt-caching.ts | 53 ++-- src/resources/completions.ts | 12 +- src/resources/index.ts | 106 ++++---- src/resources/messages.ts | 82 ++++--- tsconfig.json | 2 +- 13 files changed, 607 insertions(+), 436 deletions(-) diff --git a/src/index.ts b/src/index.ts index ed92e8d1..3d603d9d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,73 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Errors from './error'; -import * as Uploads from './uploads'; import { type Agent } from './_shims/index'; import * as Core from './core'; +import * as Errors from './error'; import * as Pagination from './pagination'; +import { type PageParams, PageResponse } from './pagination'; +import * as Uploads from './uploads'; import * as API from './resources/index'; +import { + Completion, + CompletionCreateParams, + CompletionCreateParamsNonStreaming, + CompletionCreateParamsStreaming, + Completions, +} from './resources/completions'; +import { + ContentBlock, + ContentBlockDeltaEvent, + ContentBlockStartEvent, + ContentBlockStopEvent, + ImageBlockParam, + InputJSONDelta, + Message, + MessageCreateParams, + MessageCreateParamsNonStreaming, + MessageCreateParamsStreaming, + MessageDeltaEvent, + MessageDeltaUsage, + MessageParam, + MessageStartEvent, + MessageStopEvent, + MessageStreamEvent, + MessageStreamParams, + Messages, + Metadata, + Model, + RawContentBlockDeltaEvent, + RawContentBlockStartEvent, + RawContentBlockStopEvent, + RawMessageDeltaEvent, + RawMessageStartEvent, + RawMessageStopEvent, + RawMessageStreamEvent, + TextBlock, + TextBlockParam, + TextDelta, + Tool, + ToolChoice, + ToolChoiceAny, + ToolChoiceAuto, + ToolChoiceTool, + ToolResultBlockParam, + ToolUseBlock, + ToolUseBlockParam, + Usage, +} from './resources/messages'; +import { + AnthropicBeta, + Beta, + BetaAPIError, + BetaAuthenticationError, + BetaError, + BetaErrorResponse, + BetaInvalidRequestError, + BetaNotFoundError, + BetaOverloadedError, + BetaPermissionError, + BetaRateLimitError, +} from './resources/beta/beta'; export interface ClientOptions { /** @@ -229,89 +291,96 @@ export class Anthropic extends Core.APIClient { export const { HUMAN_PROMPT, AI_PROMPT } = Anthropic; -export const { - AnthropicError, - APIError, - APIConnectionError, - APIConnectionTimeoutError, - APIUserAbortError, - NotFoundError, - ConflictError, - RateLimitError, - BadRequestError, - AuthenticationError, - InternalServerError, - PermissionDeniedError, - UnprocessableEntityError, -} = Errors; +export const AnthropicError = Errors.AnthropicError; +export const APIError = Errors.APIError; +export const APIConnectionError = Errors.APIConnectionError; +export const APIConnectionTimeoutError = Errors.APIConnectionTimeoutError; +export const APIUserAbortError = Errors.APIUserAbortError; +export const NotFoundError = Errors.NotFoundError; +export const ConflictError = Errors.ConflictError; +export const RateLimitError = Errors.RateLimitError; +export const BadRequestError = Errors.BadRequestError; +export const AuthenticationError = Errors.AuthenticationError; +export const InternalServerError = Errors.InternalServerError; +export const PermissionDeniedError = Errors.PermissionDeniedError; +export const UnprocessableEntityError = Errors.UnprocessableEntityError; export import toFile = Uploads.toFile; export import fileFromPath = Uploads.fileFromPath; -export namespace Anthropic { - export import RequestOptions = Core.RequestOptions; +Anthropic.Completions = Completions; +Anthropic.Messages = Messages; +Anthropic.Beta = Beta; + +export declare namespace Anthropic { + export type RequestOptions = Core.RequestOptions; export import Page = Pagination.Page; - export import PageParams = Pagination.PageParams; - export import PageResponse = Pagination.PageResponse; - - export import Completions = API.Completions; - export import Completion = API.Completion; - export import CompletionCreateParams = API.CompletionCreateParams; - export import CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming; - export import CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming; - - export import Messages = API.Messages; - export import ContentBlock = API.ContentBlock; - export import ContentBlockDeltaEvent = API.ContentBlockDeltaEvent; - export import ContentBlockStartEvent = API.ContentBlockStartEvent; - export import ContentBlockStopEvent = API.ContentBlockStopEvent; - export import ImageBlockParam = API.ImageBlockParam; - export import InputJSONDelta = API.InputJSONDelta; - export import Message = API.Message; - export import MessageDeltaEvent = API.MessageDeltaEvent; - export import MessageDeltaUsage = API.MessageDeltaUsage; - export import MessageParam = API.MessageParam; - export import MessageStartEvent = API.MessageStartEvent; - export import MessageStopEvent = API.MessageStopEvent; - export import MessageStreamEvent = API.MessageStreamEvent; - export import Metadata = API.Metadata; - export import Model = API.Model; - export import RawContentBlockDeltaEvent = API.RawContentBlockDeltaEvent; - export import RawContentBlockStartEvent = API.RawContentBlockStartEvent; - export import RawContentBlockStopEvent = API.RawContentBlockStopEvent; - export import RawMessageDeltaEvent = API.RawMessageDeltaEvent; - export import RawMessageStartEvent = API.RawMessageStartEvent; - export import RawMessageStopEvent = API.RawMessageStopEvent; - export import RawMessageStreamEvent = API.RawMessageStreamEvent; - export import TextBlock = API.TextBlock; - export import TextBlockParam = API.TextBlockParam; - export import TextDelta = API.TextDelta; - export import Tool = API.Tool; - export import ToolChoice = API.ToolChoice; - export import ToolChoiceAny = API.ToolChoiceAny; - export import ToolChoiceAuto = API.ToolChoiceAuto; - export import ToolChoiceTool = API.ToolChoiceTool; - export import ToolResultBlockParam = API.ToolResultBlockParam; - export import ToolUseBlock = API.ToolUseBlock; - export import ToolUseBlockParam = API.ToolUseBlockParam; - export import Usage = API.Usage; - export import MessageCreateParams = API.MessageCreateParams; - export import MessageCreateParamsNonStreaming = API.MessageCreateParamsNonStreaming; - export import MessageCreateParamsStreaming = API.MessageCreateParamsStreaming; - export import MessageStreamParams = API.MessageStreamParams; - - export import Beta = API.Beta; - export import AnthropicBeta = API.AnthropicBeta; - export import BetaAPIError = API.BetaAPIError; - export import BetaAuthenticationError = API.BetaAuthenticationError; - export import BetaError = API.BetaError; - export import BetaErrorResponse = API.BetaErrorResponse; - export import BetaInvalidRequestError = API.BetaInvalidRequestError; - export import BetaNotFoundError = API.BetaNotFoundError; - export import BetaOverloadedError = API.BetaOverloadedError; - export import BetaPermissionError = API.BetaPermissionError; - export import BetaRateLimitError = API.BetaRateLimitError; + export { type PageParams as PageParams, type PageResponse as PageResponse }; + + export { + Completions as Completions, + type Completion as Completion, + type CompletionCreateParams as CompletionCreateParams, + type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, + type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, + }; + + export { + Messages as Messages, + type ContentBlock as ContentBlock, + type ContentBlockDeltaEvent as ContentBlockDeltaEvent, + type ContentBlockStartEvent as ContentBlockStartEvent, + type ContentBlockStopEvent as ContentBlockStopEvent, + type ImageBlockParam as ImageBlockParam, + type InputJSONDelta as InputJSONDelta, + type Message as Message, + type MessageDeltaEvent as MessageDeltaEvent, + type MessageDeltaUsage as MessageDeltaUsage, + type MessageParam as MessageParam, + type MessageStartEvent as MessageStartEvent, + type MessageStopEvent as MessageStopEvent, + type MessageStreamEvent as MessageStreamEvent, + type Metadata as Metadata, + type Model as Model, + type RawContentBlockDeltaEvent as RawContentBlockDeltaEvent, + type RawContentBlockStartEvent as RawContentBlockStartEvent, + type RawContentBlockStopEvent as RawContentBlockStopEvent, + type RawMessageDeltaEvent as RawMessageDeltaEvent, + type RawMessageStartEvent as RawMessageStartEvent, + type RawMessageStopEvent as RawMessageStopEvent, + type RawMessageStreamEvent as RawMessageStreamEvent, + type TextBlock as TextBlock, + type TextBlockParam as TextBlockParam, + type TextDelta as TextDelta, + type Tool as Tool, + type ToolChoice as ToolChoice, + type ToolChoiceAny as ToolChoiceAny, + type ToolChoiceAuto as ToolChoiceAuto, + type ToolChoiceTool as ToolChoiceTool, + type ToolResultBlockParam as ToolResultBlockParam, + type ToolUseBlock as ToolUseBlock, + type ToolUseBlockParam as ToolUseBlockParam, + type Usage as Usage, + type MessageCreateParams as MessageCreateParams, + type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming as MessageCreateParamsStreaming, + type MessageStreamParams as MessageStreamParams, + }; + + export { + Beta as Beta, + type AnthropicBeta as AnthropicBeta, + type BetaAPIError as BetaAPIError, + type BetaAuthenticationError as BetaAuthenticationError, + type BetaError as BetaError, + type BetaErrorResponse as BetaErrorResponse, + type BetaInvalidRequestError as BetaInvalidRequestError, + type BetaNotFoundError as BetaNotFoundError, + type BetaOverloadedError as BetaOverloadedError, + type BetaPermissionError as BetaPermissionError, + type BetaRateLimitError as BetaRateLimitError, + }; } export default Anthropic; diff --git a/src/resources/beta/beta.ts b/src/resources/beta/beta.ts index 7979da01..1a9e19bb 100644 --- a/src/resources/beta/beta.ts +++ b/src/resources/beta/beta.ts @@ -1,9 +1,47 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as BetaAPI from './beta'; import * as MessagesAPI from './messages/messages'; +import { + BetaCacheControlEphemeral, + BetaContentBlock, + BetaContentBlockParam, + BetaImageBlockParam, + BetaInputJSONDelta, + BetaMessage, + BetaMessageDeltaUsage, + BetaMessageParam, + BetaMetadata, + BetaRawContentBlockDeltaEvent, + BetaRawContentBlockStartEvent, + BetaRawContentBlockStopEvent, + BetaRawMessageDeltaEvent, + BetaRawMessageStartEvent, + BetaRawMessageStopEvent, + BetaRawMessageStreamEvent, + BetaTextBlock, + BetaTextBlockParam, + BetaTextDelta, + BetaTool, + BetaToolBash20241022, + BetaToolChoice, + BetaToolChoiceAny, + BetaToolChoiceAuto, + BetaToolChoiceTool, + BetaToolComputerUse20241022, + BetaToolResultBlockParam, + BetaToolTextEditor20241022, + BetaToolUnion, + BetaToolUseBlock, + BetaToolUseBlockParam, + BetaUsage, + MessageCreateParams, + MessageCreateParamsNonStreaming, + MessageCreateParamsStreaming, + Messages, +} from './messages/messages'; import * as PromptCachingAPI from './prompt-caching/prompt-caching'; +import { PromptCaching } from './prompt-caching/prompt-caching'; export class Beta extends APIResource { messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client); @@ -73,52 +111,61 @@ export interface BetaRateLimitError { type: 'rate_limit_error'; } -export namespace Beta { - export import AnthropicBeta = BetaAPI.AnthropicBeta; - export import BetaAPIError = BetaAPI.BetaAPIError; - export import BetaAuthenticationError = BetaAPI.BetaAuthenticationError; - export import BetaError = BetaAPI.BetaError; - export import BetaErrorResponse = BetaAPI.BetaErrorResponse; - export import BetaInvalidRequestError = BetaAPI.BetaInvalidRequestError; - export import BetaNotFoundError = BetaAPI.BetaNotFoundError; - export import BetaOverloadedError = BetaAPI.BetaOverloadedError; - export import BetaPermissionError = BetaAPI.BetaPermissionError; - export import BetaRateLimitError = BetaAPI.BetaRateLimitError; - export import Messages = MessagesAPI.Messages; - export import BetaCacheControlEphemeral = MessagesAPI.BetaCacheControlEphemeral; - export import BetaContentBlock = MessagesAPI.BetaContentBlock; - export import BetaContentBlockParam = MessagesAPI.BetaContentBlockParam; - export import BetaImageBlockParam = MessagesAPI.BetaImageBlockParam; - export import BetaInputJSONDelta = MessagesAPI.BetaInputJSONDelta; - export import BetaMessage = MessagesAPI.BetaMessage; - export import BetaMessageDeltaUsage = MessagesAPI.BetaMessageDeltaUsage; - export import BetaMessageParam = MessagesAPI.BetaMessageParam; - export import BetaMetadata = MessagesAPI.BetaMetadata; - export import BetaRawContentBlockDeltaEvent = MessagesAPI.BetaRawContentBlockDeltaEvent; - export import BetaRawContentBlockStartEvent = MessagesAPI.BetaRawContentBlockStartEvent; - export import BetaRawContentBlockStopEvent = MessagesAPI.BetaRawContentBlockStopEvent; - export import BetaRawMessageDeltaEvent = MessagesAPI.BetaRawMessageDeltaEvent; - export import BetaRawMessageStartEvent = MessagesAPI.BetaRawMessageStartEvent; - export import BetaRawMessageStopEvent = MessagesAPI.BetaRawMessageStopEvent; - export import BetaRawMessageStreamEvent = MessagesAPI.BetaRawMessageStreamEvent; - export import BetaTextBlock = MessagesAPI.BetaTextBlock; - export import BetaTextBlockParam = MessagesAPI.BetaTextBlockParam; - export import BetaTextDelta = MessagesAPI.BetaTextDelta; - export import BetaTool = MessagesAPI.BetaTool; - export import BetaToolBash20241022 = MessagesAPI.BetaToolBash20241022; - export import BetaToolChoice = MessagesAPI.BetaToolChoice; - export import BetaToolChoiceAny = MessagesAPI.BetaToolChoiceAny; - export import BetaToolChoiceAuto = MessagesAPI.BetaToolChoiceAuto; - export import BetaToolChoiceTool = MessagesAPI.BetaToolChoiceTool; - export import BetaToolComputerUse20241022 = MessagesAPI.BetaToolComputerUse20241022; - export import BetaToolResultBlockParam = MessagesAPI.BetaToolResultBlockParam; - export import BetaToolTextEditor20241022 = MessagesAPI.BetaToolTextEditor20241022; - export import BetaToolUnion = MessagesAPI.BetaToolUnion; - export import BetaToolUseBlock = MessagesAPI.BetaToolUseBlock; - export import BetaToolUseBlockParam = MessagesAPI.BetaToolUseBlockParam; - export import BetaUsage = MessagesAPI.BetaUsage; - export import MessageCreateParams = MessagesAPI.MessageCreateParams; - export import MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming; - export import MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming; - export import PromptCaching = PromptCachingAPI.PromptCaching; +Beta.Messages = Messages; +Beta.PromptCaching = PromptCaching; + +export declare namespace Beta { + export { + type AnthropicBeta as AnthropicBeta, + type BetaAPIError as BetaAPIError, + type BetaAuthenticationError as BetaAuthenticationError, + type BetaError as BetaError, + type BetaErrorResponse as BetaErrorResponse, + type BetaInvalidRequestError as BetaInvalidRequestError, + type BetaNotFoundError as BetaNotFoundError, + type BetaOverloadedError as BetaOverloadedError, + type BetaPermissionError as BetaPermissionError, + type BetaRateLimitError as BetaRateLimitError, + }; + + export { + Messages as Messages, + type BetaCacheControlEphemeral as BetaCacheControlEphemeral, + type BetaContentBlock as BetaContentBlock, + type BetaContentBlockParam as BetaContentBlockParam, + type BetaImageBlockParam as BetaImageBlockParam, + type BetaInputJSONDelta as BetaInputJSONDelta, + type BetaMessage as BetaMessage, + type BetaMessageDeltaUsage as BetaMessageDeltaUsage, + type BetaMessageParam as BetaMessageParam, + type BetaMetadata as BetaMetadata, + type BetaRawContentBlockDeltaEvent as BetaRawContentBlockDeltaEvent, + type BetaRawContentBlockStartEvent as BetaRawContentBlockStartEvent, + type BetaRawContentBlockStopEvent as BetaRawContentBlockStopEvent, + type BetaRawMessageDeltaEvent as BetaRawMessageDeltaEvent, + type BetaRawMessageStartEvent as BetaRawMessageStartEvent, + type BetaRawMessageStopEvent as BetaRawMessageStopEvent, + type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent, + type BetaTextBlock as BetaTextBlock, + type BetaTextBlockParam as BetaTextBlockParam, + type BetaTextDelta as BetaTextDelta, + type BetaTool as BetaTool, + type BetaToolBash20241022 as BetaToolBash20241022, + type BetaToolChoice as BetaToolChoice, + type BetaToolChoiceAny as BetaToolChoiceAny, + type BetaToolChoiceAuto as BetaToolChoiceAuto, + type BetaToolChoiceTool as BetaToolChoiceTool, + type BetaToolComputerUse20241022 as BetaToolComputerUse20241022, + type BetaToolResultBlockParam as BetaToolResultBlockParam, + type BetaToolTextEditor20241022 as BetaToolTextEditor20241022, + type BetaToolUnion as BetaToolUnion, + type BetaToolUseBlock as BetaToolUseBlock, + type BetaToolUseBlockParam as BetaToolUseBlockParam, + type BetaUsage as BetaUsage, + type MessageCreateParams as MessageCreateParams, + type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming as MessageCreateParamsStreaming, + }; + + export { PromptCaching as PromptCaching }; } diff --git a/src/resources/beta/index.ts b/src/resources/beta/index.ts index 3fb9b9e3..a89803bd 100644 --- a/src/resources/beta/index.ts +++ b/src/resources/beta/index.ts @@ -1,54 +1,54 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AnthropicBeta, - BetaAPIError, - BetaAuthenticationError, - BetaError, - BetaErrorResponse, - BetaInvalidRequestError, - BetaNotFoundError, - BetaOverloadedError, - BetaPermissionError, - BetaRateLimitError, Beta, + type AnthropicBeta, + type BetaAPIError, + type BetaAuthenticationError, + type BetaError, + type BetaErrorResponse, + type BetaInvalidRequestError, + type BetaNotFoundError, + type BetaOverloadedError, + type BetaPermissionError, + type BetaRateLimitError, } from './beta'; export { - BetaCacheControlEphemeral, - BetaContentBlock, - BetaContentBlockParam, - BetaImageBlockParam, - BetaInputJSONDelta, - BetaMessage, - BetaMessageDeltaUsage, - BetaMessageParam, - BetaMetadata, - BetaRawContentBlockDeltaEvent, - BetaRawContentBlockStartEvent, - BetaRawContentBlockStopEvent, - BetaRawMessageDeltaEvent, - BetaRawMessageStartEvent, - BetaRawMessageStopEvent, - BetaRawMessageStreamEvent, - BetaTextBlock, - BetaTextBlockParam, - BetaTextDelta, - BetaTool, - BetaToolBash20241022, - BetaToolChoice, - BetaToolChoiceAny, - BetaToolChoiceAuto, - BetaToolChoiceTool, - BetaToolComputerUse20241022, - BetaToolResultBlockParam, - BetaToolTextEditor20241022, - BetaToolUnion, - BetaToolUseBlock, - BetaToolUseBlockParam, - BetaUsage, - MessageCreateParams, - MessageCreateParamsNonStreaming, - MessageCreateParamsStreaming, Messages, + type BetaCacheControlEphemeral, + type BetaContentBlock, + type BetaContentBlockParam, + type BetaImageBlockParam, + type BetaInputJSONDelta, + type BetaMessage, + type BetaMessageDeltaUsage, + type BetaMessageParam, + type BetaMetadata, + type BetaRawContentBlockDeltaEvent, + type BetaRawContentBlockStartEvent, + type BetaRawContentBlockStopEvent, + type BetaRawMessageDeltaEvent, + type BetaRawMessageStartEvent, + type BetaRawMessageStopEvent, + type BetaRawMessageStreamEvent, + type BetaTextBlock, + type BetaTextBlockParam, + type BetaTextDelta, + type BetaTool, + type BetaToolBash20241022, + type BetaToolChoice, + type BetaToolChoiceAny, + type BetaToolChoiceAuto, + type BetaToolChoiceTool, + type BetaToolComputerUse20241022, + type BetaToolResultBlockParam, + type BetaToolTextEditor20241022, + type BetaToolUnion, + type BetaToolUseBlock, + type BetaToolUseBlockParam, + type BetaUsage, + type MessageCreateParams, + type MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming, } from './messages/index'; export { PromptCaching } from './prompt-caching/index'; diff --git a/src/resources/beta/messages/batches.ts b/src/resources/beta/messages/batches.ts index 84c1fc60..0a863e64 100644 --- a/src/resources/beta/messages/batches.ts +++ b/src/resources/beta/messages/batches.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; -import * as BatchesAPI from './batches'; import * as BetaAPI from '../beta'; import * as BetaMessagesAPI from './messages'; import { Page, type PageParams } from '../../../pagination'; @@ -389,19 +388,23 @@ export interface BatchResultsParams { betas?: Array; } -export namespace Batches { - export import BetaMessageBatch = BatchesAPI.BetaMessageBatch; - export import BetaMessageBatchCanceledResult = BatchesAPI.BetaMessageBatchCanceledResult; - export import BetaMessageBatchErroredResult = BatchesAPI.BetaMessageBatchErroredResult; - export import BetaMessageBatchExpiredResult = BatchesAPI.BetaMessageBatchExpiredResult; - export import BetaMessageBatchIndividualResponse = BatchesAPI.BetaMessageBatchIndividualResponse; - export import BetaMessageBatchRequestCounts = BatchesAPI.BetaMessageBatchRequestCounts; - export import BetaMessageBatchResult = BatchesAPI.BetaMessageBatchResult; - export import BetaMessageBatchSucceededResult = BatchesAPI.BetaMessageBatchSucceededResult; - export import BetaMessageBatchesPage = BatchesAPI.BetaMessageBatchesPage; - export import BatchCreateParams = BatchesAPI.BatchCreateParams; - export import BatchRetrieveParams = BatchesAPI.BatchRetrieveParams; - export import BatchListParams = BatchesAPI.BatchListParams; - export import BatchCancelParams = BatchesAPI.BatchCancelParams; - export import BatchResultsParams = BatchesAPI.BatchResultsParams; +Batches.BetaMessageBatchesPage = BetaMessageBatchesPage; + +export declare namespace Batches { + export { + type BetaMessageBatch as BetaMessageBatch, + type BetaMessageBatchCanceledResult as BetaMessageBatchCanceledResult, + type BetaMessageBatchErroredResult as BetaMessageBatchErroredResult, + type BetaMessageBatchExpiredResult as BetaMessageBatchExpiredResult, + type BetaMessageBatchIndividualResponse as BetaMessageBatchIndividualResponse, + type BetaMessageBatchRequestCounts as BetaMessageBatchRequestCounts, + type BetaMessageBatchResult as BetaMessageBatchResult, + type BetaMessageBatchSucceededResult as BetaMessageBatchSucceededResult, + BetaMessageBatchesPage as BetaMessageBatchesPage, + type BatchCreateParams as BatchCreateParams, + type BatchRetrieveParams as BatchRetrieveParams, + type BatchListParams as BatchListParams, + type BatchCancelParams as BatchCancelParams, + type BatchResultsParams as BatchResultsParams, + }; } diff --git a/src/resources/beta/messages/index.ts b/src/resources/beta/messages/index.ts index 9011e21b..45f71739 100644 --- a/src/resources/beta/messages/index.ts +++ b/src/resources/beta/messages/index.ts @@ -1,57 +1,57 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - BetaCacheControlEphemeral, - BetaContentBlock, - BetaContentBlockParam, - BetaImageBlockParam, - BetaInputJSONDelta, - BetaMessage, - BetaMessageDeltaUsage, - BetaMessageParam, - BetaMetadata, - BetaRawContentBlockDeltaEvent, - BetaRawContentBlockStartEvent, - BetaRawContentBlockStopEvent, - BetaRawMessageDeltaEvent, - BetaRawMessageStartEvent, - BetaRawMessageStopEvent, - BetaRawMessageStreamEvent, - BetaTextBlock, - BetaTextBlockParam, - BetaTextDelta, - BetaTool, - BetaToolBash20241022, - BetaToolChoice, - BetaToolChoiceAny, - BetaToolChoiceAuto, - BetaToolChoiceTool, - BetaToolComputerUse20241022, - BetaToolResultBlockParam, - BetaToolTextEditor20241022, - BetaToolUnion, - BetaToolUseBlock, - BetaToolUseBlockParam, - BetaUsage, - MessageCreateParams, - MessageCreateParamsNonStreaming, - MessageCreateParamsStreaming, - Messages, -} from './messages'; -export { - BetaMessageBatch, - BetaMessageBatchCanceledResult, - BetaMessageBatchErroredResult, - BetaMessageBatchExpiredResult, - BetaMessageBatchIndividualResponse, - BetaMessageBatchRequestCounts, - BetaMessageBatchResult, - BetaMessageBatchSucceededResult, - BatchCreateParams, - BatchRetrieveParams, - BatchListParams, - BatchCancelParams, - BatchResultsParams, BetaMessageBatchesPage, Batches, + type BetaMessageBatch, + type BetaMessageBatchCanceledResult, + type BetaMessageBatchErroredResult, + type BetaMessageBatchExpiredResult, + type BetaMessageBatchIndividualResponse, + type BetaMessageBatchRequestCounts, + type BetaMessageBatchResult, + type BetaMessageBatchSucceededResult, + type BatchCreateParams, + type BatchRetrieveParams, + type BatchListParams, + type BatchCancelParams, + type BatchResultsParams, } from './batches'; +export { + Messages, + type BetaCacheControlEphemeral, + type BetaContentBlock, + type BetaContentBlockParam, + type BetaImageBlockParam, + type BetaInputJSONDelta, + type BetaMessage, + type BetaMessageDeltaUsage, + type BetaMessageParam, + type BetaMetadata, + type BetaRawContentBlockDeltaEvent, + type BetaRawContentBlockStartEvent, + type BetaRawContentBlockStopEvent, + type BetaRawMessageDeltaEvent, + type BetaRawMessageStartEvent, + type BetaRawMessageStopEvent, + type BetaRawMessageStreamEvent, + type BetaTextBlock, + type BetaTextBlockParam, + type BetaTextDelta, + type BetaTool, + type BetaToolBash20241022, + type BetaToolChoice, + type BetaToolChoiceAny, + type BetaToolChoiceAuto, + type BetaToolChoiceTool, + type BetaToolComputerUse20241022, + type BetaToolResultBlockParam, + type BetaToolTextEditor20241022, + type BetaToolUnion, + type BetaToolUseBlock, + type BetaToolUseBlockParam, + type BetaUsage, + type MessageCreateParams, + type MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming, +} from './messages'; diff --git a/src/resources/beta/messages/messages.ts b/src/resources/beta/messages/messages.ts index cb1f1659..31174f5e 100644 --- a/src/resources/beta/messages/messages.ts +++ b/src/resources/beta/messages/messages.ts @@ -7,6 +7,23 @@ import * as MessagesMessagesAPI from './messages'; import * as MessagesAPI from '../../messages'; import * as BetaAPI from '../beta'; import * as BatchesAPI from './batches'; +import { + BatchCancelParams, + BatchCreateParams, + BatchListParams, + BatchResultsParams, + BatchRetrieveParams, + Batches, + BetaMessageBatch, + BetaMessageBatchCanceledResult, + BetaMessageBatchErroredResult, + BetaMessageBatchExpiredResult, + BetaMessageBatchIndividualResponse, + BetaMessageBatchRequestCounts, + BetaMessageBatchResult, + BetaMessageBatchSucceededResult, + BetaMessageBatchesPage, +} from './batches'; import { Stream } from '../../../streaming'; export class Messages extends APIResource { @@ -784,55 +801,63 @@ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase { stream: true; } -export namespace Messages { - export import BetaCacheControlEphemeral = MessagesMessagesAPI.BetaCacheControlEphemeral; - export import BetaContentBlock = MessagesMessagesAPI.BetaContentBlock; - export import BetaContentBlockParam = MessagesMessagesAPI.BetaContentBlockParam; - export import BetaImageBlockParam = MessagesMessagesAPI.BetaImageBlockParam; - export import BetaInputJSONDelta = MessagesMessagesAPI.BetaInputJSONDelta; - export import BetaMessage = MessagesMessagesAPI.BetaMessage; - export import BetaMessageDeltaUsage = MessagesMessagesAPI.BetaMessageDeltaUsage; - export import BetaMessageParam = MessagesMessagesAPI.BetaMessageParam; - export import BetaMetadata = MessagesMessagesAPI.BetaMetadata; - export import BetaRawContentBlockDeltaEvent = MessagesMessagesAPI.BetaRawContentBlockDeltaEvent; - export import BetaRawContentBlockStartEvent = MessagesMessagesAPI.BetaRawContentBlockStartEvent; - export import BetaRawContentBlockStopEvent = MessagesMessagesAPI.BetaRawContentBlockStopEvent; - export import BetaRawMessageDeltaEvent = MessagesMessagesAPI.BetaRawMessageDeltaEvent; - export import BetaRawMessageStartEvent = MessagesMessagesAPI.BetaRawMessageStartEvent; - export import BetaRawMessageStopEvent = MessagesMessagesAPI.BetaRawMessageStopEvent; - export import BetaRawMessageStreamEvent = MessagesMessagesAPI.BetaRawMessageStreamEvent; - export import BetaTextBlock = MessagesMessagesAPI.BetaTextBlock; - export import BetaTextBlockParam = MessagesMessagesAPI.BetaTextBlockParam; - export import BetaTextDelta = MessagesMessagesAPI.BetaTextDelta; - export import BetaTool = MessagesMessagesAPI.BetaTool; - export import BetaToolBash20241022 = MessagesMessagesAPI.BetaToolBash20241022; - export import BetaToolChoice = MessagesMessagesAPI.BetaToolChoice; - export import BetaToolChoiceAny = MessagesMessagesAPI.BetaToolChoiceAny; - export import BetaToolChoiceAuto = MessagesMessagesAPI.BetaToolChoiceAuto; - export import BetaToolChoiceTool = MessagesMessagesAPI.BetaToolChoiceTool; - export import BetaToolComputerUse20241022 = MessagesMessagesAPI.BetaToolComputerUse20241022; - export import BetaToolResultBlockParam = MessagesMessagesAPI.BetaToolResultBlockParam; - export import BetaToolTextEditor20241022 = MessagesMessagesAPI.BetaToolTextEditor20241022; - export import BetaToolUnion = MessagesMessagesAPI.BetaToolUnion; - export import BetaToolUseBlock = MessagesMessagesAPI.BetaToolUseBlock; - export import BetaToolUseBlockParam = MessagesMessagesAPI.BetaToolUseBlockParam; - export import BetaUsage = MessagesMessagesAPI.BetaUsage; - export import MessageCreateParams = MessagesMessagesAPI.MessageCreateParams; - export import MessageCreateParamsNonStreaming = MessagesMessagesAPI.MessageCreateParamsNonStreaming; - export import MessageCreateParamsStreaming = MessagesMessagesAPI.MessageCreateParamsStreaming; - export import Batches = BatchesAPI.Batches; - export import BetaMessageBatch = BatchesAPI.BetaMessageBatch; - export import BetaMessageBatchCanceledResult = BatchesAPI.BetaMessageBatchCanceledResult; - export import BetaMessageBatchErroredResult = BatchesAPI.BetaMessageBatchErroredResult; - export import BetaMessageBatchExpiredResult = BatchesAPI.BetaMessageBatchExpiredResult; - export import BetaMessageBatchIndividualResponse = BatchesAPI.BetaMessageBatchIndividualResponse; - export import BetaMessageBatchRequestCounts = BatchesAPI.BetaMessageBatchRequestCounts; - export import BetaMessageBatchResult = BatchesAPI.BetaMessageBatchResult; - export import BetaMessageBatchSucceededResult = BatchesAPI.BetaMessageBatchSucceededResult; - export import BetaMessageBatchesPage = BatchesAPI.BetaMessageBatchesPage; - export import BatchCreateParams = BatchesAPI.BatchCreateParams; - export import BatchRetrieveParams = BatchesAPI.BatchRetrieveParams; - export import BatchListParams = BatchesAPI.BatchListParams; - export import BatchCancelParams = BatchesAPI.BatchCancelParams; - export import BatchResultsParams = BatchesAPI.BatchResultsParams; +Messages.Batches = Batches; +Messages.BetaMessageBatchesPage = BetaMessageBatchesPage; + +export declare namespace Messages { + export { + type BetaCacheControlEphemeral as BetaCacheControlEphemeral, + type BetaContentBlock as BetaContentBlock, + type BetaContentBlockParam as BetaContentBlockParam, + type BetaImageBlockParam as BetaImageBlockParam, + type BetaInputJSONDelta as BetaInputJSONDelta, + type BetaMessage as BetaMessage, + type BetaMessageDeltaUsage as BetaMessageDeltaUsage, + type BetaMessageParam as BetaMessageParam, + type BetaMetadata as BetaMetadata, + type BetaRawContentBlockDeltaEvent as BetaRawContentBlockDeltaEvent, + type BetaRawContentBlockStartEvent as BetaRawContentBlockStartEvent, + type BetaRawContentBlockStopEvent as BetaRawContentBlockStopEvent, + type BetaRawMessageDeltaEvent as BetaRawMessageDeltaEvent, + type BetaRawMessageStartEvent as BetaRawMessageStartEvent, + type BetaRawMessageStopEvent as BetaRawMessageStopEvent, + type BetaRawMessageStreamEvent as BetaRawMessageStreamEvent, + type BetaTextBlock as BetaTextBlock, + type BetaTextBlockParam as BetaTextBlockParam, + type BetaTextDelta as BetaTextDelta, + type BetaTool as BetaTool, + type BetaToolBash20241022 as BetaToolBash20241022, + type BetaToolChoice as BetaToolChoice, + type BetaToolChoiceAny as BetaToolChoiceAny, + type BetaToolChoiceAuto as BetaToolChoiceAuto, + type BetaToolChoiceTool as BetaToolChoiceTool, + type BetaToolComputerUse20241022 as BetaToolComputerUse20241022, + type BetaToolResultBlockParam as BetaToolResultBlockParam, + type BetaToolTextEditor20241022 as BetaToolTextEditor20241022, + type BetaToolUnion as BetaToolUnion, + type BetaToolUseBlock as BetaToolUseBlock, + type BetaToolUseBlockParam as BetaToolUseBlockParam, + type BetaUsage as BetaUsage, + type MessageCreateParams as MessageCreateParams, + type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming as MessageCreateParamsStreaming, + }; + + export { + Batches as Batches, + type BetaMessageBatch as BetaMessageBatch, + type BetaMessageBatchCanceledResult as BetaMessageBatchCanceledResult, + type BetaMessageBatchErroredResult as BetaMessageBatchErroredResult, + type BetaMessageBatchExpiredResult as BetaMessageBatchExpiredResult, + type BetaMessageBatchIndividualResponse as BetaMessageBatchIndividualResponse, + type BetaMessageBatchRequestCounts as BetaMessageBatchRequestCounts, + type BetaMessageBatchResult as BetaMessageBatchResult, + type BetaMessageBatchSucceededResult as BetaMessageBatchSucceededResult, + BetaMessageBatchesPage as BetaMessageBatchesPage, + type BatchCreateParams as BatchCreateParams, + type BatchRetrieveParams as BatchRetrieveParams, + type BatchListParams as BatchListParams, + type BatchCancelParams as BatchCancelParams, + type BatchResultsParams as BatchResultsParams, + }; } diff --git a/src/resources/beta/prompt-caching/index.ts b/src/resources/beta/prompt-caching/index.ts index 3c8a52b6..78b4e747 100644 --- a/src/resources/beta/prompt-caching/index.ts +++ b/src/resources/beta/prompt-caching/index.ts @@ -1,20 +1,20 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { PromptCaching } from './prompt-caching'; export { - PromptCachingBetaCacheControlEphemeral, - PromptCachingBetaImageBlockParam, - PromptCachingBetaMessage, - PromptCachingBetaMessageParam, - PromptCachingBetaTextBlockParam, - PromptCachingBetaTool, - PromptCachingBetaToolResultBlockParam, - PromptCachingBetaToolUseBlockParam, - PromptCachingBetaUsage, - RawPromptCachingBetaMessageStartEvent, - RawPromptCachingBetaMessageStreamEvent, - MessageCreateParams, - MessageCreateParamsNonStreaming, - MessageCreateParamsStreaming, Messages, + type PromptCachingBetaCacheControlEphemeral, + type PromptCachingBetaImageBlockParam, + type PromptCachingBetaMessage, + type PromptCachingBetaMessageParam, + type PromptCachingBetaTextBlockParam, + type PromptCachingBetaTool, + type PromptCachingBetaToolResultBlockParam, + type PromptCachingBetaToolUseBlockParam, + type PromptCachingBetaUsage, + type RawPromptCachingBetaMessageStartEvent, + type RawPromptCachingBetaMessageStreamEvent, + type MessageCreateParams, + type MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming, } from './messages'; +export { PromptCaching } from './prompt-caching'; diff --git a/src/resources/beta/prompt-caching/messages.ts b/src/resources/beta/prompt-caching/messages.ts index f946a8f9..01aa4f89 100644 --- a/src/resources/beta/prompt-caching/messages.ts +++ b/src/resources/beta/prompt-caching/messages.ts @@ -617,19 +617,21 @@ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase { stream: true; } -export namespace Messages { - export import PromptCachingBetaCacheControlEphemeral = PromptCachingMessagesAPI.PromptCachingBetaCacheControlEphemeral; - export import PromptCachingBetaImageBlockParam = PromptCachingMessagesAPI.PromptCachingBetaImageBlockParam; - export import PromptCachingBetaMessage = PromptCachingMessagesAPI.PromptCachingBetaMessage; - export import PromptCachingBetaMessageParam = PromptCachingMessagesAPI.PromptCachingBetaMessageParam; - export import PromptCachingBetaTextBlockParam = PromptCachingMessagesAPI.PromptCachingBetaTextBlockParam; - export import PromptCachingBetaTool = PromptCachingMessagesAPI.PromptCachingBetaTool; - export import PromptCachingBetaToolResultBlockParam = PromptCachingMessagesAPI.PromptCachingBetaToolResultBlockParam; - export import PromptCachingBetaToolUseBlockParam = PromptCachingMessagesAPI.PromptCachingBetaToolUseBlockParam; - export import PromptCachingBetaUsage = PromptCachingMessagesAPI.PromptCachingBetaUsage; - export import RawPromptCachingBetaMessageStartEvent = PromptCachingMessagesAPI.RawPromptCachingBetaMessageStartEvent; - export import RawPromptCachingBetaMessageStreamEvent = PromptCachingMessagesAPI.RawPromptCachingBetaMessageStreamEvent; - export import MessageCreateParams = PromptCachingMessagesAPI.MessageCreateParams; - export import MessageCreateParamsNonStreaming = PromptCachingMessagesAPI.MessageCreateParamsNonStreaming; - export import MessageCreateParamsStreaming = PromptCachingMessagesAPI.MessageCreateParamsStreaming; +export declare namespace Messages { + export { + type PromptCachingBetaCacheControlEphemeral as PromptCachingBetaCacheControlEphemeral, + type PromptCachingBetaImageBlockParam as PromptCachingBetaImageBlockParam, + type PromptCachingBetaMessage as PromptCachingBetaMessage, + type PromptCachingBetaMessageParam as PromptCachingBetaMessageParam, + type PromptCachingBetaTextBlockParam as PromptCachingBetaTextBlockParam, + type PromptCachingBetaTool as PromptCachingBetaTool, + type PromptCachingBetaToolResultBlockParam as PromptCachingBetaToolResultBlockParam, + type PromptCachingBetaToolUseBlockParam as PromptCachingBetaToolUseBlockParam, + type PromptCachingBetaUsage as PromptCachingBetaUsage, + type RawPromptCachingBetaMessageStartEvent as RawPromptCachingBetaMessageStartEvent, + type RawPromptCachingBetaMessageStreamEvent as RawPromptCachingBetaMessageStreamEvent, + type MessageCreateParams as MessageCreateParams, + type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming as MessageCreateParamsStreaming, + }; } diff --git a/src/resources/beta/prompt-caching/prompt-caching.ts b/src/resources/beta/prompt-caching/prompt-caching.ts index 0bacd3ac..421f8621 100644 --- a/src/resources/beta/prompt-caching/prompt-caching.ts +++ b/src/resources/beta/prompt-caching/prompt-caching.ts @@ -2,25 +2,46 @@ import { APIResource } from '../../../resource'; import * as MessagesAPI from './messages'; +import { + MessageCreateParams, + MessageCreateParamsNonStreaming, + MessageCreateParamsStreaming, + Messages, + PromptCachingBetaCacheControlEphemeral, + PromptCachingBetaImageBlockParam, + PromptCachingBetaMessage, + PromptCachingBetaMessageParam, + PromptCachingBetaTextBlockParam, + PromptCachingBetaTool, + PromptCachingBetaToolResultBlockParam, + PromptCachingBetaToolUseBlockParam, + PromptCachingBetaUsage, + RawPromptCachingBetaMessageStartEvent, + RawPromptCachingBetaMessageStreamEvent, +} from './messages'; export class PromptCaching extends APIResource { messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client); } -export namespace PromptCaching { - export import Messages = MessagesAPI.Messages; - export import PromptCachingBetaCacheControlEphemeral = MessagesAPI.PromptCachingBetaCacheControlEphemeral; - export import PromptCachingBetaImageBlockParam = MessagesAPI.PromptCachingBetaImageBlockParam; - export import PromptCachingBetaMessage = MessagesAPI.PromptCachingBetaMessage; - export import PromptCachingBetaMessageParam = MessagesAPI.PromptCachingBetaMessageParam; - export import PromptCachingBetaTextBlockParam = MessagesAPI.PromptCachingBetaTextBlockParam; - export import PromptCachingBetaTool = MessagesAPI.PromptCachingBetaTool; - export import PromptCachingBetaToolResultBlockParam = MessagesAPI.PromptCachingBetaToolResultBlockParam; - export import PromptCachingBetaToolUseBlockParam = MessagesAPI.PromptCachingBetaToolUseBlockParam; - export import PromptCachingBetaUsage = MessagesAPI.PromptCachingBetaUsage; - export import RawPromptCachingBetaMessageStartEvent = MessagesAPI.RawPromptCachingBetaMessageStartEvent; - export import RawPromptCachingBetaMessageStreamEvent = MessagesAPI.RawPromptCachingBetaMessageStreamEvent; - export import MessageCreateParams = MessagesAPI.MessageCreateParams; - export import MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming; - export import MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming; +PromptCaching.Messages = Messages; + +export declare namespace PromptCaching { + export { + Messages as Messages, + type PromptCachingBetaCacheControlEphemeral as PromptCachingBetaCacheControlEphemeral, + type PromptCachingBetaImageBlockParam as PromptCachingBetaImageBlockParam, + type PromptCachingBetaMessage as PromptCachingBetaMessage, + type PromptCachingBetaMessageParam as PromptCachingBetaMessageParam, + type PromptCachingBetaTextBlockParam as PromptCachingBetaTextBlockParam, + type PromptCachingBetaTool as PromptCachingBetaTool, + type PromptCachingBetaToolResultBlockParam as PromptCachingBetaToolResultBlockParam, + type PromptCachingBetaToolUseBlockParam as PromptCachingBetaToolUseBlockParam, + type PromptCachingBetaUsage as PromptCachingBetaUsage, + type RawPromptCachingBetaMessageStartEvent as RawPromptCachingBetaMessageStartEvent, + type RawPromptCachingBetaMessageStreamEvent as RawPromptCachingBetaMessageStreamEvent, + type MessageCreateParams as MessageCreateParams, + type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming as MessageCreateParamsStreaming, + }; } diff --git a/src/resources/completions.ts b/src/resources/completions.ts index dedb23e4..a2ef4d98 100644 --- a/src/resources/completions.ts +++ b/src/resources/completions.ts @@ -200,9 +200,11 @@ export interface CompletionCreateParamsStreaming extends CompletionCreateParamsB stream: true; } -export namespace Completions { - export import Completion = CompletionsAPI.Completion; - export import CompletionCreateParams = CompletionsAPI.CompletionCreateParams; - export import CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming; - export import CompletionCreateParamsStreaming = CompletionsAPI.CompletionCreateParamsStreaming; +export declare namespace Completions { + export { + type Completion as Completion, + type CompletionCreateParams as CompletionCreateParams, + type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming, + type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming, + }; } diff --git a/src/resources/index.ts b/src/resources/index.ts index 492921df..59b714ff 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -1,64 +1,64 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AnthropicBeta, - BetaAPIError, - BetaAuthenticationError, - BetaError, - BetaErrorResponse, - BetaInvalidRequestError, - BetaNotFoundError, - BetaOverloadedError, - BetaPermissionError, - BetaRateLimitError, Beta, + type AnthropicBeta, + type BetaAPIError, + type BetaAuthenticationError, + type BetaError, + type BetaErrorResponse, + type BetaInvalidRequestError, + type BetaNotFoundError, + type BetaOverloadedError, + type BetaPermissionError, + type BetaRateLimitError, } from './beta/beta'; export { - Completion, - CompletionCreateParams, - CompletionCreateParamsNonStreaming, - CompletionCreateParamsStreaming, Completions, + type Completion, + type CompletionCreateParams, + type CompletionCreateParamsNonStreaming, + type CompletionCreateParamsStreaming, } from './completions'; export { - ContentBlock, - ContentBlockDeltaEvent, - ContentBlockStartEvent, - ContentBlockStopEvent, - ImageBlockParam, - InputJsonDelta, - InputJSONDelta, - Message, - MessageDeltaEvent, - MessageDeltaUsage, - MessageParam, - MessageStartEvent, - MessageStopEvent, - MessageStreamEvent, - Metadata, - Model, - RawContentBlockDeltaEvent, - RawContentBlockStartEvent, - RawContentBlockStopEvent, - RawMessageDeltaEvent, - RawMessageStartEvent, - RawMessageStopEvent, - RawMessageStreamEvent, - TextBlock, - TextBlockParam, - TextDelta, - Tool, - ToolChoice, - ToolChoiceAny, - ToolChoiceAuto, - ToolChoiceTool, - ToolResultBlockParam, - ToolUseBlock, - ToolUseBlockParam, - Usage, - MessageCreateParams, - MessageCreateParamsNonStreaming, - MessageCreateParamsStreaming, - MessageStreamParams, Messages, + type ContentBlock, + type ContentBlockDeltaEvent, + type ContentBlockStartEvent, + type ContentBlockStopEvent, + type ImageBlockParam, + type InputJsonDelta, + type InputJSONDelta, + type Message, + type MessageDeltaEvent, + type MessageDeltaUsage, + type MessageParam, + type MessageStartEvent, + type MessageStopEvent, + type MessageStreamEvent, + type MessageStreamParams, + type Metadata, + type Model, + type RawContentBlockDeltaEvent, + type RawContentBlockStartEvent, + type RawContentBlockStopEvent, + type RawMessageDeltaEvent, + type RawMessageStartEvent, + type RawMessageStopEvent, + type RawMessageStreamEvent, + type TextBlock, + type TextBlockParam, + type TextDelta, + type Tool, + type ToolChoice, + type ToolChoiceAny, + type ToolChoiceAuto, + type ToolChoiceTool, + type ToolResultBlockParam, + type ToolUseBlock, + type ToolUseBlockParam, + type Usage, + type MessageCreateParams, + type MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming, } from './messages'; diff --git a/src/resources/messages.ts b/src/resources/messages.ts index b687d393..bd79fcc4 100644 --- a/src/resources/messages.ts +++ b/src/resources/messages.ts @@ -783,44 +783,46 @@ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase { export type MessageStreamParams = MessageCreateParamsBase; -export namespace Messages { - export import ContentBlock = MessagesAPI.ContentBlock; - export import ContentBlockDeltaEvent = MessagesAPI.ContentBlockDeltaEvent; - export import ContentBlockStartEvent = MessagesAPI.ContentBlockStartEvent; - export import ContentBlockStopEvent = MessagesAPI.ContentBlockStopEvent; - export import ImageBlockParam = MessagesAPI.ImageBlockParam; - export import InputJJsonDelta = MessagesAPI.InputJsonDelta; - export import InputJSONDelta = MessagesAPI.InputJSONDelta; - export import Message = MessagesAPI.Message; - export import MessageDeltaEvent = MessagesAPI.MessageDeltaEvent; - export import MessageDeltaUsage = MessagesAPI.MessageDeltaUsage; - export import MessageParam = MessagesAPI.MessageParam; - export import MessageStartEvent = MessagesAPI.MessageStartEvent; - export import MessageStopEvent = MessagesAPI.MessageStopEvent; - export import MessageStreamEvent = MessagesAPI.MessageStreamEvent; - export import Metadata = MessagesAPI.Metadata; - export import Model = MessagesAPI.Model; - export import RawContentBlockDeltaEvent = MessagesAPI.RawContentBlockDeltaEvent; - export import RawContentBlockStartEvent = MessagesAPI.RawContentBlockStartEvent; - export import RawContentBlockStopEvent = MessagesAPI.RawContentBlockStopEvent; - export import RawMessageDeltaEvent = MessagesAPI.RawMessageDeltaEvent; - export import RawMessageStartEvent = MessagesAPI.RawMessageStartEvent; - export import RawMessageStopEvent = MessagesAPI.RawMessageStopEvent; - export import RawMessageStreamEvent = MessagesAPI.RawMessageStreamEvent; - export import TextBlock = MessagesAPI.TextBlock; - export import TextBlockParam = MessagesAPI.TextBlockParam; - export import TextDelta = MessagesAPI.TextDelta; - export import Tool = MessagesAPI.Tool; - export import ToolChoice = MessagesAPI.ToolChoice; - export import ToolChoiceAny = MessagesAPI.ToolChoiceAny; - export import ToolChoiceAuto = MessagesAPI.ToolChoiceAuto; - export import ToolChoiceTool = MessagesAPI.ToolChoiceTool; - export import ToolResultBlockParam = MessagesAPI.ToolResultBlockParam; - export import ToolUseBlock = MessagesAPI.ToolUseBlock; - export import ToolUseBlockParam = MessagesAPI.ToolUseBlockParam; - export import Usage = MessagesAPI.Usage; - export import MessageCreateParams = MessagesAPI.MessageCreateParams; - export import MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming; - export import MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming; - export import MessageStreamParams = MessagesAPI.MessageStreamParams; +export declare namespace Messages { + export { + type ContentBlock as ContentBlock, + type ContentBlockDeltaEvent as ContentBlockDeltaEvent, + type ContentBlockStartEvent as ContentBlockStartEvent, + type ContentBlockStopEvent as ContentBlockStopEvent, + type ImageBlockParam as ImageBlockParam, + type InputJsonDelta as InputJsonDelta, + type InputJSONDelta as InputJSONDelta, + type Message as Message, + type MessageDeltaEvent as MessageDeltaEvent, + type MessageDeltaUsage as MessageDeltaUsage, + type MessageParam as MessageParam, + type MessageStartEvent as MessageStartEvent, + type MessageStopEvent as MessageStopEvent, + type MessageStreamEvent as MessageStreamEvent, + type Metadata as Metadata, + type Model as Model, + type RawContentBlockDeltaEvent as RawContentBlockDeltaEvent, + type RawContentBlockStartEvent as RawContentBlockStartEvent, + type RawContentBlockStopEvent as RawContentBlockStopEvent, + type RawMessageDeltaEvent as RawMessageDeltaEvent, + type RawMessageStartEvent as RawMessageStartEvent, + type RawMessageStopEvent as RawMessageStopEvent, + type RawMessageStreamEvent as RawMessageStreamEvent, + type TextBlock as TextBlock, + type TextBlockParam as TextBlockParam, + type TextDelta as TextDelta, + type Tool as Tool, + type ToolChoice as ToolChoice, + type ToolChoiceAny as ToolChoiceAny, + type ToolChoiceAuto as ToolChoiceAuto, + type ToolChoiceTool as ToolChoiceTool, + type ToolResultBlockParam as ToolResultBlockParam, + type ToolUseBlock as ToolUseBlock, + type ToolUseBlockParam as ToolUseBlockParam, + type Usage as Usage, + type MessageCreateParams as MessageCreateParams, + type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, + type MessageCreateParamsStreaming as MessageCreateParamsStreaming, + type MessageStreamParams as MessageStreamParams, + }; } diff --git a/tsconfig.json b/tsconfig.json index 65e1bc04..efa78715 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "paths": { "@anthropic-ai/sdk/_shims/auto/*": ["src/_shims/auto/*-node"], "@anthropic-ai/sdk/*": ["src/*"], - "@anthropic-ai/sdk": ["src/index.ts"], + "@anthropic-ai/sdk": ["src/index.ts"] }, "noEmit": true,