Open
Description
Post refactor, I think we should add a specific exception for unhandled finish reasons, for folks to hook into.
I'd envisage it being thrown at the bottom of the handle method on provider handlers and taking the provider, the mapped finished reason and the "raw" provider finish reason.
return match ($finishReason) {
FinishReason::ToolCalls => $this->handleToolCalls($data, $request),
FinishReason::Stop => $this->handleStop($data, $request),
default => throw new PrismUnhandledFinishReasonException(Provider::Gemini, $finishReason, $finishReasonRaw),
};
Am happy to pick this up if you agree @sixlive, just leaving this here as a reminder to circle back to it.
Metadata
Metadata
Assignees
Labels
No labels
Activity