consolidate openrouter instance creation

This commit is contained in:
Avraham Sakal
2025-09-28 13:23:07 -04:00
parent d9053e1fc0
commit 88adc15899
5 changed files with 13 additions and 22 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import { router, createCallerFactory, authProcedure } from "./server.js";
import type { DraftMessage } from "../../types.js";
import { MODEL_NAME, openrouter } from "../provider.js";
import { MODEL_NAME } from "../provider.js";
import { generateObject, generateText, jsonSchema } from "ai";
import { TRPCError } from "@trpc/server";
import { z } from "zod";
+2 -2
View File
@@ -1,6 +1,6 @@
import { initTRPC, TRPCError } from "@trpc/server";
import type { getDbClient } from "../../database/postgres";
import type { getOpenrouter } from "@server/provider.js";
import type { createOpenRouter } from "@openrouter/ai-sdk-provider";
import type { JWT } from "@auth/core/jwt";
/**
@@ -11,7 +11,7 @@ const t = initTRPC
.context<
object & {
dbClient: ReturnType<typeof getDbClient>;
openrouter: ReturnType<typeof getOpenrouter>;
openrouter: ReturnType<typeof createOpenRouter>;
jwt?: JWT | null;
}
>()