consolidate openrouter instance creation
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
>()
|
||||
|
||||
Reference in New Issue
Block a user