Skip to content

Commit d83d279

Browse files
zhaotaiadrianlyjak
andauthored
migrate (#36)
* migrate * jinjafy for the qualified name * update name * regenerate * upadte * remove unused code * fix lint * wip * fix better * fix format/gitignores --------- Co-authored-by: Adrian Lyjak <[email protected]>
1 parent b555eeb commit d83d279

File tree

14 files changed

+41
-36
lines changed

14 files changed

+41
-36
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ test-proj/ui/node_modules
77
test-proj/ui/pnpm-lock.yaml
88
ui/pnpm-lock.yaml
99
ui/package-lock.json
10-
test-proj/ui/package-lock.json
10+
test-proj/ui/package-lock.json
11+
workflows.db

.gitignore.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
22
__pycache__
3+
workflows.db

pyproject.toml.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Extracts data"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
8-
"llama-cloud-services>=0.6.57",
9-
"llama-index-workflows>=2.0.0,<3.0.0",
8+
"llama-cloud-services>=0.6.59",
9+
"llama-index-workflows>=2.2.0,<3.0.0",
1010
"python-dotenv>=1.1.0",
1111
"jsonref>=1.1.0",
1212
"click>=8.2.1",
@@ -24,7 +24,7 @@ dev = [
2424
"ty>=0.0.1a16",
2525
"pytest>=8.4.1",
2626
"hatch>=1.14.1",
27-
"llamactl>=0.3.0a9"
27+
"llamactl>=0.3.0"
2828
]
2929

3030
[build-system]

test-proj/.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: e8edd1d
2+
_commit: c778ba5
33
_src_path: .
44
project_name: test-proj
55
project_title: Test Proj

test-proj/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
22
__pycache__
3+
workflows.db

test-proj/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Extracts data"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
8-
"llama-cloud-services>=0.6.57",
9-
"llama-index-workflows>=2.0.0,<3.0.0",
8+
"llama-cloud-services>=0.6.59",
9+
"llama-index-workflows>=2.2.0,<3.0.0",
1010
"python-dotenv>=1.1.0",
1111
"jsonref>=1.1.0",
1212
"click>=8.2.1",
@@ -24,7 +24,7 @@ dev = [
2424
"ty>=0.0.1a16",
2525
"pytest>=8.4.1",
2626
"hatch>=1.14.1",
27-
"llamactl>=0.3.0a9"
27+
"llamactl>=0.3.0"
2828
]
2929

3030
[build-system]

test-proj/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"@babel/runtime": "^7.27.6",
1818
"@lezer/highlight": "^1.2.1",
19-
"@llamaindex/ui": "^0.5.7",
19+
"@llamaindex/ui": "^1.0.2",
2020
"@radix-ui/themes": "^3.2.1",
2121
"class-variance-authority": "^0.7.1",
2222
"clsx": "^2.1.1",

test-proj/ui/src/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { Link } from "react-router-dom";
1212
import { Toaster } from "@llamaindex/ui";
1313
import { useToolbar, ToolbarProvider } from "@/lib/ToolbarContext";
1414
import { clients } from "@/lib/client";
15-
import { AGENT_NAME } from "@/lib/config";
1615

1716
// Import pages
1817
import HomePage from "./pages/HomePage";
@@ -21,7 +20,7 @@ import ItemPage from "./pages/ItemPage";
2120
export default function App() {
2221
return (
2322
<Theme>
24-
<ApiProvider clients={clients} deployment={AGENT_NAME}>
23+
<ApiProvider clients={clients}>
2524
<ToolbarProvider>
2625
<div className="grid grid-rows-[auto_1fr] h-screen">
2726
<Toolbar />

test-proj/ui/src/lib/client.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { MySchema } from "@/schemas/MySchema";
22
import { ExtractedData } from "llama-cloud-services/beta/agent";
3-
import { ApiClients } from "@llamaindex/ui";
43
import {
5-
createCloudAgentClient,
6-
createLlamaDeployClient,
7-
createLlamaDeployConfig,
8-
cloudApiClient,
4+
ApiClients,
5+
createWorkflowClient,
6+
createWorkflowConfig,
97
} from "@llamaindex/ui";
10-
import { EXTRACTED_DATA_COLLECTION } from "./config";
8+
import { createCloudAgentClient, cloudApiClient } from "@llamaindex/ui";
9+
import { AGENT_NAME, EXTRACTED_DATA_COLLECTION } from "./config";
1110

1211
const platformToken = import.meta.env.VITE_LLAMA_CLOUD_API_KEY;
1312
const apiBaseUrl = import.meta.env.VITE_LLAMA_CLOUD_BASE_URL;
@@ -31,8 +30,14 @@ const agentClient = createCloudAgentClient<ExtractedData<MySchema>>({
3130
collection: EXTRACTED_DATA_COLLECTION,
3231
});
3332

33+
const workflowsClient = createWorkflowClient(
34+
createWorkflowConfig({
35+
baseUrl: `/deployments/${AGENT_NAME}/`,
36+
}),
37+
);
38+
3439
const clients: ApiClients = {
35-
llamaDeployClient: createLlamaDeployClient(createLlamaDeployConfig()),
40+
workflowsClient: workflowsClient,
3641
cloudApiClient: cloudApiClient,
3742
agentDataClient: agentClient,
3843
};

test-proj/ui/src/pages/HomePage.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { useNavigate } from "react-router-dom";
1111
import { agentClient } from "@/lib/client";
1212
import { useEffect, useState } from "react";
1313

14-
const deployment = import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME;
15-
1614
export default function HomePage() {
1715
const { taskKey } = taskCompletedState();
1816
return <TaskList key={taskKey} />;
@@ -63,8 +61,7 @@ function TaskList() {
6361
</div>
6462
<div className={styles.commandBar}>
6563
<WorkflowTrigger
66-
deployment={deployment}
67-
workflow="process-file"
64+
workflowName="process-file"
6865
customWorkflowInput={(files) => {
6966
return {
7067
file_id: files[0].fileId,

0 commit comments

Comments
 (0)