diff --git a/legacy/examples/equation-producer.ts b/legacy/examples/equation-producer.ts index bd4542c2..2cfa1acc 100644 --- a/legacy/examples/equation-producer.ts +++ b/legacy/examples/equation-producer.ts @@ -28,7 +28,7 @@ export async function equationProducer() { 'Carla is downloading a 200 GB file. She can download 2 GB/minute, but 40% of the way through the download, the download fails. Then Carla has to restart the download from the beginning. How long did it take her to download the file in minutes?' const example = await $.gpt4( - `Give me the equation for the following math problem: {{question}}` + `You are an expert math teacher. Think step by step, and give me the equation for the following math problem: \n\n{{question}}` ) .input(z.object({ question: z.string() })) .output({ diff --git a/legacy/examples/sentiment.ts b/legacy/examples/sentiment.ts index 93fbc5ba..7095e7ea 100644 --- a/legacy/examples/sentiment.ts +++ b/legacy/examples/sentiment.ts @@ -6,7 +6,7 @@ import { Agentic } from '../src' dotenv.config() -export async function sentimentAgent() { +export async function main() { const openai = new OpenAIClient({ apiKey: process.env.OPENAI_API_KEY! }) const $ = new Agentic({ openai }) @@ -14,6 +14,7 @@ export async function sentimentAgent() { `You are an expert sentiment-labelling assistant. Label the following texts as positive or negative: \n{{#texts}}- {{.}}\n{{/texts}}` ) .input(z.object({ texts: z.string().array() })) + // TODO: label should be a union of literals .output(z.array(z.object({ text: z.string(), label: z.string() }))) .examples([ { input: 'The food was digusting', output: 'negative' }, @@ -37,4 +38,4 @@ export async function sentimentAgent() { console.log('example', example) } -sentimentAgent() +main()