mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
refactor: Streamline abort handling and integrate GenerationJobManager for improved job management
- Removed the abortControllers middleware and integrated abort handling directly into GenerationJobManager. - Updated abortMessage function to utilize GenerationJobManager for aborting jobs by conversation ID, enhancing clarity and efficiency. - Simplified cleanup processes and improved error handling during abort operations. - Enhanced metadata management for jobs, including endpoint and model information, to facilitate better tracking and resource management.
This commit is contained in:
parent
fe1cc4a61d
commit
3a23badf5f
7 changed files with 236 additions and 314 deletions
|
|
@ -37,6 +37,29 @@ export interface SerializableJobData {
|
|||
|
||||
/** Serialized final event for replay */
|
||||
finalEvent?: string;
|
||||
|
||||
/** Endpoint metadata for abort handling - avoids storing functions */
|
||||
endpoint?: string;
|
||||
iconURL?: string;
|
||||
model?: string;
|
||||
promptTokens?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Result returned from aborting a job - contains all data needed
|
||||
* for token spending and message saving without storing callbacks
|
||||
*/
|
||||
export interface AbortResult {
|
||||
/** Whether the abort was successful */
|
||||
success: boolean;
|
||||
/** The job data at time of abort */
|
||||
jobData: SerializableJobData | null;
|
||||
/** Aggregated content from the stream */
|
||||
content: Agents.MessageContentComplex[];
|
||||
/** Plain text representation of content */
|
||||
text: string;
|
||||
/** Final event to send to client */
|
||||
finalEvent: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue