oneuptime/Copilot/Exceptions/LLMTimeoutException.ts
Simon Larsen 9ad97b1fe0
refactor: Add timeout handling to Llama prompt execution
This commit adds timeout handling to the Llama prompt execution in the Llama class. It introduces a timeoutInMinutes property in the CopilotActionPrompt interface and uses it to set a timeout for the prompt execution. If the prompt execution exceeds the specified timeout, a LLMTimeoutException is thrown, indicating that the prompt has timed out. This change enhances the reliability and responsiveness of the Llama service by preventing long-running prompts from blocking the execution flow.
2024-07-08 18:06:06 +01:00

9 lines
332 B
TypeScript

import ExceptionCode from "Common/Types/Exception/ExceptionCode";
import CopilotActionProcessingException from "./CopilotActionProcessingException";
export default class LLMTimeoutException extends CopilotActionProcessingException {
public constructor(message: string) {
super(ExceptionCode.BadDataException, message);
}
}