Skip to content

Commit

Permalink
feat: Add form filling use case for TS and optimize workflows (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj authored Nov 13, 2024
1 parent 2b712ce commit 8431b78
Show file tree
Hide file tree
Showing 32 changed files with 2,012 additions and 901 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-cherries-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-llama": patch
---

Optimize Typescript multi-agent code
5 changes: 5 additions & 0 deletions .changeset/serious-suits-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-llama": patch
---

Add form filling use case (Typescript)
4 changes: 0 additions & 4 deletions e2e/shared/multiagent_template.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ for (const agents of templateAgents) {
process.platform !== "linux" || process.env.DATASOURCE === "--no-files",
"The multiagent template currently only works with files. We also only run on Linux to speed up tests.",
);
test.skip(
agents === "form_filling" && templateFramework !== "fastapi",
"Form filling is currently only supported with FastAPI.",
);
let port: number;
let externalPort: number;
let cwd: string;
Expand Down
17 changes: 10 additions & 7 deletions helpers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,22 @@ export const installTSTemplate = async ({
// Copy agents use case code for multiagent template
if (agents) {
console.log("\nCopying agent:", agents, "\n");
const useCasePath = path.join(compPath, "agents", "typescript", agents);
const agentsCodePath = path.join(useCasePath, "workflow");

const agentsCodePath = path.join(
compPath,
"agents",
"typescript",
agents,
);

// Copy agent codes
await copy("**", path.join(root, relativeEngineDestPath, "workflow"), {
parents: true,
cwd: agentsCodePath,
rename: assetRelocator,
});

// Copy use case files to project root
await copy("*.*", path.join(root), {
parents: true,
cwd: useCasePath,
rename: assetRelocator,
});
} else {
console.log(
red(
Expand Down
29 changes: 13 additions & 16 deletions questions/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,19 @@ export const askSimpleQuestions = async (
let useLlamaCloud = false;

if (appType !== "extractor") {
// TODO: Add TS support for form filling use case
if (appType !== "form_filling") {
const { language: newLanguage } = await prompts(
{
type: "select",
name: "language",
message: "What language do you want to use?",
choices: [
{ title: "Python (FastAPI)", value: "fastapi" },
{ title: "Typescript (NextJS)", value: "nextjs" },
],
},
questionHandlers,
);
language = newLanguage;
}
const { language: newLanguage } = await prompts(
{
type: "select",
name: "language",
message: "What language do you want to use?",
choices: [
{ title: "Python (FastAPI)", value: "fastapi" },
{ title: "Typescript (NextJS)", value: "nextjs" },
],
},
questionHandlers,
);
language = newLanguage;

const { useLlamaCloud: newUseLlamaCloud } = await prompts(
{
Expand Down
230 changes: 0 additions & 230 deletions templates/components/agents/typescript/blog/factory.ts

This file was deleted.

54 changes: 0 additions & 54 deletions templates/components/agents/typescript/blog/tools.ts

This file was deleted.

Loading

0 comments on commit 8431b78

Please sign in to comment.