Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ test-proj/ui/node_modules
test-proj/ui/pnpm-lock.yaml
ui/pnpm-lock.yaml
ui/package-lock.json
test-proj/ui/package-lock.json
test-proj/ui/package-lock.json
workflows.db
1 change: 1 addition & 0 deletions .gitignore.jinja
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
__pycache__
workflows.db
6 changes: 3 additions & 3 deletions pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ description = "Extracts data"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"llama-cloud-services>=0.6.57",
"llama-index-workflows>=2.0.0,<3.0.0",
"llama-cloud-services>=0.6.59",
"llama-index-workflows>=2.2.0,<3.0.0",
"python-dotenv>=1.1.0",
"jsonref>=1.1.0",
"click>=8.2.1",
Expand All @@ -24,7 +24,7 @@ dev = [
"ty>=0.0.1a16",
"pytest>=8.4.1",
"hatch>=1.14.1",
"llamactl>=0.3.0a9"
"llamactl>=0.3.0"
]

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion test-proj/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: e8edd1d
_commit: c778ba5
_src_path: .
project_name: test-proj
project_title: Test Proj
1 change: 1 addition & 0 deletions test-proj/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
__pycache__
workflows.db
6 changes: 3 additions & 3 deletions test-proj/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ description = "Extracts data"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"llama-cloud-services>=0.6.57",
"llama-index-workflows>=2.0.0,<3.0.0",
"llama-cloud-services>=0.6.59",
"llama-index-workflows>=2.2.0,<3.0.0",
"python-dotenv>=1.1.0",
"jsonref>=1.1.0",
"click>=8.2.1",
Expand All @@ -24,7 +24,7 @@ dev = [
"ty>=0.0.1a16",
"pytest>=8.4.1",
"hatch>=1.14.1",
"llamactl>=0.3.0a9"
"llamactl>=0.3.0"
]

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion test-proj/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@babel/runtime": "^7.27.6",
"@lezer/highlight": "^1.2.1",
"@llamaindex/ui": "^0.5.7",
"@llamaindex/ui": "^1.0.2",
"@radix-ui/themes": "^3.2.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand Down
3 changes: 1 addition & 2 deletions test-proj/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Link } from "react-router-dom";
import { Toaster } from "@llamaindex/ui";
import { useToolbar, ToolbarProvider } from "@/lib/ToolbarContext";
import { clients } from "@/lib/client";
import { AGENT_NAME } from "@/lib/config";

// Import pages
import HomePage from "./pages/HomePage";
Expand All @@ -21,7 +20,7 @@ import ItemPage from "./pages/ItemPage";
export default function App() {
return (
<Theme>
<ApiProvider clients={clients} deployment={AGENT_NAME}>
<ApiProvider clients={clients}>
<ToolbarProvider>
<div className="grid grid-rows-[auto_1fr] h-screen">
<Toolbar />
Expand Down
19 changes: 12 additions & 7 deletions test-proj/ui/src/lib/client.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { MySchema } from "@/schemas/MySchema";
import { ExtractedData } from "llama-cloud-services/beta/agent";
import { ApiClients } from "@llamaindex/ui";
import {
createCloudAgentClient,
createLlamaDeployClient,
createLlamaDeployConfig,
cloudApiClient,
ApiClients,
createWorkflowClient,
createWorkflowConfig,
} from "@llamaindex/ui";
import { EXTRACTED_DATA_COLLECTION } from "./config";
import { createCloudAgentClient, cloudApiClient } from "@llamaindex/ui";
import { AGENT_NAME, EXTRACTED_DATA_COLLECTION } from "./config";

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

const workflowsClient = createWorkflowClient(
createWorkflowConfig({
baseUrl: `/deployments/${AGENT_NAME}/`,
}),
);

const clients: ApiClients = {
llamaDeployClient: createLlamaDeployClient(createLlamaDeployConfig()),
workflowsClient: workflowsClient,
cloudApiClient: cloudApiClient,
agentDataClient: agentClient,
};
Expand Down
5 changes: 1 addition & 4 deletions test-proj/ui/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { useNavigate } from "react-router-dom";
import { agentClient } from "@/lib/client";
import { useEffect, useState } from "react";

const deployment = import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME;

export default function HomePage() {
const { taskKey } = taskCompletedState();
return <TaskList key={taskKey} />;
Expand Down Expand Up @@ -63,8 +61,7 @@ function TaskList() {
</div>
<div className={styles.commandBar}>
<WorkflowTrigger
deployment={deployment}
workflow="process-file"
workflowName="process-file"
customWorkflowInput={(files) => {
return {
file_id: files[0].fileId,
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@babel/runtime": "^7.27.6",
"@lezer/highlight": "^1.2.1",
"@llamaindex/ui": "^0.5.7",
"@llamaindex/ui": "^1.0.2",
"@radix-ui/themes": "^3.2.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand Down
3 changes: 1 addition & 2 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { Link } from "react-router-dom";
import { Toaster } from "@llamaindex/ui";
import { useToolbar, ToolbarProvider } from "@/lib/ToolbarContext";
import { clients } from "@/lib/client";
import { AGENT_NAME } from "@/lib/config";

// Import pages
import HomePage from "./pages/HomePage";
Expand All @@ -21,7 +20,7 @@ import ItemPage from "./pages/ItemPage";
export default function App() {
return (
<Theme>
<ApiProvider clients={clients} deployment={AGENT_NAME}>
<ApiProvider clients={clients}>
<ToolbarProvider>
<div className="grid grid-rows-[auto_1fr] h-screen">
<Toolbar />
Expand Down
19 changes: 12 additions & 7 deletions ui/src/lib/client.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { MySchema } from "@/schemas/MySchema";
import { ExtractedData } from "llama-cloud-services/beta/agent";
import { ApiClients } from "@llamaindex/ui";
import {
createCloudAgentClient,
createLlamaDeployClient,
createLlamaDeployConfig,
cloudApiClient,
ApiClients,
createWorkflowClient,
createWorkflowConfig,
} from "@llamaindex/ui";
import { EXTRACTED_DATA_COLLECTION } from "./config";
import { createCloudAgentClient, cloudApiClient } from "@llamaindex/ui";
import { AGENT_NAME, EXTRACTED_DATA_COLLECTION } from "./config";

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

const workflowsClient = createWorkflowClient(
createWorkflowConfig({
baseUrl: `/deployments/${AGENT_NAME}/`,
}),
);

const clients: ApiClients = {
llamaDeployClient: createLlamaDeployClient(createLlamaDeployConfig()),
workflowsClient: workflowsClient,
cloudApiClient: cloudApiClient,
agentDataClient: agentClient,
};
Expand Down
5 changes: 1 addition & 4 deletions ui/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { useNavigate } from "react-router-dom";
import { agentClient } from "@/lib/client";
import { useEffect, useState } from "react";

const deployment = import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME;

export default function HomePage() {
const { taskKey } = taskCompletedState();
return <TaskList key={taskKey} />;
Expand Down Expand Up @@ -63,8 +61,7 @@ function TaskList() {
</div>
<div className={styles.commandBar}>
<WorkflowTrigger
deployment={deployment}
workflow="process-file"
workflowName="process-file"
customWorkflowInput={(files) => {
return {
file_id: files[0].fileId,
Expand Down