style: auto-fix lint and format
This commit is contained in:
1 parent
31d9e8d582
commit
6bbb786ede
3 files changed
+23
-18
No files matched your search
@@ -128,10 +128,7 @@ export const createBoardContentPage = <TParams extends Record<string, unknown>>(
|
|||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Ignore not found and bad-request errors and return empty metadata
|
// Ignore not found and bad-request errors and return empty metadata
|
||||||
if (
|
if (error instanceof TRPCError && (error.code === "NOT_FOUND" || error.code === "BAD_REQUEST")) {
|
||||||
error instanceof TRPCError &&
|
|
||||||
(error.code === "NOT_FOUND" || error.code === "BAD_REQUEST")
|
|
||||||
) {
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,15 @@ import { hkdfSync } from "node:crypto";
|
|||||||
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
||||||
import type { MetadataExtractor } from "@ai-sdk/openai-compatible";
|
import type { MetadataExtractor } from "@ai-sdk/openai-compatible";
|
||||||
import type { ToolSet, UIMessage } from "ai";
|
import type { ToolSet, UIMessage } from "ai";
|
||||||
import { convertToModelMessages, createUIMessageStream, createUIMessageStreamResponse, jsonSchema, stepCountIs, streamText, tool } from "ai";
|
import {
|
||||||
|
convertToModelMessages,
|
||||||
|
createUIMessageStream,
|
||||||
|
createUIMessageStreamResponse,
|
||||||
|
jsonSchema,
|
||||||
|
stepCountIs,
|
||||||
|
streamText,
|
||||||
|
tool,
|
||||||
|
} from "ai";
|
||||||
import { parse, stringify } from "superjson";
|
import { parse, stringify } from "superjson";
|
||||||
import { z } from "zod/v4";
|
import { z } from "zod/v4";
|
||||||
|
|
||||||
|
|||||||
@@ -441,21 +441,21 @@ const addFeedbackToMessageContent = (serializedContent: string, type: "positive"
|
|||||||
|
|
||||||
export const assistantRouter = createTRPCRouter({
|
export const assistantRouter = createTRPCRouter({
|
||||||
getAvailability: protectedProcedure.query(async ({ ctx }) => {
|
getAvailability: protectedProcedure.query(async ({ ctx }) => {
|
||||||
if (isDemoMode) {
|
if (isDemoMode) {
|
||||||
return { enabled: true };
|
return { enabled: true };
|
||||||
}
|
}
|
||||||
const configuration = await getConfigurationAsync(ctx.db);
|
const configuration = await getConfigurationAsync(ctx.db);
|
||||||
const requiresApiKey = configuration ? assistantProviderRequiresApiKey(configuration.provider) : false;
|
const requiresApiKey = configuration ? assistantProviderRequiresApiKey(configuration.provider) : false;
|
||||||
return {
|
return {
|
||||||
enabled: Boolean(
|
enabled: Boolean(
|
||||||
configuration?.enabled && configuration.modelId && (!requiresApiKey || configuration.encryptedApiKey),
|
configuration?.enabled && configuration.modelId && (!requiresApiKey || configuration.encryptedApiKey),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
||||||
getContextEntities: protectedProcedure.query(async ({ ctx }) => {
|
getContextEntities: protectedProcedure.query(async ({ ctx }) => {
|
||||||
return await getAssistantContextEntitiesAsync(ctx);
|
return await getAssistantContextEntitiesAsync(ctx);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
getModelCapabilities: protectedProcedure
|
getModelCapabilities: protectedProcedure
|
||||||
.input(z.object({ modelId: z.string().trim().min(1).max(256).optional() }).optional())
|
.input(z.object({ modelId: z.string().trim().min(1).max(256).optional() }).optional())
|
||||||
|
|||||||
Reference in new issue
Block a user