Effect CommunityEC
Effect Community3mo ago
25 replies
CharLEE

Issue with Empty Text in Dad Jokes Example Test

Hi. I took the dad jokes example and I ran it in test, but I always get empty text, why is this? In the response i see the tool was used, and got the joke

// Before this all from the Dad's joke example unchanged
const program = LanguageModel.generateText({
    prompt: 'Generate a dad joke about pirates',
    toolkit: DadJokeTools,
}).pipe(Effect.provide(OpenAiLanguageModel.model('gpt-4o')))

it.effect('tool should get pirates', () =>
  E.gen(function* () {
    const result = yield* program
    console.log(JSON.stringify(result, null, 2))

    expect(result.text).toContain('pirates')
  }).pipe(Effect.provide([OpenAi, DadJokeToolHandlers])),
CleanShot_2025-10-07_at_13.21.48.png
Was this page helpful?