Skip to content

Commit

Permalink
fix(client): eliminate circular imports, which cause runtime errors i…
Browse files Browse the repository at this point in the history
…n webpack dev bundles (#170)

Also updates the README.
  • Loading branch information
stainless-bot committed Oct 11, 2023
1 parent 9753314 commit 4a86733
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,8 @@

This library provides convenient access to the Anthropic REST API from server-side TypeScript or JavaScript.

For the AWS Bedrock API, see [`@anthropic-ai/bedrock-sdk`](github.com/anthropics/anthropic-bedrock-typescript).

## Migration from v0.4.x and below

In `v0.5.0`, we introduced a fully rewritten SDK. The new version offers better error handling, a more robust and intuitive streaming implementation, and more.
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
@@ -1,10 +1,10 @@
// File generated from our OpenAPI spec by Stainless.

import * as Core from './core';
import * as API from './resources/index';
import * as Errors from './error';
import { type Agent } from './_shims/index';
import * as Uploads from './uploads';
import * as API from '@anthropic-ai/sdk/resources/index';

export interface ClientOptions {
/**
Expand Down Expand Up @@ -222,10 +222,10 @@ export namespace Anthropic {
export import RequestOptions = Core.RequestOptions;

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 type Completion = API.Completion;
export type CompletionCreateParams = API.CompletionCreateParams;
export type CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
export type CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
}

export default Anthropic;
14 changes: 7 additions & 7 deletions src/resources/completions.ts
Expand Up @@ -3,7 +3,7 @@
import * as Core from '@anthropic-ai/sdk/core';
import { APIPromise } from '@anthropic-ai/sdk/core';
import { APIResource } from '@anthropic-ai/sdk/resource';
import * as API from './index';
import * as CompletionsAPI from '@anthropic-ai/sdk/resources/completions';
import { Stream } from '@anthropic-ai/sdk/streaming';

export class Completions extends APIResource {
Expand Down Expand Up @@ -156,8 +156,8 @@ export namespace CompletionCreateParams {
user_id?: string;
}

export type CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
export type CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
export type CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming;
export type CompletionCreateParamsStreaming = CompletionsAPI.CompletionCreateParamsStreaming;
}

export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
Expand All @@ -183,8 +183,8 @@ export interface CompletionCreateParamsStreaming extends CompletionCreateParamsB
}

export namespace Completions {
export import Completion = API.Completion;
export import CompletionCreateParams = API.CompletionCreateParams;
export import CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
export import CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
export type Completion = CompletionsAPI.Completion;
export type CompletionCreateParams = CompletionsAPI.CompletionCreateParams;
export type CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming;
export type CompletionCreateParamsStreaming = CompletionsAPI.CompletionCreateParamsStreaming;
}

0 comments on commit 4a86733

Please sign in to comment.