effect icon indicating copy to clipboard operation
effect copied to clipboard

Consider "refusal" in AiResponse.FinishReason

Open alex-dixon opened this issue 7 months ago • 2 comments

I see in the latest generated Anthropic PR (#4897) we parse "refusal" from the Anthropic API stop reason.

Currently this would be parsed into AiResponse.FinishReason as "unknown". Just wanted to mention in case it slips through the cracks. https://github.com/Effect-TS/effect/blob/cb3c30f540a83dafcd6d841375073b5e069fa417/packages/ai/ai/src/AiResponse.ts#L562

As a side note, if refusals are ultimately surfaced as successful responses, the retry/model fallback behavior via AiPlan's while function seems unable provide input for what to do next when there is a refusal.

alex-dixon avatar May 18 '25 15:05 alex-dixon

I'll tackle this after we merge #4918.

IMax153 avatar May 24 '25 11:05 IMax153

is there a way to monkey patch this ? i'm trying to use aws bedrock models with effect proxied models doesnt contain refusal

Necmttn avatar May 29 '25 03:05 Necmttn