Skip to content

Commit 81cb6c3

Browse files
committed
group simple questions
1 parent a52ba9a commit 81cb6c3

File tree

1 file changed

+49
-24
lines changed

1 file changed

+49
-24
lines changed

questions/simple.ts

+49-24
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ModelConfig, TemplateFramework } from "../helpers/types";
1111
import { PureQuestionArgs, QuestionResults } from "./types";
1212
import { askPostInstallAction, questionHandlers } from "./utils";
1313

14-
type AppType =
14+
type UseCase =
1515
| "rag"
1616
| "code_artifact"
1717
| "financial_report_agent"
@@ -22,7 +22,7 @@ type AppType =
2222
| "blog";
2323

2424
type SimpleAnswers = {
25-
appType: AppType;
25+
useCase: UseCase;
2626
language: TemplateFramework;
2727
useLlamaCloud: boolean;
2828
llamaCloudKey?: string;
@@ -35,38 +35,63 @@ export const askSimpleQuestions = async (
3535
{
3636
type: "select",
3737
name: "appType",
38-
message: "What app do you want to build?",
38+
message: "What type of app do you want to build?",
3939
choices: [
40-
{ title: "Agentic RAG", value: "rag" },
41-
{ title: "Data Scientist", value: "data_scientist" },
4240
{
43-
title: "Financial Report Generator (using Workflows)",
44-
value: "financial_report_agent",
41+
title: "Agentic Document Workflows",
42+
value: "agentic_document_workflow",
4543
},
46-
{
47-
title: "Form Filler (using Workflows)",
48-
value: "form_filling",
49-
},
50-
{ title: "Code Artifact Agent", value: "code_artifact" },
51-
{ title: "Information Extractor", value: "extractor" },
52-
{
53-
title: "Contract Review (using Workflows)",
54-
value: "contract_review",
55-
},
56-
{ title: "Blog Writer (using Workflows)", value: "blog" },
44+
{ title: "Agents", value: "agents" },
5745
],
5846
},
5947
questionHandlers,
6048
);
6149

50+
let useCaseOptions: prompts.Choice[];
51+
52+
if (appType === "agents") {
53+
useCaseOptions = [
54+
{ title: "Simple RAG chat app", value: "rag" },
55+
{ title: "Data Scientist", value: "data_scientist" },
56+
{ title: "Code Artifact Agent", value: "code_artifact" },
57+
{ title: "Information Extractor", value: "extractor" },
58+
];
59+
} else {
60+
useCaseOptions = [
61+
{
62+
title: "Financial Report Generator",
63+
value: "financial_report_agent",
64+
},
65+
{
66+
title: "Financial 10k SEC Form Filler",
67+
value: "form_filling",
68+
},
69+
{
70+
title: "Contract Review",
71+
value: "contract_review",
72+
},
73+
{ title: "Blog Writer", value: "blog" },
74+
];
75+
}
76+
77+
const { useCase } = await prompts(
78+
{
79+
type: "select",
80+
name: "useCase",
81+
message: "What use case do you want to build?",
82+
choices: useCaseOptions,
83+
},
84+
questionHandlers,
85+
);
86+
6287
let language: TemplateFramework = "fastapi";
6388
let llamaCloudKey = args.llamaCloudKey;
6489
let useLlamaCloud = false;
6590

6691
if (
67-
appType !== "extractor" &&
68-
appType !== "contract_review" &&
69-
appType !== "blog"
92+
useCase !== "extractor" &&
93+
useCase !== "contract_review" &&
94+
useCase !== "blog"
7095
) {
7196
const { language: newLanguage } = await prompts(
7297
{
@@ -112,7 +137,7 @@ export const askSimpleQuestions = async (
112137
}
113138

114139
const results = await convertAnswers(args, {
115-
appType,
140+
useCase,
116141
language,
117142
useLlamaCloud,
118143
llamaCloudKey,
@@ -137,7 +162,7 @@ const convertAnswers = async (
137162
},
138163
};
139164
const lookup: Record<
140-
AppType,
165+
UseCase,
141166
Pick<
142167
QuestionResults,
143168
"template" | "tools" | "frontend" | "dataSources" | "useCase"
@@ -203,7 +228,7 @@ const convertAnswers = async (
203228
dataSources: [AI_REPORTS],
204229
},
205230
};
206-
const results = lookup[answers.appType];
231+
const results = lookup[answers.useCase];
207232
return {
208233
framework: answers.language,
209234
ui: "shadcn",

0 commit comments

Comments
 (0)