@amaster.ai/client 1.1.0-beta.53 → 1.1.0-beta.55
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 +11 -11
- package/types/copilot.d.ts +65 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaster.ai/client",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.55",
|
|
4
4
|
"description": "Unified API client for Amaster platform - All services in one package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
"registry": "https://registry.npmjs.org/"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@amaster.ai/
|
|
76
|
-
"@amaster.ai/bpm-client": "1.1.0-beta.
|
|
77
|
-
"@amaster.ai/
|
|
78
|
-
"@amaster.ai/
|
|
79
|
-
"@amaster.ai/
|
|
80
|
-
"@amaster.ai/
|
|
81
|
-
"@amaster.ai/
|
|
82
|
-
"@amaster.ai/s3-client": "1.1.0-beta.
|
|
83
|
-
"@amaster.ai/
|
|
84
|
-
"@amaster.ai/
|
|
75
|
+
"@amaster.ai/asr-client": "1.1.0-beta.55",
|
|
76
|
+
"@amaster.ai/bpm-client": "1.1.0-beta.55",
|
|
77
|
+
"@amaster.ai/auth-client": "1.1.0-beta.55",
|
|
78
|
+
"@amaster.ai/copilot-client": "1.1.0-beta.55",
|
|
79
|
+
"@amaster.ai/entity-client": "1.1.0-beta.55",
|
|
80
|
+
"@amaster.ai/function-client": "1.1.0-beta.55",
|
|
81
|
+
"@amaster.ai/http-client": "1.1.0-beta.55",
|
|
82
|
+
"@amaster.ai/s3-client": "1.1.0-beta.55",
|
|
83
|
+
"@amaster.ai/tts-client": "1.1.0-beta.55",
|
|
84
|
+
"@amaster.ai/workflow-client": "1.1.0-beta.55"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"axios": "^1.11.0"
|
package/types/copilot.d.ts
CHANGED
|
@@ -1,49 +1,80 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
SendStreamingMessageResponse,
|
|
3
|
+
CancelTaskResponse,
|
|
4
|
+
GetTaskResponse,
|
|
5
|
+
} from "@a2a-js/sdk";
|
|
6
|
+
import type { ClientResult } from "./common";
|
|
3
7
|
|
|
4
8
|
interface TextContent {
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
type: "text";
|
|
10
|
+
text: string;
|
|
7
11
|
}
|
|
8
12
|
interface ImageContent {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
type: "image";
|
|
14
|
+
data?: string;
|
|
15
|
+
url?: string;
|
|
16
|
+
mimeType?: string;
|
|
13
17
|
}
|
|
14
18
|
interface FileContent {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
type: "file";
|
|
20
|
+
data?: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
mimeType?: string;
|
|
23
|
+
name?: string;
|
|
20
24
|
}
|
|
21
25
|
type MessageContent = TextContent | ImageContent | FileContent;
|
|
22
26
|
interface ChatMessage {
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
role: "system" | "user" | "assistant";
|
|
28
|
+
content: string | MessageContent[];
|
|
25
29
|
}
|
|
26
30
|
interface ChatOptions {
|
|
27
|
-
|
|
31
|
+
taskId?: string;
|
|
28
32
|
}
|
|
29
33
|
type CopilotClientAPI = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Stream messages from Copilot Agent.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { createCopilotClient, Data } from "@amaster.ai/copilot-client";
|
|
40
|
+
*
|
|
41
|
+
* const client = createCopilotClient();
|
|
42
|
+
*
|
|
43
|
+
* for await (const response of client.chat([{ role: "user", content: "Hello" }])) {
|
|
44
|
+
* // deal response
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
chat(
|
|
49
|
+
messages: ChatMessage[],
|
|
50
|
+
options?: ChatOptions
|
|
51
|
+
): AsyncGenerator<SendStreamingMessageResponse, void, unknown>;
|
|
52
|
+
cancelChat(taskId: string): Promise<ClientResult<CancelTaskResponse>>;
|
|
53
|
+
getChatStatus(taskId?: string): Promise<{
|
|
54
|
+
working: boolean;
|
|
55
|
+
taskId?: string;
|
|
56
|
+
error?: string;
|
|
57
|
+
}>;
|
|
58
|
+
getHistory(
|
|
59
|
+
limit?: number,
|
|
60
|
+
next?: string
|
|
61
|
+
): Promise<
|
|
62
|
+
| {
|
|
63
|
+
messages: SendStreamingMessageResponse[];
|
|
64
|
+
next: string;
|
|
65
|
+
hasMore: boolean;
|
|
66
|
+
}
|
|
67
|
+
| undefined
|
|
68
|
+
>;
|
|
69
|
+
newConversation(): Promise<void>;
|
|
47
70
|
};
|
|
48
71
|
|
|
49
|
-
export {
|
|
72
|
+
export {
|
|
73
|
+
type ChatMessage,
|
|
74
|
+
type ChatOptions,
|
|
75
|
+
type CopilotClientAPI,
|
|
76
|
+
type FileContent,
|
|
77
|
+
type ImageContent,
|
|
78
|
+
type MessageContent,
|
|
79
|
+
type TextContent,
|
|
80
|
+
};
|