mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 17:04:49 +00:00
Improve before_compact hook: add messagesToKeep, replace apiKey with resolveApiKey
This commit is contained in:
parent
e4283294c8
commit
d9a542763a
8 changed files with 51 additions and 24 deletions
|
|
@ -130,11 +130,13 @@ export type SessionEvent =
|
|||
| (SessionEventBase & {
|
||||
reason: "before_compact";
|
||||
cutPoint: CutPointResult;
|
||||
/** Messages that will be summarized and discarded */
|
||||
messagesToSummarize: AppMessage[];
|
||||
/** Messages that will be kept after the summary (recent turns) */
|
||||
messagesToKeep: AppMessage[];
|
||||
tokensBefore: number;
|
||||
customInstructions?: string;
|
||||
model: Model<any>;
|
||||
apiKey: string;
|
||||
/** Resolve API key for any model (checks settings, OAuth, env vars) */
|
||||
resolveApiKey: (model: Model<any>) => Promise<string | undefined>;
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue