@@ -18,7 +18,6 @@ type SimpleAnswers = {
18
18
language : TemplateFramework ;
19
19
useLlamaCloud : boolean ;
20
20
llamaCloudKey ?: string ;
21
- modelConfig : ModelConfig ;
22
21
} ;
23
22
24
23
export const askSimpleQuestions = async (
@@ -87,28 +86,36 @@ export const askSimpleQuestions = async (
87
86
}
88
87
}
89
88
90
- const modelConfig = await askModelConfig ( {
91
- openAiKey : args . openAiKey ,
92
- askModels : args . askModels ?? false ,
93
- framework : language ,
94
- } ) ;
95
-
96
- const results = convertAnswers ( {
89
+ const results = await convertAnswers ( args , {
97
90
appType,
98
91
language,
99
92
useLlamaCloud,
100
93
llamaCloudKey,
101
- modelConfig,
102
94
} ) ;
103
95
104
96
results . postInstallAction = await askPostInstallAction ( results ) ;
105
97
return results ;
106
98
} ;
107
99
108
- const convertAnswers = ( answers : SimpleAnswers ) : QuestionResults => {
100
+ const convertAnswers = async (
101
+ args : PureQuestionArgs ,
102
+ answers : SimpleAnswers ,
103
+ ) : Promise < QuestionResults > => {
104
+ const MODEL_GPT4o : ModelConfig = {
105
+ provider : "openai" ,
106
+ apiKey : args . openAiKey ,
107
+ model : "gpt-4o" ,
108
+ embeddingModel : "text-embedding-3-large" ,
109
+ dimensions : 1536 ,
110
+ isConfigured ( ) : boolean {
111
+ return ! ! args . openAiKey ;
112
+ } ,
113
+ } ;
109
114
const lookup : Record <
110
115
AppType ,
111
- Pick < QuestionResults , "template" | "tools" | "frontend" | "dataSources" >
116
+ Pick < QuestionResults , "template" | "tools" | "frontend" | "dataSources" > & {
117
+ modelConfig ?: ModelConfig ;
118
+ }
112
119
> = {
113
120
rag : {
114
121
template : "streaming" ,
@@ -121,12 +128,14 @@ const convertAnswers = (answers: SimpleAnswers): QuestionResults => {
121
128
tools : getTools ( [ "interpreter" , "document_generator" ] ) ,
122
129
frontend : true ,
123
130
dataSources : [ ] ,
131
+ modelConfig : MODEL_GPT4o ,
124
132
} ,
125
133
code_artifact : {
126
134
template : "streaming" ,
127
135
tools : getTools ( [ "artifact" ] ) ,
128
136
frontend : true ,
129
137
dataSources : [ ] ,
138
+ modelConfig : MODEL_GPT4o ,
130
139
} ,
131
140
multiagent : {
132
141
template : "multiagent" ,
@@ -153,11 +162,16 @@ const convertAnswers = (answers: SimpleAnswers): QuestionResults => {
153
162
llamaCloudKey : answers . llamaCloudKey ,
154
163
useLlamaParse : answers . useLlamaCloud ,
155
164
llamapack : "" ,
156
- postInstallAction : "none" ,
157
165
vectorDb : answers . useLlamaCloud ? "llamacloud" : "none" ,
158
- modelConfig : answers . modelConfig ,
159
166
observability : "none" ,
160
167
...results ,
168
+ modelConfig :
169
+ results . modelConfig ??
170
+ ( await askModelConfig ( {
171
+ openAiKey : args . openAiKey ,
172
+ askModels : args . askModels ?? false ,
173
+ framework : answers . language ,
174
+ } ) ) ,
161
175
frontend : answers . language === "nextjs" ? false : results . frontend ,
162
176
} ;
163
177
} ;
0 commit comments