mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 06:04:51 +00:00
fix(coding-agent): use ModelRegistry in custom-compaction example (fixes #1387)
This commit is contained in:
parent
d58d2c2da1
commit
e10a831e56
1 changed files with 2 additions and 2 deletions
|
|
@ -13,7 +13,7 @@
|
||||||
* pi --extension examples/extensions/custom-compaction.ts
|
* pi --extension examples/extensions/custom-compaction.ts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { complete, getModel } from "@mariozechner/pi-ai";
|
import { complete } from "@mariozechner/pi-ai";
|
||||||
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
||||||
import { convertToLlm, serializeConversation } from "@mariozechner/pi-coding-agent";
|
import { convertToLlm, serializeConversation } from "@mariozechner/pi-coding-agent";
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ export default function (pi: ExtensionAPI) {
|
||||||
const { messagesToSummarize, turnPrefixMessages, tokensBefore, firstKeptEntryId, previousSummary } = preparation;
|
const { messagesToSummarize, turnPrefixMessages, tokensBefore, firstKeptEntryId, previousSummary } = preparation;
|
||||||
|
|
||||||
// Use Gemini Flash for summarization (cheaper/faster than most conversation models)
|
// Use Gemini Flash for summarization (cheaper/faster than most conversation models)
|
||||||
const model = getModel("google", "gemini-2.5-flash");
|
const model = ctx.modelRegistry.find("google", "gemini-2.5-flash");
|
||||||
if (!model) {
|
if (!model) {
|
||||||
ctx.ui.notify(`Could not find Gemini Flash model, using default compaction`, "warning");
|
ctx.ui.notify(`Could not find Gemini Flash model, using default compaction`, "warning");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue