Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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;
}