@fencyai/react 0.1.114 → 0.1.116

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.
@@ -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;
@@ -1,3 +1,4 @@
1
+ import { AgentTaskModel } from '@fencyai/js';
1
2
  export type CreateAgentTaskParams = {
2
3
  type: 'genericAgentTask';
3
4
  query: string;
@@ -8,4 +9,13 @@ export type CreateAgentTaskParams = {
8
9
  role: 'user' | 'assistant' | 'system';
9
10
  content: string;
10
11
  }[];
12
+ model: AgentTaskModel;
13
+ } | {
14
+ type: 'structuredChatCompletion';
15
+ messages: {
16
+ role: 'user' | 'assistant' | 'system';
17
+ content: string;
18
+ }[];
19
+ jsonSchema: string;
20
+ model: AgentTaskModel;
11
21
  };
@@ -12,6 +12,12 @@ export type CreateAgentTaskResponse = {
12
12
  role: 'user' | 'assistant' | 'system';
13
13
  content: string;
14
14
  }[];
15
+ } | {
16
+ type: 'StructuredChatCompletionCompleted';
17
+ messages: {
18
+ role: 'user' | 'assistant' | 'system';
19
+ content: any;
20
+ }[];
15
21
  };
16
22
  } | {
17
23
  type: 'error';
@@ -1,4 +1,4 @@
1
- import { AgentTaskEventData } from './AgentTaskEventData';
1
+ import { AgentTaskEventData } from '@fencyai/js';
2
2
  export type NewChatCompletionStreamChunk = {
3
3
  type: 'NewChatCompletionStreamChunk';
4
4
  streamId: string;
@@ -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) => Promise<CreateAgentTaskResponse>;
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.114",
3
+ "version": "0.1.116",
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.114",
38
+ "@fencyai/js": "^0.1.116",
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.114",
55
+ "@fencyai/js": "^0.1.116",
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": "2c936f3f33d9b1f4f0c0cc0ebc6fe7b30e824b3a"
70
+ "gitHead": "721924378799879a147e87ccf2a20924339bdde5"
71
71
  }
@@ -1,23 +0,0 @@
1
- export type AgentTaskEventData = {
2
- type: 'GenericAgentTaskFinalResponse';
3
- response: string;
4
- } | {
5
- type: 'GenericAgentTaskExecution';
6
- title: string;
7
- } | {
8
- type: 'GenericAgentTaskReasoning';
9
- title: string;
10
- reasoning: string;
11
- } | {
12
- type: 'GenericAgentTaskCompleted';
13
- response: string;
14
- } | {
15
- type: 'StreamingChatCompletionResponse';
16
- response: string;
17
- } | {
18
- type: 'StreamingChatCompletionCompleted';
19
- messages: {
20
- role: 'user' | 'assistant' | 'system';
21
- content: string;
22
- }[];
23
- };