File tree Expand file tree Collapse file tree 6 files changed +28
-18
lines changed Expand file tree Collapse file tree 6 files changed +28
-18
lines changed Original file line number Diff line number Diff line change 1616 "dependencies" : {
1717 "@babel/runtime" : " ^7.27.6" ,
1818 "@lezer/highlight" : " ^1.2.1" ,
19- "@llamaindex/ui" : " ^1.0.3 " ,
19+ "@llamaindex/ui" : " ^2.1.1 " ,
2020 "@radix-ui/themes" : " ^3.2.1" ,
2121 "class-variance-authority" : " ^0.7.1" ,
2222 "clsx" : " ^2.1.1" ,
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import { MySchema } from "@/schemas/MySchema";
22import { ExtractedData } from "llama-cloud-services/beta/agent" ;
33import {
44 ApiClients ,
5- createWorkflowClient ,
6- createWorkflowConfig ,
5+ createWorkflowsClient ,
6+ createWorkflowsConfig ,
77} from "@llamaindex/ui" ;
88import { createCloudAgentClient , cloudApiClient } from "@llamaindex/ui" ;
99import { AGENT_NAME , EXTRACTED_DATA_COLLECTION } from "./config" ;
@@ -30,8 +30,8 @@ const agentClient = createCloudAgentClient<ExtractedData<MySchema>>({
3030 collection : EXTRACTED_DATA_COLLECTION ,
3131} ) ;
3232
33- const workflowsClient = createWorkflowClient (
34- createWorkflowConfig ( {
33+ const workflowsClient = createWorkflowsClient (
34+ createWorkflowsConfig ( {
3535 baseUrl : `/deployments/${ AGENT_NAME } /` ,
3636 } ) ,
3737) ;
Original file line number Diff line number Diff line change 33 WorkflowTrigger ,
44 WorkflowProgressBar ,
55 ExtractedDataItemGrid ,
6- useWorkflowTaskList ,
6+ useWorkflowHandlerList ,
77} from "@llamaindex/ui" ;
88import type { TypedAgentData } from "llama-cloud-services/beta/agent" ;
99import styles from "./HomePage.module.css" ;
@@ -20,8 +20,10 @@ export default function HomePage() {
2020 * Returns a key that increments when a task is completed, can be used to force a re-render of the task list
2121 */
2222function taskCompletedState ( ) {
23- const { tasks } = useWorkflowTaskList ( ) ;
24- const runningTasks = tasks . filter ( ( task ) => task . status === "running" ) ;
23+ const { handlers } = useWorkflowHandlerList ( "process-file" ) ;
24+ const runningTasks = handlers . filter (
25+ ( handler ) => handler . status === "running" ,
26+ ) ;
2527 const [ runningTaskCount , setRunningTaskCount ] = useState ( runningTasks . length ) ;
2628 const [ taskKey , setTaskKey ] = useState ( 0 ) ;
2729 useEffect ( ( ) => {
@@ -69,7 +71,10 @@ function TaskList() {
6971 } }
7072 />
7173 </ div >
72- < WorkflowProgressBar className = { styles . progressBar } />
74+ < WorkflowProgressBar
75+ className = { styles . progressBar }
76+ workflowName = "process-file"
77+ />
7378 < ExtractedDataItemGrid
7479 onRowClick = { goToItem }
7580 builtInColumns = { {
Original file line number Diff line number Diff line change 1616 "dependencies": {
1717 "@babel/runtime": "^7.27.6",
1818 "@lezer/highlight": "^1.2.1",
19- "@llamaindex/ui": "^1.0.3 ",
19+ "@llamaindex/ui": "^2.1.1 ",
2020 "@radix-ui/themes": "^3.2.1",
2121 "class-variance-authority": "^0.7.1",
2222 "clsx": "^2.1.1",
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import { MySchema } from "@/schemas/MySchema";
22import { ExtractedData } from "llama-cloud-services/beta/agent" ;
33import {
44 ApiClients ,
5- createWorkflowClient ,
6- createWorkflowConfig ,
5+ createWorkflowsClient ,
6+ createWorkflowsConfig ,
77} from "@llamaindex/ui" ;
88import { createCloudAgentClient , cloudApiClient } from "@llamaindex/ui" ;
99import { AGENT_NAME , EXTRACTED_DATA_COLLECTION } from "./config" ;
@@ -30,8 +30,8 @@ const agentClient = createCloudAgentClient<ExtractedData<MySchema>>({
3030 collection : EXTRACTED_DATA_COLLECTION ,
3131} ) ;
3232
33- const workflowsClient = createWorkflowClient (
34- createWorkflowConfig ( {
33+ const workflowsClient = createWorkflowsClient (
34+ createWorkflowsConfig ( {
3535 baseUrl : `/deployments/${ AGENT_NAME } /` ,
3636 } ) ,
3737) ;
Original file line number Diff line number Diff line change 33 WorkflowTrigger ,
44 WorkflowProgressBar ,
55 ExtractedDataItemGrid ,
6- useWorkflowTaskList ,
6+ useWorkflowHandlerList ,
77} from "@llamaindex/ui" ;
88import type { TypedAgentData } from "llama-cloud-services/beta/agent" ;
99import styles from "./HomePage.module.css" ;
@@ -20,8 +20,10 @@ export default function HomePage() {
2020 * Returns a key that increments when a task is completed, can be used to force a re-render of the task list
2121 */
2222function taskCompletedState ( ) {
23- const { tasks } = useWorkflowTaskList ( ) ;
24- const runningTasks = tasks . filter ( ( task ) => task . status === "running" ) ;
23+ const { handlers } = useWorkflowHandlerList ( "process-file" ) ;
24+ const runningTasks = handlers . filter (
25+ ( handler ) => handler . status === "running" ,
26+ ) ;
2527 const [ runningTaskCount , setRunningTaskCount ] = useState ( runningTasks . length ) ;
2628 const [ taskKey , setTaskKey ] = useState ( 0 ) ;
2729 useEffect ( ( ) => {
@@ -69,7 +71,10 @@ function TaskList() {
6971 } }
7072 />
7173 </ div >
72- < WorkflowProgressBar className = { styles . progressBar } />
74+ < WorkflowProgressBar
75+ className = { styles . progressBar }
76+ workflowName = "process-file"
77+ />
7378 < ExtractedDataItemGrid
7479 onRowClick = { goToItem }
7580 builtInColumns = { {
You can’t perform that action at this time.
0 commit comments