fix(ai): Fix OpenAI Responses provider import order and cost calculation

This commit is contained in:
Mario Zechner 2025-08-31 23:56:39 +02:00
parent f87ac359bb
commit 7db3068cee

View file

@ -10,6 +10,7 @@ import type {
ResponseOutputMessage, ResponseOutputMessage,
ResponseReasoningItem, ResponseReasoningItem,
} from "openai/resources/responses/responses.js"; } from "openai/resources/responses/responses.js";
import { calculateCost } from "../models.js";
import type { import type {
AssistantMessage, AssistantMessage,
Context, Context,
@ -236,6 +237,8 @@ export class OpenAIResponsesLLM implements LLM<OpenAIResponsesLLMOptions> {
stopReason = "toolUse"; stopReason = "toolUse";
} }
calculateCost(this.modelInfo, usage);
const output = { const output = {
role: "assistant", role: "assistant",
content: blocks, content: blocks,