mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(ai): update output limit assertions for token estimate
This commit is contained in:
parent
269121616c
commit
311f0e020d
2 changed files with 4 additions and 4 deletions
|
|
@ -140,7 +140,7 @@ describe("openai-completions empty tools handling", () => {
|
|||
|
||||
const params = mockState.lastParams as { max_tokens?: number; max_completion_tokens?: number };
|
||||
expect(params.max_tokens).toBeUndefined();
|
||||
expect(params.max_completion_tokens).toBe(3904);
|
||||
expect(params.max_completion_tokens).toBe(3618);
|
||||
});
|
||||
|
||||
it("clamps explicit maxTokens to remaining context", async () => {
|
||||
|
|
@ -157,7 +157,7 @@ describe("openai-completions empty tools handling", () => {
|
|||
|
||||
const params = mockState.lastParams as { max_tokens?: number; max_completion_tokens?: number };
|
||||
expect(params.max_tokens).toBeUndefined();
|
||||
expect(params.max_completion_tokens).toBe(3904);
|
||||
expect(params.max_completion_tokens).toBe(3618);
|
||||
});
|
||||
|
||||
it("uses conservative OpenAI-compatible fields for Cloudflare AI Gateway /compat models", async () => {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { Context } from "@earendil-works/chord";
|
||||
import type { AssistantMessage, Message, ToolCall, ToolResultMessage } from "@earendil-works/pi-ai";
|
||||
import type { SessionImpl } from "../session/session.ts";
|
||||
import { idFromNumber } from "../ids.ts";
|
||||
import type { ContextEdit, ConversationId, Cursor, EntryId, EntryRecord, EntryQuery, Storage } from "../types.ts";
|
||||
import type { SessionImpl } from "../session/session.ts";
|
||||
import type { ContextEdit, ConversationId, Cursor, EntryId, EntryQuery, EntryRecord, Storage } from "../types.ts";
|
||||
import type { ContextView } from "./types.ts";
|
||||
|
||||
const SCAN_PAGE_SIZE = 256;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue