Skip to content

Commit e071caf

Browse files
Merge pull request #21 from anthropics/jenan/anthropic-version
Add pinned server version, fix sdk version header, bump local version.
2 parents ec96afb + 814927a commit e071caf

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anthropic-ai/sdk",
3-
"version": "0.4.3",
3+
"version": "0.4.4",
44
"description": "Library for accessing the Anthropic API",
55
"repository": "https://github.com/anthropics/anthropic-sdk-typescript",
66
"license": "MIT",

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export type OnUpdate = (completion: CompletionResponse) => void | Promise<void>;
1818
export const HUMAN_PROMPT = "\n\nHuman:";
1919
export const AI_PROMPT = "\n\nAssistant:";
2020

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

2425
enum Event {
@@ -52,7 +53,8 @@ export class Client {
5253
headers: {
5354
Accept: "application/json",
5455
"Content-Type": "application/json",
55-
Client: CLIENT_ID,
56+
"Anthropic-SDK": ANTHROPIC_SDK,
57+
"Anthropic-Version": ANTHROPIC_VERSION,
5658
"X-API-Key": this.apiKey,
5759
},
5860
body: JSON.stringify({ ...params, stream: false }),
@@ -95,7 +97,8 @@ export class Client {
9597
headers: {
9698
Accept: "application/json",
9799
"Content-Type": "application/json",
98-
Client: CLIENT_ID,
100+
"Anthropic-SDK": ANTHROPIC_SDK,
101+
"Anthropic-Version": ANTHROPIC_VERSION,
99102
"X-API-Key": this.apiKey,
100103
},
101104
body: JSON.stringify({ ...params, stream: true }),

0 commit comments

Comments
 (0)