Skip to content

Commit

Permalink
add blog to simple use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj committed Jan 20, 2025
1 parent d5eac5d commit 578173f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
10 changes: 10 additions & 0 deletions helpers/datasources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ export const EXAMPLE_GDPR: TemplateDataSource = {
},
};

export const AI_REPORTS: TemplateDataSource = {
type: "file",
config: {
url: new URL(
"https://www.europarl.europa.eu/RegData/etudes/ATAG/2024/760392/EPRS_ATA(2024)760392_EN.pdf",
),
filename: "EPRS_ATA_2024_760392_EN.pdf",
},
};

export function getDataSources(
files?: string,
exampleFile?: boolean,
Expand Down
3 changes: 2 additions & 1 deletion helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export type TemplateUseCase =
| "blog"
| "form_filling"
| "extractor"
| "contract_review";
| "contract_review"
| "blog";
// Config for both file and folder
export type FileSourceConfig =
| {
Expand Down
18 changes: 16 additions & 2 deletions questions/simple.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import prompts from "prompts";
import {
AI_REPORTS,
EXAMPLE_10K_SEC_FILES,
EXAMPLE_FILE,
EXAMPLE_GDPR,
Expand All @@ -17,7 +18,8 @@ type AppType =
| "form_filling"
| "extractor"
| "contract_review"
| "data_scientist";
| "data_scientist"
| "blog";

type SimpleAnswers = {
appType: AppType;
Expand Down Expand Up @@ -51,6 +53,7 @@ export const askSimpleQuestions = async (
title: "Contract Review (using Workflows)",
value: "contract_review",
},
{ title: "Blog Writer (using Workflows)", value: "blog" },
],
},
questionHandlers,
Expand All @@ -60,7 +63,11 @@ export const askSimpleQuestions = async (
let llamaCloudKey = args.llamaCloudKey;
let useLlamaCloud = false;

if (appType !== "extractor" && appType !== "contract_review") {
if (
appType !== "extractor" &&
appType !== "contract_review" &&
appType !== "blog"
) {
const { language: newLanguage } = await prompts(
{
type: "select",
Expand Down Expand Up @@ -188,6 +195,13 @@ const convertAnswers = async (
frontend: false,
dataSources: [EXAMPLE_GDPR],
},
blog: {
template: "multiagent",
useCase: "blog",
tools: [],
frontend: true,
dataSources: [AI_REPORTS],
},
};
const results = lookup[answers.appType];
return {
Expand Down

0 comments on commit 578173f

Please sign in to comment.