99 TemplateDataSource ,
1010 TemplateDataSourceType ,
1111 TemplateFramework ,
12+ TemplateType ,
1213} from "./helpers" ;
1314import { COMMUNITY_OWNER , COMMUNITY_REPO } from "./helpers/constant" ;
1415import { EXAMPLE_FILE } from "./helpers/datasources" ;
@@ -122,6 +123,7 @@ const getVectorDbChoices = (framework: TemplateFramework) => {
122123export const getDataSourceChoices = (
123124 framework : TemplateFramework ,
124125 selectedDataSource : TemplateDataSource [ ] ,
126+ template ?: TemplateType ,
125127) => {
126128 // If LlamaCloud is already selected, don't show any other options
127129 if ( selectedDataSource . find ( ( s ) => s . type === "llamacloud" ) ) {
@@ -137,10 +139,12 @@ export const getDataSourceChoices = (
137139 } ) ;
138140 }
139141 if ( selectedDataSource === undefined || selectedDataSource . length === 0 ) {
140- choices . push ( {
141- title : "No data, just a simple chat or agent" ,
142- value : "none" ,
143- } ) ;
142+ if ( template !== "multiagent" ) {
143+ choices . push ( {
144+ title : "No data, just a simple chat or agent" ,
145+ value : "none" ,
146+ } ) ;
147+ }
144148 choices . push ( {
145149 title :
146150 process . platform !== "linux"
@@ -281,25 +285,27 @@ export const askQuestions = async (
281285 } ,
282286 ] ;
283287
284- const modelConfigured =
285- ! program . llamapack && program . modelConfig . isConfigured ( ) ;
286- // If using LlamaParse, require LlamaCloud API key
287- const llamaCloudKeyConfigured = program . useLlamaParse
288- ? program . llamaCloudKey || process . env [ "LLAMA_CLOUD_API_KEY" ]
289- : true ;
290- const hasVectorDb = program . vectorDb && program . vectorDb !== "none" ;
291- // Can run the app if all tools do not require configuration
292- if (
293- ! hasVectorDb &&
294- modelConfigured &&
295- llamaCloudKeyConfigured &&
296- ! toolsRequireConfig ( program . tools )
297- ) {
298- actionChoices . push ( {
299- title :
300- "Generate code, install dependencies, and run the app (~2 min)" ,
301- value : "runApp" ,
302- } ) ;
288+ if ( program . template !== "multiagent" ) {
289+ const modelConfigured =
290+ ! program . llamapack && program . modelConfig . isConfigured ( ) ;
291+ // If using LlamaParse, require LlamaCloud API key
292+ const llamaCloudKeyConfigured = program . useLlamaParse
293+ ? program . llamaCloudKey || process . env [ "LLAMA_CLOUD_API_KEY" ]
294+ : true ;
295+ const hasVectorDb = program . vectorDb && program . vectorDb !== "none" ;
296+ // Can run the app if all tools do not require configuration
297+ if (
298+ ! hasVectorDb &&
299+ modelConfigured &&
300+ llamaCloudKeyConfigured &&
301+ ! toolsRequireConfig ( program . tools )
302+ ) {
303+ actionChoices . push ( {
304+ title :
305+ "Generate code, install dependencies, and run the app (~2 min)" ,
306+ value : "runApp" ,
307+ } ) ;
308+ }
303309 }
304310
305311 const { action } = await prompts (
@@ -331,7 +337,11 @@ export const askQuestions = async (
331337 name : "template" ,
332338 message : "Which template would you like to use?" ,
333339 choices : [
334- { title : "Chat" , value : "streaming" } ,
340+ { title : "Agentic RAG (single agent)" , value : "streaming" } ,
341+ {
342+ title : "Multi-agent app (using llama-agents)" ,
343+ value : "multiagent" ,
344+ } ,
335345 {
336346 title : `Community template from ${ styledRepo } ` ,
337347 value : "community" ,
@@ -395,6 +405,10 @@ export const askQuestions = async (
395405 return ; // early return - no further questions needed for llamapack projects
396406 }
397407
408+ if ( program . template === "multiagent" ) {
409+ // TODO: multi-agents currently only supports FastAPI
410+ program . framework = preferences . framework = "fastapi" ;
411+ }
398412 if ( ! program . framework ) {
399413 if ( ciInfo . isCI ) {
400414 program . framework = getPrefOrDefault ( "framework" ) ;
@@ -420,7 +434,10 @@ export const askQuestions = async (
420434 }
421435 }
422436
423- if ( program . framework === "express" || program . framework === "fastapi" ) {
437+ if (
438+ ( program . framework === "express" || program . framework === "fastapi" ) &&
439+ program . template === "streaming"
440+ ) {
424441 // if a backend-only framework is selected, ask whether we should create a frontend
425442 if ( program . frontend === undefined ) {
426443 if ( ciInfo . isCI ) {
@@ -457,7 +474,7 @@ export const askQuestions = async (
457474 }
458475 }
459476
460- if ( ! program . observability ) {
477+ if ( ! program . observability && program . template === "streaming" ) {
461478 if ( ciInfo . isCI ) {
462479 program . observability = getPrefOrDefault ( "observability" ) ;
463480 } else {
@@ -501,6 +518,7 @@ export const askQuestions = async (
501518 const choices = getDataSourceChoices (
502519 program . framework ,
503520 program . dataSources ,
521+ program . template ,
504522 ) ;
505523 if ( choices . length === 0 ) break ;
506524 const { selectedSource } = await prompts (
@@ -695,7 +713,8 @@ export const askQuestions = async (
695713 }
696714 }
697715
698- if ( ! program . tools ) {
716+ if ( ! program . tools && program . template === "streaming" ) {
717+ // TODO: allow to select tools also for multi-agent framework
699718 if ( ciInfo . isCI ) {
700719 program . tools = getPrefOrDefault ( "tools" ) ;
701720 } else {
0 commit comments