Skip to content

Commit

Permalink
Add pinned server version, fix sdk version header, bump local version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jenan-anthropic committed Jun 2, 2023
1 parent ec96afb commit 814927a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anthropic-ai/sdk",
"version": "0.4.3",
"version": "0.4.4",
"description": "Library for accessing the Anthropic API",
"repository": "https://github.com/anthropics/anthropic-sdk-typescript",
"license": "MIT",
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export type OnUpdate = (completion: CompletionResponse) => void | Promise<void>;
export const HUMAN_PROMPT = "\n\nHuman:";
export const AI_PROMPT = "\n\nAssistant:";

const CLIENT_ID = "anthropic-typescript/0.4.3";
const ANTHROPIC_SDK = "anthropic-typescript/0.4.4";
const ANTHROPIC_VERSION = "2023-01-01";
const DEFAULT_API_URL = "https://api.anthropic.com";

enum Event {
Expand Down Expand Up @@ -52,7 +53,8 @@ export class Client {
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Client: CLIENT_ID,
"Anthropic-SDK": ANTHROPIC_SDK,
"Anthropic-Version": ANTHROPIC_VERSION,
"X-API-Key": this.apiKey,
},
body: JSON.stringify({ ...params, stream: false }),
Expand Down Expand Up @@ -95,7 +97,8 @@ export class Client {
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Client: CLIENT_ID,
"Anthropic-SDK": ANTHROPIC_SDK,
"Anthropic-Version": ANTHROPIC_VERSION,
"X-API-Key": this.apiKey,
},
body: JSON.stringify({ ...params, stream: true }),
Expand Down

0 comments on commit 814927a

Please sign in to comment.