Skip to content

Commit 8431b78

Browse files
authored
feat: Add form filling use case for TS and optimize workflows (#417)
1 parent 2b712ce commit 8431b78

File tree

32 files changed

+2012
-901
lines changed

32 files changed

+2012
-901
lines changed

.changeset/metal-cherries-sin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-llama": patch
3+
---
4+
5+
Optimize Typescript multi-agent code

.changeset/serious-suits-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-llama": patch
3+
---
4+
5+
Add form filling use case (Typescript)

e2e/shared/multiagent_template.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ for (const agents of templateAgents) {
2626
process.platform !== "linux" || process.env.DATASOURCE === "--no-files",
2727
"The multiagent template currently only works with files. We also only run on Linux to speed up tests.",
2828
);
29-
test.skip(
30-
agents === "form_filling" && templateFramework !== "fastapi",
31-
"Form filling is currently only supported with FastAPI.",
32-
);
3329
let port: number;
3430
let externalPort: number;
3531
let cwd: string;

helpers/typescript.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,22 @@ export const installTSTemplate = async ({
136136
// Copy agents use case code for multiagent template
137137
if (agents) {
138138
console.log("\nCopying agent:", agents, "\n");
139+
const useCasePath = path.join(compPath, "agents", "typescript", agents);
140+
const agentsCodePath = path.join(useCasePath, "workflow");
139141

140-
const agentsCodePath = path.join(
141-
compPath,
142-
"agents",
143-
"typescript",
144-
agents,
145-
);
146-
142+
// Copy agent codes
147143
await copy("**", path.join(root, relativeEngineDestPath, "workflow"), {
148144
parents: true,
149145
cwd: agentsCodePath,
150146
rename: assetRelocator,
151147
});
148+
149+
// Copy use case files to project root
150+
await copy("*.*", path.join(root), {
151+
parents: true,
152+
cwd: useCasePath,
153+
rename: assetRelocator,
154+
});
152155
} else {
153156
console.log(
154157
red(

questions/simple.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,19 @@ export const askSimpleQuestions = async (
5252
let useLlamaCloud = false;
5353

5454
if (appType !== "extractor") {
55-
// TODO: Add TS support for form filling use case
56-
if (appType !== "form_filling") {
57-
const { language: newLanguage } = await prompts(
58-
{
59-
type: "select",
60-
name: "language",
61-
message: "What language do you want to use?",
62-
choices: [
63-
{ title: "Python (FastAPI)", value: "fastapi" },
64-
{ title: "Typescript (NextJS)", value: "nextjs" },
65-
],
66-
},
67-
questionHandlers,
68-
);
69-
language = newLanguage;
70-
}
55+
const { language: newLanguage } = await prompts(
56+
{
57+
type: "select",
58+
name: "language",
59+
message: "What language do you want to use?",
60+
choices: [
61+
{ title: "Python (FastAPI)", value: "fastapi" },
62+
{ title: "Typescript (NextJS)", value: "nextjs" },
63+
],
64+
},
65+
questionHandlers,
66+
);
67+
language = newLanguage;
7168

7269
const { useLlamaCloud: newUseLlamaCloud } = await prompts(
7370
{

templates/components/agents/typescript/blog/factory.ts

Lines changed: 0 additions & 230 deletions
This file was deleted.

templates/components/agents/typescript/blog/tools.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)