Throw an error if the AI service return an empty assistant message

This commit is contained in:
Alex Gleason committed 2025-10-07 21:13:04 -05:00
1 parent ca45f62585
commit 496ab8722a
7 files changed
+249 -3

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
/**
* Error thrown when the AI generates an empty message with no content, reasoning, or tool calls.
* This typically indicates an issue with the AI provider or model configuration.
*/
export class EmptyMessageError extends Error {
constructor(
message: string,
public readonly providerModel: string,
) {
super(message);
this.name = 'EmptyMessageError';
}
}