@mastra/claude 1.0.0 → 1.0.2
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.
- package/dist/claude.cjs.development.js +531 -0
- package/dist/claude.cjs.development.js.map +1 -0
- package/dist/claude.cjs.production.min.js +2 -0
- package/dist/claude.cjs.production.min.js.map +1 -0
- package/dist/claude.esm.js +527 -0
- package/dist/claude.esm.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/packages/claude/src/client/index.d.ts +3 -0
- package/dist/packages/claude/src/client/schemas.gen.d.ts +212 -0
- package/dist/packages/claude/src/client/service-comments.d.ts +6 -0
- package/dist/packages/claude/src/client/services.gen.d.ts +9 -0
- package/dist/packages/claude/src/client/types.gen.d.ts +167 -0
- package/dist/packages/claude/src/client/zodSchema.d.ts +240 -0
- package/dist/packages/claude/src/index.d.ts +21 -0
- package/dist/packages/claude/src/openapi-components.d.ts +228 -0
- package/dist/packages/claude/src/openapi-paths.d.ts +42 -0
- package/dist/packages/claude/src/openapi.d.ts +285 -0
- package/package.json +8 -6
- package/src/Claude.test.ts +7 -18
- package/src/assets/claude.png +0 -0
- package/src/client/index.ts +4 -0
- package/src/client/schemas.gen.ts +288 -0
- package/src/client/service-comments.ts +6 -0
- package/src/client/services.gen.ts +14 -0
- package/src/client/types.gen.ts +178 -0
- package/src/client/zodSchema.ts +74 -0
- package/src/index.ts +29 -19
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
export declare const ErrorSchema: {
|
|
2
|
+
readonly type: "object";
|
|
3
|
+
readonly properties: {
|
|
4
|
+
readonly type: {
|
|
5
|
+
readonly type: "string";
|
|
6
|
+
readonly nullable: false;
|
|
7
|
+
};
|
|
8
|
+
readonly message: {
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
readonly nullable: false;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
readonly required: readonly ["type", "message"];
|
|
14
|
+
};
|
|
15
|
+
export declare const ErrorResponseSchema: {
|
|
16
|
+
readonly type: "object";
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly error: {
|
|
19
|
+
readonly $ref: "#/components/schemas/Error";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
readonly required: readonly ["error"];
|
|
23
|
+
};
|
|
24
|
+
export declare const CreateCompletionRequestSchema: {
|
|
25
|
+
readonly type: "object";
|
|
26
|
+
readonly properties: {
|
|
27
|
+
readonly model: {
|
|
28
|
+
readonly description: "The model that will complete your prompt.\nAs we improve Claude, we develop new versions of it that you can query.\nThis parameter controls which version of Claude answers your request.\nRight now we are offering two model families: Claude, and Claude Instant.\nYou can use them by setting model to \"claude-2\" or \"claude-instant-1\", respectively.\nSee models for additional details.\n";
|
|
29
|
+
readonly oneOf: readonly [{
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
}, {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly enum: readonly ["claude-2", "claude-2.0", "claude-instant-1", "claude-instant-1.1"];
|
|
34
|
+
}];
|
|
35
|
+
readonly 'x-oaiTypeLabel': "string";
|
|
36
|
+
};
|
|
37
|
+
readonly prompt: {
|
|
38
|
+
readonly description: "The prompt that you want Claude to complete.\n\nFor proper response generation you will need to format your prompt as follows:\n\n\nHuman: ${userQuestion}\n\nAssistant:\nSee our comments on prompts for more context.\n";
|
|
39
|
+
readonly default: "<|endoftext|>";
|
|
40
|
+
readonly nullable: true;
|
|
41
|
+
readonly oneOf: readonly [{
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly default: "";
|
|
44
|
+
readonly example: "This is a test.";
|
|
45
|
+
}, {
|
|
46
|
+
readonly type: "array";
|
|
47
|
+
readonly items: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly default: "";
|
|
50
|
+
readonly example: "This is a test.";
|
|
51
|
+
};
|
|
52
|
+
}, {
|
|
53
|
+
readonly type: "array";
|
|
54
|
+
readonly minItems: 1;
|
|
55
|
+
readonly items: {
|
|
56
|
+
readonly type: "integer";
|
|
57
|
+
};
|
|
58
|
+
readonly example: "[1212, 318, 257, 1332, 13]";
|
|
59
|
+
}, {
|
|
60
|
+
readonly type: "array";
|
|
61
|
+
readonly minItems: 1;
|
|
62
|
+
readonly items: {
|
|
63
|
+
readonly type: "array";
|
|
64
|
+
readonly minItems: 1;
|
|
65
|
+
readonly items: {
|
|
66
|
+
readonly type: "integer";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
readonly example: "[[1212, 318, 257, 1332, 13]]";
|
|
70
|
+
}];
|
|
71
|
+
};
|
|
72
|
+
readonly max_tokens_to_sample: {
|
|
73
|
+
readonly type: "integer";
|
|
74
|
+
readonly minimum: 1;
|
|
75
|
+
readonly default: 256;
|
|
76
|
+
readonly example: 256;
|
|
77
|
+
readonly nullable: true;
|
|
78
|
+
readonly description: "The maximum number of tokens to generate before stopping.\n\nNote that our models may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.\n";
|
|
79
|
+
};
|
|
80
|
+
readonly temperature: {
|
|
81
|
+
readonly type: "number";
|
|
82
|
+
readonly minimum: 0;
|
|
83
|
+
readonly maximum: 1;
|
|
84
|
+
readonly default: 1;
|
|
85
|
+
readonly example: 1;
|
|
86
|
+
readonly nullable: true;
|
|
87
|
+
readonly description: "Amount of randomness injected into the response.\n\nDefaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical / multiple choice, and closer to 1 for creative and generative tasks.\n";
|
|
88
|
+
};
|
|
89
|
+
readonly top_p: {
|
|
90
|
+
readonly type: "number";
|
|
91
|
+
readonly minimum: 0;
|
|
92
|
+
readonly maximum: 1;
|
|
93
|
+
readonly default: 1;
|
|
94
|
+
readonly example: 1;
|
|
95
|
+
readonly nullable: true;
|
|
96
|
+
readonly description: "Use nucleus sampling.\n\nIn nucleus sampling, we compute the cumulative distribution over all the options \nfor each subsequent token in decreasing probability order and cut it off once \nit reaches a particular probability specified by top_p. You should either alter temperature or top_p, but not both.\n";
|
|
97
|
+
};
|
|
98
|
+
readonly top_k: {
|
|
99
|
+
readonly type: "number";
|
|
100
|
+
readonly minimum: 0;
|
|
101
|
+
readonly default: 5;
|
|
102
|
+
readonly example: 5;
|
|
103
|
+
readonly nullable: true;
|
|
104
|
+
readonly description: "Only sample from the top K options for each subsequent token.\n\nUsed to remove \"long tail\" low probability responses. Learn more technical details here.\n";
|
|
105
|
+
};
|
|
106
|
+
readonly stream: {
|
|
107
|
+
readonly description: "Whether to incrementally stream the response using server-sent events.\nSee this guide to SSE events for details.type: boolean\n";
|
|
108
|
+
readonly nullable: true;
|
|
109
|
+
readonly default: false;
|
|
110
|
+
};
|
|
111
|
+
readonly stop_sequences: {
|
|
112
|
+
readonly description: "Sequences that will cause the model to stop generating completion text.\nOur models stop on \"\n\nHuman:\", and may include additional built-in stop sequences in the future. By providing the stop_sequences parameter, you may include additional strings that will cause the model to stop generating.\n";
|
|
113
|
+
readonly default: null;
|
|
114
|
+
readonly nullable: true;
|
|
115
|
+
readonly oneOf: readonly [{
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
readonly default: "<|endoftext|>";
|
|
118
|
+
readonly example: "\n";
|
|
119
|
+
readonly nullable: true;
|
|
120
|
+
}, {
|
|
121
|
+
readonly type: "array";
|
|
122
|
+
readonly minItems: 1;
|
|
123
|
+
readonly maxItems: 4;
|
|
124
|
+
readonly items: {
|
|
125
|
+
readonly type: "string";
|
|
126
|
+
readonly example: "[\"\\n\"]";
|
|
127
|
+
};
|
|
128
|
+
}];
|
|
129
|
+
};
|
|
130
|
+
readonly metadata: {
|
|
131
|
+
readonly type: "object";
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly user_id: {
|
|
134
|
+
readonly type: "string";
|
|
135
|
+
readonly example: "13803d75-b4b5-4c3e-b2a2-6f21399b021b";
|
|
136
|
+
readonly description: "An external identifier for the user who is associated with the request.\n\nThis should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. \nDo not include any identifying information such as name, email address, or phone number.\n";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
readonly description: "An object describing metadata about the request.\n";
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
readonly required: readonly ["model", "prompt", "max_tokens_to_sample"];
|
|
143
|
+
};
|
|
144
|
+
export declare const CreateCompletionResponseSchema: {
|
|
145
|
+
readonly type: "object";
|
|
146
|
+
readonly properties: {
|
|
147
|
+
readonly stop_reason: {
|
|
148
|
+
readonly type: "string";
|
|
149
|
+
readonly enum: readonly ["stop_sequence", "max_tokens"];
|
|
150
|
+
readonly description: "The reason that we stopped sampling.\n\nThis may be one the following values:\n\n\"stop_sequence\": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model\n\"max_tokens\": we exceeded max_tokens_to_sample or the model's maximum\n";
|
|
151
|
+
};
|
|
152
|
+
readonly model: {
|
|
153
|
+
readonly type: "string";
|
|
154
|
+
readonly description: "The model that performed the completion.\n";
|
|
155
|
+
};
|
|
156
|
+
readonly completion: {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
readonly description: "The resulting completion up to and excluding the stop sequences.\n";
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
readonly required: readonly ["completion", "stop_reason", "model"];
|
|
162
|
+
};
|
|
163
|
+
export declare const CreateCompletionStreamResponseSchema: {
|
|
164
|
+
readonly type: "object";
|
|
165
|
+
readonly properties: {
|
|
166
|
+
readonly stop_reason: {
|
|
167
|
+
readonly type: "string";
|
|
168
|
+
readonly enum: readonly ["stop_sequence", "max_tokens"];
|
|
169
|
+
readonly description: "The reason that we stopped sampling.\n\nThis may be one the following values:\n\n\"stop_sequence\": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model\n\"max_tokens\": we exceeded max_tokens_to_sample or the model's maximum\n";
|
|
170
|
+
};
|
|
171
|
+
readonly model: {
|
|
172
|
+
readonly type: "string";
|
|
173
|
+
readonly description: "The model that performed the completion.\n";
|
|
174
|
+
};
|
|
175
|
+
readonly completion: {
|
|
176
|
+
readonly type: "string";
|
|
177
|
+
readonly description: "The resulting completion up to and excluding the stop sequences.\n";
|
|
178
|
+
};
|
|
179
|
+
readonly choices: {
|
|
180
|
+
readonly type: "array";
|
|
181
|
+
readonly items: {
|
|
182
|
+
readonly type: "object";
|
|
183
|
+
readonly properties: {
|
|
184
|
+
readonly delta: {
|
|
185
|
+
readonly $ref: "#/components/schemas/CompletionStreamResponseDelta";
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
readonly required: readonly ["completion", "stop_reason", "model"];
|
|
192
|
+
};
|
|
193
|
+
export declare const CompletionStreamResponseDeltaSchema: {
|
|
194
|
+
readonly type: "object";
|
|
195
|
+
readonly properties: {
|
|
196
|
+
readonly completion: {
|
|
197
|
+
readonly type: "string";
|
|
198
|
+
readonly description: "The contents of the chunk message.";
|
|
199
|
+
readonly nullable: true;
|
|
200
|
+
};
|
|
201
|
+
readonly stop_reason: {
|
|
202
|
+
readonly type: "string";
|
|
203
|
+
readonly enum: readonly ["stop_sequence", "max_tokens"];
|
|
204
|
+
readonly description: "The reason that we stopped sampling.\n\nThis may be one the following values:\n\n\"stop_sequence\": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model\n\"max_tokens\": we exceeded max_tokens_to_sample or the model's maximum\n";
|
|
205
|
+
readonly nullable: true;
|
|
206
|
+
};
|
|
207
|
+
readonly model: {
|
|
208
|
+
readonly type: "string";
|
|
209
|
+
readonly description: "The model that performed the completion.\n";
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Options } from '@hey-api/client-fetch';
|
|
2
|
+
import type { CompleteData } from './types.gen';
|
|
3
|
+
export declare const client: import("@hey-api/client-fetch").Client<Request, Response, import("@hey-api/client-fetch").RequestOptionsBase<false> & import("@hey-api/client-fetch").Config<false> & {
|
|
4
|
+
headers: Headers;
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a completion for the provided prompt and parameters.
|
|
8
|
+
*/
|
|
9
|
+
export declare const complete: <ThrowOnError extends boolean = false>(options: Options<CompleteData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").CreateCompletionResponse, unknown, ThrowOnError>;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
export type Error = {
|
|
2
|
+
type: string;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
export type ErrorResponse = {
|
|
6
|
+
error: Error;
|
|
7
|
+
};
|
|
8
|
+
export type CreateCompletionRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* The model that will complete your prompt.
|
|
11
|
+
* As we improve Claude, we develop new versions of it that you can query.
|
|
12
|
+
* This parameter controls which version of Claude answers your request.
|
|
13
|
+
* Right now we are offering two model families: Claude, and Claude Instant.
|
|
14
|
+
* You can use them by setting model to "claude-2" or "claude-instant-1", respectively.
|
|
15
|
+
* See models for additional details.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
model: (string | 'claude-2' | 'claude-2.0' | 'claude-instant-1' | 'claude-instant-1.1');
|
|
19
|
+
/**
|
|
20
|
+
* The prompt that you want Claude to complete.
|
|
21
|
+
*
|
|
22
|
+
* For proper response generation you will need to format your prompt as follows:
|
|
23
|
+
* \n\nHuman: ${userQuestion}\n\nAssistant:
|
|
24
|
+
* See our comments on prompts for more context.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
prompt: ((string | Array<(string)> | Array<(number)> | Array<Array<(number)>>) | null);
|
|
28
|
+
/**
|
|
29
|
+
* The maximum number of tokens to generate before stopping.
|
|
30
|
+
*
|
|
31
|
+
* Note that our models may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
max_tokens_to_sample: (number) | null;
|
|
35
|
+
/**
|
|
36
|
+
* Amount of randomness injected into the response.
|
|
37
|
+
*
|
|
38
|
+
* Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical / multiple choice, and closer to 1 for creative and generative tasks.
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
temperature?: (number) | null;
|
|
42
|
+
/**
|
|
43
|
+
* Use nucleus sampling.
|
|
44
|
+
*
|
|
45
|
+
* In nucleus sampling, we compute the cumulative distribution over all the options
|
|
46
|
+
* for each subsequent token in decreasing probability order and cut it off once
|
|
47
|
+
* it reaches a particular probability specified by top_p. You should either alter temperature or top_p, but not both.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
top_p?: (number) | null;
|
|
51
|
+
/**
|
|
52
|
+
* Only sample from the top K options for each subsequent token.
|
|
53
|
+
*
|
|
54
|
+
* Used to remove "long tail" low probability responses. Learn more technical details here.
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
top_k?: (number) | null;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to incrementally stream the response using server-sent events.
|
|
60
|
+
* See this guide to SSE events for details.type: boolean
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
stream?: unknown;
|
|
64
|
+
/**
|
|
65
|
+
* Sequences that will cause the model to stop generating completion text.
|
|
66
|
+
* Our models stop on "\n\nHuman:", and may include additional built-in stop sequences in the future. By providing the stop_sequences parameter, you may include additional strings that will cause the model to stop generating.
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
stop_sequences?: ((string) | null | Array<(string)>);
|
|
70
|
+
/**
|
|
71
|
+
* An object describing metadata about the request.
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
metadata?: {
|
|
75
|
+
/**
|
|
76
|
+
* An external identifier for the user who is associated with the request.
|
|
77
|
+
*
|
|
78
|
+
* This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse.
|
|
79
|
+
* Do not include any identifying information such as name, email address, or phone number.
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
user_id?: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export type CreateCompletionResponse = {
|
|
86
|
+
/**
|
|
87
|
+
* The reason that we stopped sampling.
|
|
88
|
+
*
|
|
89
|
+
* This may be one the following values:
|
|
90
|
+
*
|
|
91
|
+
* "stop_sequence": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model
|
|
92
|
+
* "max_tokens": we exceeded max_tokens_to_sample or the model's maximum
|
|
93
|
+
*
|
|
94
|
+
*/
|
|
95
|
+
stop_reason: 'stop_sequence' | 'max_tokens';
|
|
96
|
+
/**
|
|
97
|
+
* The model that performed the completion.
|
|
98
|
+
*
|
|
99
|
+
*/
|
|
100
|
+
model: string;
|
|
101
|
+
/**
|
|
102
|
+
* The resulting completion up to and excluding the stop sequences.
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
completion: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* The reason that we stopped sampling.
|
|
109
|
+
*
|
|
110
|
+
* This may be one the following values:
|
|
111
|
+
*
|
|
112
|
+
* "stop_sequence": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model
|
|
113
|
+
* "max_tokens": we exceeded max_tokens_to_sample or the model's maximum
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
export type stop_reason = 'stop_sequence' | 'max_tokens';
|
|
117
|
+
export type CreateCompletionStreamResponse = {
|
|
118
|
+
/**
|
|
119
|
+
* The reason that we stopped sampling.
|
|
120
|
+
*
|
|
121
|
+
* This may be one the following values:
|
|
122
|
+
*
|
|
123
|
+
* "stop_sequence": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model
|
|
124
|
+
* "max_tokens": we exceeded max_tokens_to_sample or the model's maximum
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
stop_reason: 'stop_sequence' | 'max_tokens';
|
|
128
|
+
/**
|
|
129
|
+
* The model that performed the completion.
|
|
130
|
+
*
|
|
131
|
+
*/
|
|
132
|
+
model: string;
|
|
133
|
+
/**
|
|
134
|
+
* The resulting completion up to and excluding the stop sequences.
|
|
135
|
+
*
|
|
136
|
+
*/
|
|
137
|
+
completion: string;
|
|
138
|
+
choices?: Array<{
|
|
139
|
+
delta?: CompletionStreamResponseDelta;
|
|
140
|
+
}>;
|
|
141
|
+
};
|
|
142
|
+
export type CompletionStreamResponseDelta = {
|
|
143
|
+
/**
|
|
144
|
+
* The contents of the chunk message.
|
|
145
|
+
*/
|
|
146
|
+
completion?: (string) | null;
|
|
147
|
+
/**
|
|
148
|
+
* The reason that we stopped sampling.
|
|
149
|
+
*
|
|
150
|
+
* This may be one the following values:
|
|
151
|
+
*
|
|
152
|
+
* "stop_sequence": we reached a stop sequence — either provided by you via the stop_sequences parameter, or a stop sequence built into the model
|
|
153
|
+
* "max_tokens": we exceeded max_tokens_to_sample or the model's maximum
|
|
154
|
+
*
|
|
155
|
+
*/
|
|
156
|
+
stop_reason?: ('stop_sequence' | 'max_tokens') | null;
|
|
157
|
+
/**
|
|
158
|
+
* The model that performed the completion.
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
model?: string;
|
|
162
|
+
};
|
|
163
|
+
export type CompleteData = {
|
|
164
|
+
body: CreateCompletionRequest;
|
|
165
|
+
};
|
|
166
|
+
export type CompleteResponse = (CreateCompletionResponse);
|
|
167
|
+
export type CompleteError = unknown;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const errorSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodString;
|
|
4
|
+
message: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}, {
|
|
9
|
+
type: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const errorResponseSchema: z.ZodObject<{
|
|
13
|
+
error: z.ZodObject<{
|
|
14
|
+
type: z.ZodString;
|
|
15
|
+
message: z.ZodString;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
type: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}, {
|
|
20
|
+
type: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
error: {
|
|
25
|
+
type: string;
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
|
28
|
+
}, {
|
|
29
|
+
error: {
|
|
30
|
+
type: string;
|
|
31
|
+
message: string;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
export declare const createCompletionRequestSchema: z.ZodObject<{
|
|
35
|
+
model: z.ZodUnion<[z.ZodString, z.ZodLiteral<"claude-2">, z.ZodLiteral<"claude-2.0">, z.ZodLiteral<"claude-instant-1">, z.ZodLiteral<"claude-instant-1.1">]>;
|
|
36
|
+
prompt: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>>;
|
|
37
|
+
max_tokens_to_sample: z.ZodNullable<z.ZodNumber>;
|
|
38
|
+
temperature: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
39
|
+
top_p: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
40
|
+
top_k: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
41
|
+
stream: z.ZodOptional<z.ZodUnknown>;
|
|
42
|
+
stop_sequences: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
43
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
user_id?: string | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
user_id?: string | undefined;
|
|
49
|
+
}>>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
model: string;
|
|
52
|
+
prompt: string | string[] | number[] | number[][] | null;
|
|
53
|
+
max_tokens_to_sample: number | null;
|
|
54
|
+
temperature?: number | null | undefined;
|
|
55
|
+
top_p?: number | null | undefined;
|
|
56
|
+
top_k?: number | null | undefined;
|
|
57
|
+
stream?: unknown;
|
|
58
|
+
stop_sequences?: string | string[] | null | undefined;
|
|
59
|
+
metadata?: {
|
|
60
|
+
user_id?: string | undefined;
|
|
61
|
+
} | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
model: string;
|
|
64
|
+
prompt: string | string[] | number[] | number[][] | null;
|
|
65
|
+
max_tokens_to_sample: number | null;
|
|
66
|
+
temperature?: number | null | undefined;
|
|
67
|
+
top_p?: number | null | undefined;
|
|
68
|
+
top_k?: number | null | undefined;
|
|
69
|
+
stream?: unknown;
|
|
70
|
+
stop_sequences?: string | string[] | null | undefined;
|
|
71
|
+
metadata?: {
|
|
72
|
+
user_id?: string | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
}>;
|
|
75
|
+
export declare const createCompletionResponseSchema: z.ZodObject<{
|
|
76
|
+
stop_reason: z.ZodUnion<[z.ZodLiteral<"stop_sequence">, z.ZodLiteral<"max_tokens">]>;
|
|
77
|
+
model: z.ZodString;
|
|
78
|
+
completion: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
model: string;
|
|
81
|
+
stop_reason: "stop_sequence" | "max_tokens";
|
|
82
|
+
completion: string;
|
|
83
|
+
}, {
|
|
84
|
+
model: string;
|
|
85
|
+
stop_reason: "stop_sequence" | "max_tokens";
|
|
86
|
+
completion: string;
|
|
87
|
+
}>;
|
|
88
|
+
export declare const stopReasonSchema: z.ZodUnion<[z.ZodLiteral<"stop_sequence">, z.ZodLiteral<"max_tokens">]>;
|
|
89
|
+
export declare const completionStreamResponseDeltaSchema: z.ZodObject<{
|
|
90
|
+
completion: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
91
|
+
stop_reason: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"stop_sequence">, z.ZodLiteral<"max_tokens">]>>>;
|
|
92
|
+
model: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
model?: string | undefined;
|
|
95
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
96
|
+
completion?: string | null | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
model?: string | undefined;
|
|
99
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
100
|
+
completion?: string | null | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
export declare const completeDataSchema: z.ZodObject<{
|
|
103
|
+
body: z.ZodObject<{
|
|
104
|
+
model: z.ZodUnion<[z.ZodString, z.ZodLiteral<"claude-2">, z.ZodLiteral<"claude-2.0">, z.ZodLiteral<"claude-instant-1">, z.ZodLiteral<"claude-instant-1.1">]>;
|
|
105
|
+
prompt: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">]>>;
|
|
106
|
+
max_tokens_to_sample: z.ZodNullable<z.ZodNumber>;
|
|
107
|
+
temperature: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
108
|
+
top_p: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
109
|
+
top_k: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
110
|
+
stream: z.ZodOptional<z.ZodUnknown>;
|
|
111
|
+
stop_sequences: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
112
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
user_id?: string | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
user_id?: string | undefined;
|
|
118
|
+
}>>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
model: string;
|
|
121
|
+
prompt: string | string[] | number[] | number[][] | null;
|
|
122
|
+
max_tokens_to_sample: number | null;
|
|
123
|
+
temperature?: number | null | undefined;
|
|
124
|
+
top_p?: number | null | undefined;
|
|
125
|
+
top_k?: number | null | undefined;
|
|
126
|
+
stream?: unknown;
|
|
127
|
+
stop_sequences?: string | string[] | null | undefined;
|
|
128
|
+
metadata?: {
|
|
129
|
+
user_id?: string | undefined;
|
|
130
|
+
} | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
model: string;
|
|
133
|
+
prompt: string | string[] | number[] | number[][] | null;
|
|
134
|
+
max_tokens_to_sample: number | null;
|
|
135
|
+
temperature?: number | null | undefined;
|
|
136
|
+
top_p?: number | null | undefined;
|
|
137
|
+
top_k?: number | null | undefined;
|
|
138
|
+
stream?: unknown;
|
|
139
|
+
stop_sequences?: string | string[] | null | undefined;
|
|
140
|
+
metadata?: {
|
|
141
|
+
user_id?: string | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
}>;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
body: {
|
|
146
|
+
model: string;
|
|
147
|
+
prompt: string | string[] | number[] | number[][] | null;
|
|
148
|
+
max_tokens_to_sample: number | null;
|
|
149
|
+
temperature?: number | null | undefined;
|
|
150
|
+
top_p?: number | null | undefined;
|
|
151
|
+
top_k?: number | null | undefined;
|
|
152
|
+
stream?: unknown;
|
|
153
|
+
stop_sequences?: string | string[] | null | undefined;
|
|
154
|
+
metadata?: {
|
|
155
|
+
user_id?: string | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
};
|
|
158
|
+
}, {
|
|
159
|
+
body: {
|
|
160
|
+
model: string;
|
|
161
|
+
prompt: string | string[] | number[] | number[][] | null;
|
|
162
|
+
max_tokens_to_sample: number | null;
|
|
163
|
+
temperature?: number | null | undefined;
|
|
164
|
+
top_p?: number | null | undefined;
|
|
165
|
+
top_k?: number | null | undefined;
|
|
166
|
+
stream?: unknown;
|
|
167
|
+
stop_sequences?: string | string[] | null | undefined;
|
|
168
|
+
metadata?: {
|
|
169
|
+
user_id?: string | undefined;
|
|
170
|
+
} | undefined;
|
|
171
|
+
};
|
|
172
|
+
}>;
|
|
173
|
+
export declare const completeResponseSchema: z.ZodObject<{
|
|
174
|
+
stop_reason: z.ZodUnion<[z.ZodLiteral<"stop_sequence">, z.ZodLiteral<"max_tokens">]>;
|
|
175
|
+
model: z.ZodString;
|
|
176
|
+
completion: z.ZodString;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
model: string;
|
|
179
|
+
stop_reason: "stop_sequence" | "max_tokens";
|
|
180
|
+
completion: string;
|
|
181
|
+
}, {
|
|
182
|
+
model: string;
|
|
183
|
+
stop_reason: "stop_sequence" | "max_tokens";
|
|
184
|
+
completion: string;
|
|
185
|
+
}>;
|
|
186
|
+
export declare const completeErrorSchema: z.ZodUnknown;
|
|
187
|
+
export declare const createCompletionStreamResponseSchema: z.ZodObject<{
|
|
188
|
+
stop_reason: z.ZodUnion<[z.ZodLiteral<"stop_sequence">, z.ZodLiteral<"max_tokens">]>;
|
|
189
|
+
model: z.ZodString;
|
|
190
|
+
completion: z.ZodString;
|
|
191
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
192
|
+
delta: z.ZodOptional<z.ZodObject<{
|
|
193
|
+
completion: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
194
|
+
stop_reason: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"stop_sequence">, z.ZodLiteral<"max_tokens">]>>>;
|
|
195
|
+
model: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
model?: string | undefined;
|
|
198
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
199
|
+
completion?: string | null | undefined;
|
|
200
|
+
}, {
|
|
201
|
+
model?: string | undefined;
|
|
202
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
203
|
+
completion?: string | null | undefined;
|
|
204
|
+
}>>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
delta?: {
|
|
207
|
+
model?: string | undefined;
|
|
208
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
209
|
+
completion?: string | null | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
}, {
|
|
212
|
+
delta?: {
|
|
213
|
+
model?: string | undefined;
|
|
214
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
215
|
+
completion?: string | null | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
}>, "many">>;
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
model: string;
|
|
220
|
+
stop_reason: "stop_sequence" | "max_tokens";
|
|
221
|
+
completion: string;
|
|
222
|
+
choices?: {
|
|
223
|
+
delta?: {
|
|
224
|
+
model?: string | undefined;
|
|
225
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
226
|
+
completion?: string | null | undefined;
|
|
227
|
+
} | undefined;
|
|
228
|
+
}[] | undefined;
|
|
229
|
+
}, {
|
|
230
|
+
model: string;
|
|
231
|
+
stop_reason: "stop_sequence" | "max_tokens";
|
|
232
|
+
completion: string;
|
|
233
|
+
choices?: {
|
|
234
|
+
delta?: {
|
|
235
|
+
model?: string | undefined;
|
|
236
|
+
stop_reason?: "stop_sequence" | "max_tokens" | null | undefined;
|
|
237
|
+
completion?: string | null | undefined;
|
|
238
|
+
} | undefined;
|
|
239
|
+
}[] | undefined;
|
|
240
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Integration, IntegrationAuth } from '@mastra/core';
|
|
2
|
+
import * as integrationClient from './client/services.gen';
|
|
3
|
+
import * as zodSchema from './client/zodSchema';
|
|
4
|
+
export declare class ClaudeIntegration extends Integration {
|
|
5
|
+
categories: string[];
|
|
6
|
+
description: string;
|
|
7
|
+
constructor();
|
|
8
|
+
getClientZodSchema(): typeof zodSchema;
|
|
9
|
+
getCommentsForClientApis(): {
|
|
10
|
+
complete: {
|
|
11
|
+
comment: string;
|
|
12
|
+
doc: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
getBaseClient(): typeof integrationClient;
|
|
16
|
+
getApiClient: ({ connectionId }: {
|
|
17
|
+
connectionId: string;
|
|
18
|
+
}) => Promise<typeof integrationClient>;
|
|
19
|
+
registerEvents(): Record<string, import("@mastra/core").IntegrationEvent<any>>;
|
|
20
|
+
getAuthenticator(): IntegrationAuth;
|
|
21
|
+
}
|