Skip to content

Commit 3b91e7b

Browse files
use GPT4o model for data scientist and code artifact
1 parent 7d9dee2 commit 3b91e7b

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

questions/simple.ts

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ type SimpleAnswers = {
1818
language: TemplateFramework;
1919
useLlamaCloud: boolean;
2020
llamaCloudKey?: string;
21-
modelConfig: ModelConfig;
2221
};
2322

2423
export const askSimpleQuestions = async (
@@ -87,28 +86,36 @@ export const askSimpleQuestions = async (
8786
}
8887
}
8988

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, {
9790
appType,
9891
language,
9992
useLlamaCloud,
10093
llamaCloudKey,
101-
modelConfig,
10294
});
10395

10496
results.postInstallAction = await askPostInstallAction(results);
10597
return results;
10698
};
10799

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+
};
109114
const lookup: Record<
110115
AppType,
111-
Pick<QuestionResults, "template" | "tools" | "frontend" | "dataSources">
116+
Pick<QuestionResults, "template" | "tools" | "frontend" | "dataSources"> & {
117+
modelConfig?: ModelConfig;
118+
}
112119
> = {
113120
rag: {
114121
template: "streaming",
@@ -121,12 +128,14 @@ const convertAnswers = (answers: SimpleAnswers): QuestionResults => {
121128
tools: getTools(["interpreter", "document_generator"]),
122129
frontend: true,
123130
dataSources: [],
131+
modelConfig: MODEL_GPT4o,
124132
},
125133
code_artifact: {
126134
template: "streaming",
127135
tools: getTools(["artifact"]),
128136
frontend: true,
129137
dataSources: [],
138+
modelConfig: MODEL_GPT4o,
130139
},
131140
multiagent: {
132141
template: "multiagent",
@@ -153,11 +162,16 @@ const convertAnswers = (answers: SimpleAnswers): QuestionResults => {
153162
llamaCloudKey: answers.llamaCloudKey,
154163
useLlamaParse: answers.useLlamaCloud,
155164
llamapack: "",
156-
postInstallAction: "none",
157165
vectorDb: answers.useLlamaCloud ? "llamacloud" : "none",
158-
modelConfig: answers.modelConfig,
159166
observability: "none",
160167
...results,
168+
modelConfig:
169+
results.modelConfig ??
170+
(await askModelConfig({
171+
openAiKey: args.openAiKey,
172+
askModels: args.askModels ?? false,
173+
framework: answers.language,
174+
})),
161175
frontend: answers.language === "nextjs" ? false : results.frontend,
162176
};
163177
};

0 commit comments

Comments
 (0)