@fencyai/react 0.1.113 → 0.1.115
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/agent-task/AgentTaskProgressVerbose.d.ts +1 -0
- package/dist/agent-task/data-types/StructuredChatCompletionResponse.d.ts +8 -0
- package/dist/index.js +479 -416
- package/dist/types/AgentTask.d.ts +2 -0
- package/dist/types/AgentTaskEventData.d.ts +18 -0
- package/dist/types/CreateAgentTaskParams.d.ts +11 -1
- package/dist/types/CreateAgentTaskResponse.d.ts +16 -0
- package/dist/types/UseAgentTasks.d.ts +3 -1
- package/dist/types/UseAgentTasksProps.d.ts +1 -1
- package/package.json +4 -4
|
@@ -2,6 +2,7 @@ import { ApiError } from '@fencyai/js';
|
|
|
2
2
|
import { CreateAgentTaskParams } from './CreateAgentTaskParams';
|
|
3
3
|
import { AgentTaskProgressItemUpdated } from './StreamData';
|
|
4
4
|
export interface AgentTask {
|
|
5
|
+
taskKey: string;
|
|
5
6
|
streamId: string;
|
|
6
7
|
triggeredAt: string;
|
|
7
8
|
error: ApiError | null;
|
|
@@ -9,6 +10,7 @@ export interface AgentTask {
|
|
|
9
10
|
progressItems: AgentTaskProgressItemUpdated[];
|
|
10
11
|
loading: boolean;
|
|
11
12
|
doneStreaming: boolean;
|
|
13
|
+
loadingText?: string;
|
|
12
14
|
confirmedData: {
|
|
13
15
|
taskId: string;
|
|
14
16
|
createdAt: string;
|
|
@@ -8,7 +8,25 @@ export type AgentTaskEventData = {
|
|
|
8
8
|
type: 'GenericAgentTaskReasoning';
|
|
9
9
|
title: string;
|
|
10
10
|
reasoning: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'GenericAgentTaskCompleted';
|
|
13
|
+
response: string;
|
|
11
14
|
} | {
|
|
12
15
|
type: 'StreamingChatCompletionResponse';
|
|
13
16
|
response: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'StructuredChatCompletionResponse';
|
|
19
|
+
response: any;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'StreamingChatCompletionCompleted';
|
|
22
|
+
messages: {
|
|
23
|
+
role: 'user' | 'assistant' | 'system';
|
|
24
|
+
content: string;
|
|
25
|
+
}[];
|
|
26
|
+
} | {
|
|
27
|
+
type: 'StructuredChatCompletionCompleted';
|
|
28
|
+
messages: {
|
|
29
|
+
role: 'user' | 'assistant' | 'system';
|
|
30
|
+
content: any;
|
|
31
|
+
}[];
|
|
14
32
|
};
|
|
@@ -4,5 +4,15 @@ export type CreateAgentTaskParams = {
|
|
|
4
4
|
jsonSchema?: string;
|
|
5
5
|
} | {
|
|
6
6
|
type: 'streamingChatCompletion';
|
|
7
|
-
|
|
7
|
+
messages: {
|
|
8
|
+
role: 'user' | 'assistant' | 'system';
|
|
9
|
+
content: string;
|
|
10
|
+
}[];
|
|
11
|
+
} | {
|
|
12
|
+
type: 'structuredChatCompletion';
|
|
13
|
+
messages: {
|
|
14
|
+
role: 'user' | 'assistant' | 'system';
|
|
15
|
+
content: string;
|
|
16
|
+
}[];
|
|
17
|
+
jsonSchema: string;
|
|
8
18
|
};
|
|
@@ -3,6 +3,22 @@ export type CreateAgentTaskResponse = {
|
|
|
3
3
|
type: 'success';
|
|
4
4
|
streamId: string;
|
|
5
5
|
agentTaskId: string;
|
|
6
|
+
response: {
|
|
7
|
+
type: 'GenericAgentTaskCompleted';
|
|
8
|
+
response: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'StreamingChatCompletionCompleted';
|
|
11
|
+
messages: {
|
|
12
|
+
role: 'user' | 'assistant' | 'system';
|
|
13
|
+
content: string;
|
|
14
|
+
}[];
|
|
15
|
+
} | {
|
|
16
|
+
type: 'StructuredChatCompletionCompleted';
|
|
17
|
+
messages: {
|
|
18
|
+
role: 'user' | 'assistant' | 'system';
|
|
19
|
+
content: any;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
6
22
|
} | {
|
|
7
23
|
type: 'error';
|
|
8
24
|
error: ApiError;
|
|
@@ -3,6 +3,8 @@ import { CreateAgentTaskResponse } from './CreateAgentTaskResponse';
|
|
|
3
3
|
import { AgentTask } from './AgentTask';
|
|
4
4
|
export interface UseAgentTasks {
|
|
5
5
|
agentTasks: AgentTask[];
|
|
6
|
-
createAgentTask: (params: CreateAgentTaskParams
|
|
6
|
+
createAgentTask: (params: CreateAgentTaskParams, options?: {
|
|
7
|
+
loadingText?: string;
|
|
8
|
+
}) => Promise<CreateAgentTaskResponse>;
|
|
7
9
|
latest?: AgentTask;
|
|
8
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentTaskProgressItemUpdated, StreamNotFound, StreamTimeout } from './StreamData';
|
|
2
2
|
import { StreamError } from './StreamError';
|
|
3
3
|
export interface UseAgentTasksProps {
|
|
4
|
-
fetchCreateAgentTaskClientToken: (taskType: 'genericAgentTask' | 'streamingChatCompletion') => Promise<{
|
|
4
|
+
fetchCreateAgentTaskClientToken: (taskType: 'genericAgentTask' | 'streamingChatCompletion' | 'structuredChatCompletion') => Promise<{
|
|
5
5
|
clientToken: string;
|
|
6
6
|
}>;
|
|
7
7
|
onAgentTaskProgressItemUpdated?: (streamData: AgentTaskProgressItemUpdated) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.115",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@microsoft/fetch-event-source": "^2.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@fencyai/js": "^0.1.
|
|
38
|
+
"@fencyai/js": "^0.1.115",
|
|
39
39
|
"@testing-library/react": "^16.3.2",
|
|
40
40
|
"@types/jest": "^29.5.11",
|
|
41
41
|
"@types/node": "^20.10.5",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@emotion/is-prop-valid": "^1.3.0",
|
|
55
|
-
"@fencyai/js": "^0.1.
|
|
55
|
+
"@fencyai/js": "^0.1.115",
|
|
56
56
|
"@radix-ui/react-popover": "^1.1.15",
|
|
57
57
|
"motion": "^11.15.0",
|
|
58
58
|
"react": ">=16.8.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"optional": false
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "02edc2f3154cc93bfad70ac2df52104f1668ddd5"
|
|
71
71
|
}
|