Skip to content

Commit

Permalink
Minor tweaks to example.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoseley committed Dec 30, 2024
1 parent 2c2ee98 commit d73a6e6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ type PerformResearchOutput = string;
const PerformResearch = gsx.Component<ResearchProps, ResearchOutput>(
async ({ topic }) => {
console.log("📚 Researching topic:", topic);
return await Promise.resolve(`research results for ${topic}`);
// Make a call to your vector DB, or an API, or invoke a model like OpenAI, Anthropic, Perplexity, and more.
const results = await Promise.resolve([
"research result 1",
"research result 2",
"research result 3",
]);
return results;
},
);

Expand All @@ -135,9 +141,11 @@ type WriteDraftOutput = string;
const WriteDraft = gsx.Component<WriteDraftProps, WriteDraftOutput>(
async ({ research, prompt }) => {
console.log("✍️ Writing draft based on research");
return await Promise.resolve(
// Invoke a model like OpenAI, Anthropic, Perplexity, and more.
const draft = await Promise.resolve(
`**draft\n${research}\n${prompt}\n**end draft`,
);
return draft;
},
);

Expand All @@ -148,7 +156,9 @@ type EditDraftOutput = string;
const EditDraft = gsx.Component<EditDraftProps, EditDraftOutput>(
async ({ draft }) => {
console.log("✨ Polishing final draft");
return await Promise.resolve(`edited result: ${draft}`);
// Invoke a model like OpenAI, Anthropic, Perplexity, and more.
const editedDraft = await Promise.resolve(`edited result: ${draft}`);
return editedDraft;
},
);

Expand All @@ -159,6 +169,7 @@ type WebResearcherOutput = string[];
const WebResearcher = gsx.Component<WebResearcherProps, WebResearcherOutput>(
async ({ prompt }) => {
console.log("🌐 Researching web for:", prompt);
// Make a call to your vector DB, or an API, or invoke a model like OpenAI, Anthropic, Perplexity, and more.
const results = await Promise.resolve([
"web result 1",
"web result 2",
Expand Down

0 comments on commit d73a6e6

Please sign in to comment.