@mastra/claude 1.0.0 → 1.0.1-alpha.0
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/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 +1182 -0
- package/src/client/service-comments.ts +14 -0
- package/src/client/services.gen.ts +63 -0
- package/src/client/types.gen.ts +933 -0
- package/src/client/zodSchema.ts +337 -0
- package/src/index.ts +43 -52
- package/src/assets/claude.svg +0 -64
- package/src/openapi-components.ts +0 -467
- package/src/openapi-paths.ts +0 -85
- package/src/openapi.ts +0 -286
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const comments = {
|
|
2
|
+
createMessage: {
|
|
3
|
+
comment: 'Create a Message',
|
|
4
|
+
doc: 'Create a Message\n Send a structured list of input messages with text and/or image content, and the\n model will generate the next message in the conversation.\n \n The Messages API can be used for either single queries or stateless multi-turn\n conversations.',
|
|
5
|
+
},
|
|
6
|
+
createMessageBatch: {
|
|
7
|
+
comment: 'Create a Message Batch',
|
|
8
|
+
doc: 'Create a Message Batch\n Send a batch of Message creation requests.',
|
|
9
|
+
},
|
|
10
|
+
retrieveMessageBatch: {
|
|
11
|
+
comment: 'Retrieve a Message Batch',
|
|
12
|
+
doc: 'Retrieve a Message Batch\n This endpoint is idempotent and can be used to poll for Message Batch\n completion. To access the results of a Message Batch, make a request to the\n `results_url` field in the response.',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { createClient, createConfig, type Options } from '@hey-api/client-fetch';
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
CreateMessageData,
|
|
6
|
+
CreateMessageError,
|
|
7
|
+
CreateMessageResponse,
|
|
8
|
+
CreateMessageBatchData,
|
|
9
|
+
CreateMessageBatchError,
|
|
10
|
+
CreateMessageBatchResponse,
|
|
11
|
+
RetrieveMessageBatchData,
|
|
12
|
+
RetrieveMessageBatchError,
|
|
13
|
+
RetrieveMessageBatchResponse,
|
|
14
|
+
} from './types.gen';
|
|
15
|
+
|
|
16
|
+
export const client = createClient(createConfig());
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a Message
|
|
20
|
+
* Send a structured list of input messages with text and/or image content, and the
|
|
21
|
+
* model will generate the next message in the conversation.
|
|
22
|
+
*
|
|
23
|
+
* The Messages API can be used for either single queries or stateless multi-turn
|
|
24
|
+
* conversations.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export const createMessage = <ThrowOnError extends boolean = false>(
|
|
28
|
+
options: Options<CreateMessageData, ThrowOnError>,
|
|
29
|
+
) => {
|
|
30
|
+
return (options?.client ?? client).post<CreateMessageResponse, CreateMessageError, ThrowOnError>({
|
|
31
|
+
...options,
|
|
32
|
+
url: '/messages',
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Create a Message Batch
|
|
38
|
+
* Send a batch of Message creation requests.
|
|
39
|
+
*/
|
|
40
|
+
export const createMessageBatch = <ThrowOnError extends boolean = false>(
|
|
41
|
+
options: Options<CreateMessageBatchData, ThrowOnError>,
|
|
42
|
+
) => {
|
|
43
|
+
return (options?.client ?? client).post<CreateMessageBatchResponse, CreateMessageBatchError, ThrowOnError>({
|
|
44
|
+
...options,
|
|
45
|
+
url: '/messages/batches',
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Retrieve a Message Batch
|
|
51
|
+
* This endpoint is idempotent and can be used to poll for Message Batch
|
|
52
|
+
* completion. To access the results of a Message Batch, make a request to the
|
|
53
|
+
* `results_url` field in the response.
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export const retrieveMessageBatch = <ThrowOnError extends boolean = false>(
|
|
57
|
+
options: Options<RetrieveMessageBatchData, ThrowOnError>,
|
|
58
|
+
) => {
|
|
59
|
+
return (options?.client ?? client).get<RetrieveMessageBatchResponse, RetrieveMessageBatchError, ThrowOnError>({
|
|
60
|
+
...options,
|
|
61
|
+
url: '/messages/batches/{id}',
|
|
62
|
+
});
|
|
63
|
+
};
|