File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ import { PureQuestionArgs, QuestionResults } from "./types";
6
6
import { askPostInstallAction , questionHandlers } from "./utils" ;
7
7
type AppType = "rag" | "code_artifact" | "multiagent" | "extractor" ;
8
8
9
+ // TODO: configure data sources
10
+
9
11
type SimpleAnswers = {
10
12
appType : AppType ;
11
13
language : TemplateFramework ;
12
14
useLlamaCloud : boolean ;
13
- llamaCloudKey : string ;
15
+ llamaCloudKey ? : string ;
14
16
modelConfig : ModelConfig ;
15
17
} ;
16
18
@@ -62,6 +64,21 @@ export const askSimpleQuestions = async (
62
64
questionHandlers ,
63
65
) ;
64
66
67
+ let llamaCloudKey = args . llamaCloudKey ;
68
+ if ( useLlamaCloud && ! llamaCloudKey ) {
69
+ // Ask for LlamaCloud API key, if not set
70
+ const { llamaCloudKey : newLlamaCloudKey } = await prompts (
71
+ {
72
+ type : "text" ,
73
+ name : "llamaCloudKey" ,
74
+ message :
75
+ "Please provide your LlamaCloud API key (leave blank to skip):" ,
76
+ } ,
77
+ questionHandlers ,
78
+ ) ;
79
+ llamaCloudKey = newLlamaCloudKey || process . env . LLAMA_CLOUD_API_KEY ;
80
+ }
81
+
65
82
const modelConfig = await askModelConfig ( {
66
83
openAiKey : args . openAiKey ,
67
84
askModels : args . askModels ?? false ,
@@ -72,7 +89,7 @@ export const askSimpleQuestions = async (
72
89
appType,
73
90
language,
74
91
useLlamaCloud,
75
- llamaCloudKey : process . env . LLAMA_CLOUD_API_KEY || "" ,
92
+ llamaCloudKey,
76
93
modelConfig,
77
94
} ) ;
78
95
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export type PureQuestionArgs = {
9
9
askModels ?: boolean ;
10
10
pro ?: boolean ;
11
11
openAiKey ?: string ;
12
+ llamaCloudKey ?: string ;
12
13
} ;
13
14
14
15
export type QuestionArgs = QuestionResults & PureQuestionArgs ;
You can’t perform that action at this time.
0 commit comments