mirror of
https://github.com/run-llama/template-workflow-document-qa.git
synced 2026-06-30 21:47:58 -04:00
Terry/qa template (#2)
* fix * fix * change readme * update readme * chore: pass empty filter to hatch run * chore: pin click 8.1.7 for hatch * chore: remove hatch filter now that click is pinned * fix: ensure dotenv import precedes client import
This commit is contained in:
@@ -62,8 +62,7 @@ jobs:
|
||||
- name: Activate pnpm version
|
||||
working-directory: test-proj/ui
|
||||
run: corepack prepare --activate
|
||||
|
||||
|
||||
- name: Run UI checks
|
||||
run: pnpm run all-check
|
||||
working-directory: test-proj/ui
|
||||
working-directory: test-proj/ui
|
||||
|
||||
@@ -9,8 +9,6 @@ This application uses LlamaDeploy. For more information see [the docs](https://d
|
||||
|
||||
1. install `uv` if you haven't `brew install uv`
|
||||
2. run `uvx llamactl serve`
|
||||
3. Visit http://localhost:4501/docs and see workflow APIs
|
||||
|
||||
|
||||
# Organization
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"click==8.1.7",
|
||||
"hatch>=1.14.1",
|
||||
"pytest>=8.4.2",
|
||||
"ruff>=0.13.0",
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import logging
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import httpx
|
||||
from dotenv import load_dotenv
|
||||
from llama_cloud.types import RetrievalMode
|
||||
import tempfile
|
||||
from llama_index.core import Settings
|
||||
from llama_index.core.chat_engine.types import BaseChatEngine, ChatMode
|
||||
from llama_index.core.memory import ChatMemoryBuffer
|
||||
from llama_index.embeddings.openai import OpenAIEmbedding
|
||||
from llama_index.llms.openai import OpenAI
|
||||
from llama_cloud_services import LlamaCloudIndex
|
||||
from workflows import Workflow, step, Context
|
||||
from workflows.events import (
|
||||
StartEvent,
|
||||
@@ -15,12 +21,6 @@ from workflows.events import (
|
||||
)
|
||||
from workflows.retry_policy import ConstantDelayRetryPolicy
|
||||
|
||||
from llama_cloud_services import LlamaCloudIndex
|
||||
from llama_index.core import Settings
|
||||
from llama_index.llms.openai import OpenAI
|
||||
from llama_index.embeddings.openai import OpenAIEmbedding
|
||||
from llama_index.core.memory import ChatMemoryBuffer
|
||||
|
||||
from .clients import (
|
||||
LLAMA_CLOUD_API_KEY,
|
||||
LLAMA_CLOUD_BASE_URL,
|
||||
@@ -30,6 +30,8 @@ from .clients import (
|
||||
LLAMA_CLOUD_PROJECT_ID,
|
||||
)
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
||||
_commit: '2405947'
|
||||
_commit: c9f43f6
|
||||
_src_path: .
|
||||
llama_org_id: asdf
|
||||
llama_project_id: asdf
|
||||
project_name: test-proj
|
||||
project_title: Test Proj
|
||||
|
||||
@@ -9,8 +9,6 @@ This application uses LlamaDeploy. For more information see [the docs](https://d
|
||||
|
||||
1. install `uv` if you haven't `brew install uv`
|
||||
2. run `uvx llamactl serve`
|
||||
3. Visit http://localhost:4501/docs and see workflow APIs
|
||||
|
||||
|
||||
# Organization
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"click==8.1.7",
|
||||
"hatch>=1.14.1",
|
||||
"pytest>=8.4.2",
|
||||
"ruff>=0.13.0",
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import logging
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import httpx
|
||||
from dotenv import load_dotenv
|
||||
from llama_cloud.types import RetrievalMode
|
||||
import tempfile
|
||||
from llama_index.core import Settings
|
||||
from llama_index.core.chat_engine.types import BaseChatEngine, ChatMode
|
||||
from llama_index.core.memory import ChatMemoryBuffer
|
||||
from llama_index.embeddings.openai import OpenAIEmbedding
|
||||
from llama_index.llms.openai import OpenAI
|
||||
from llama_cloud_services import LlamaCloudIndex
|
||||
from workflows import Workflow, step, Context
|
||||
from workflows.events import (
|
||||
StartEvent,
|
||||
@@ -15,12 +21,6 @@ from workflows.events import (
|
||||
)
|
||||
from workflows.retry_policy import ConstantDelayRetryPolicy
|
||||
|
||||
from llama_cloud_services import LlamaCloudIndex
|
||||
from llama_index.core import Settings
|
||||
from llama_index.llms.openai import OpenAI
|
||||
from llama_index.embeddings.openai import OpenAIEmbedding
|
||||
from llama_index.core.memory import ChatMemoryBuffer
|
||||
|
||||
from .clients import (
|
||||
LLAMA_CLOUD_API_KEY,
|
||||
LLAMA_CLOUD_BASE_URL,
|
||||
@@ -30,6 +30,8 @@ from .clients import (
|
||||
LLAMA_CLOUD_PROJECT_ID,
|
||||
)
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export const APP_TITLE = "Test Proj";
|
||||
export const AGENT_NAME = import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME;
|
||||
export const INDEX_NAME = "document_qa_index";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ChatBot from "../components/ChatBot";
|
||||
import { WorkflowTrigger } from "@llamaindex/ui";
|
||||
import { APP_TITLE } from "../libs/config";
|
||||
import { APP_TITLE, INDEX_NAME } from "../libs/config";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
@@ -20,18 +20,10 @@ export default function Home() {
|
||||
<div className="flex mb-4">
|
||||
<WorkflowTrigger
|
||||
workflowName="upload"
|
||||
inputFields={[
|
||||
{
|
||||
key: "index_name",
|
||||
label: "Index Name",
|
||||
placeholder: "e.g. document_qa_index",
|
||||
required: true,
|
||||
},
|
||||
]}
|
||||
customWorkflowInput={(files, fieldValues) => {
|
||||
return {
|
||||
file_id: files[0].fileId,
|
||||
index_name: fieldValues.index_name,
|
||||
index_name: INDEX_NAME,
|
||||
};
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export const APP_TITLE = "Test Project";
|
||||
export const AGENT_NAME = import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME;
|
||||
export const INDEX_NAME = "document_qa_index";
|
||||
@@ -1,2 +1,3 @@
|
||||
export const APP_TITLE = "{{ project_title }}";
|
||||
export const AGENT_NAME = import.meta.env.VITE_LLAMA_DEPLOY_DEPLOYMENT_NAME;
|
||||
export const INDEX_NAME = "document_qa_index";
|
||||
|
||||
+2
-10
@@ -1,6 +1,6 @@
|
||||
import ChatBot from "../components/ChatBot";
|
||||
import { WorkflowTrigger } from "@llamaindex/ui";
|
||||
import { APP_TITLE } from "../libs/config";
|
||||
import { APP_TITLE, INDEX_NAME } from "../libs/config";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
@@ -20,18 +20,10 @@ export default function Home() {
|
||||
<div className="flex mb-4">
|
||||
<WorkflowTrigger
|
||||
workflowName="upload"
|
||||
inputFields={[
|
||||
{
|
||||
key: "index_name",
|
||||
label: "Index Name",
|
||||
placeholder: "e.g. document_qa_index",
|
||||
required: true,
|
||||
},
|
||||
]}
|
||||
customWorkflowInput={(files, fieldValues) => {
|
||||
return {
|
||||
file_id: files[0].fileId,
|
||||
index_name: fieldValues.index_name,
|
||||
index_name: INDEX_NAME,
|
||||
};
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user