From cc855b944d98683ceee82d61a66a884d085a3c99 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Fri, 26 May 2023 18:18:15 -0700 Subject: [PATCH] =?UTF-8?q?=E2=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- legacy/examples/facts.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/legacy/examples/facts.ts b/legacy/examples/facts.ts index e5cadb62..a0fa0054 100644 --- a/legacy/examples/facts.ts +++ b/legacy/examples/facts.ts @@ -11,9 +11,11 @@ async function main() { const ai = new Agentic({ openai }) const out = await ai - .gpt4(`Give me random facts about {{topic}}`) - .output(z.array(z.string())) - .input(z.object({ topic: z.string() })) + .gpt3(`Give me {{numFacts}} random facts about {{topic}}`) + .input( + z.object({ topic: z.string(), numFacts: z.number().int().default(5) }) + ) + .output(z.object({ facts: z.array(z.string()) })) .modelParams({ temperature: 0.9 }) .call({ topic: 'cats' })