Using Effect.repeat and Schedule

I can't get the hang of this, i'm struggeling to repeat an effect until a condition is true, or until it repeated 3 times, and then map the answer

pipe(
  client({
    stream: false,
    system: systemPrompt(company.name.primary),
    prompt: prompt.description.text,
    model: 'llama3'
  }),
  Effect.repeat({
    until: () => true 
  }),
  Effect.andThen(({ response, eval_duration }) => ({
      text: response,
      completionTime: Duration.toMillis(Duration.seconds(eval_duration / 1_000_000_000))
  }))
)


I can't get Effect.repeat to typecheck when using Schedule?
Was this page helpful?