@anthropic-ai/sdk 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ export type SamplingParameters = {
2
+ prompt: string;
3
+ model: string;
4
+ stop_sequences: string[];
5
+ max_tokens_to_sample: number;
6
+ };
7
+ export type OnSampleChange = (completion: CompletionResponse) => void | Promise<void>;
8
+ export declare const HUMAN_PROMPT = "\n\nHuman:";
9
+ export declare const AI_PROMPT = "\n\nAssistant:";
10
+ export type CompletionResponse = {
11
+ completion: string;
12
+ stop: string | null;
13
+ stop_reason: string | null;
14
+ truncated: boolean;
15
+ exception: string | null;
16
+ log_id: string;
17
+ };
18
+ export declare class Client {
19
+ private apiKey;
20
+ private apiUrl;
21
+ constructor(apiKey: string, options?: {
22
+ apiUrl?: string;
23
+ });
24
+ complete(params: SamplingParameters): Promise<CompletionResponse>;
25
+ completeStream(params: SamplingParameters, onSampleChange: OnSampleChange): Promise<CompletionResponse>;
26
+ }
@@ -13,7 +13,7 @@ exports.Client = exports.AI_PROMPT = exports.HUMAN_PROMPT = void 0;
13
13
  const fetch_event_source_1 = require("@fortaine/fetch-event-source");
14
14
  exports.HUMAN_PROMPT = "\n\nHuman:";
15
15
  exports.AI_PROMPT = "\n\nAssistant:";
16
- const CLIENT_ID = "anthropic-typescript/0.2.2";
16
+ const CLIENT_ID = "anthropic-typescript/0.2.3";
17
17
  const DEFAULT_API_URL = "https://api.anthropic.com";
18
18
  var Event;
19
19
  (function (Event) {
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@anthropic-ai/sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Library for accessing the Anthropic API",
5
5
  "repository": "https://github.com/anthropics/anthropic-sdk-typescript",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "main": "build/src/index.js",
9
+ "types": "build/src/index.d.ts",
9
10
  "files": [
10
- "build/src/**.js"
11
+ "build/src/**"
11
12
  ],
12
13
  "scripts": {
13
14
  "build": "tsc --build",