From 68b702239c33a910b7e6dd0f2359334e88ad077f Mon Sep 17 00:00:00 2001 From: Nathan Sarrazin Date: Tue, 15 Oct 2024 20:13:57 +0000 Subject: [PATCH] chores: remove android specific flags --- src/routes/+layout.server.ts | 7 ++----- src/routes/conversation/[id]/+server.ts | 9 +-------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index 8926ea29b01..913dc9dc37b 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -13,7 +13,7 @@ import { MetricsServer } from "$lib/server/metrics"; import type { ToolFront, ToolInputFile } from "$lib/types/Tool"; import { ReviewStatus } from "$lib/types/Review"; -export const load: LayoutServerLoad = async ({ locals, depends, request }) => { +export const load: LayoutServerLoad = async ({ locals, depends }) => { depends(UrlDependency.ConversationList); const settings = await collections.settings.findOne(authCondition(locals)); @@ -191,10 +191,7 @@ export const load: LayoutServerLoad = async ({ locals, depends, request }) => { preprompt: model.preprompt, multimodal: model.multimodal, multimodalAcceptedMimetypes: model.multimodalAcceptedMimetypes, - tools: - model.tools && - // disable tools on huggingchat android app - !request.headers.get("user-agent")?.includes("co.huggingface.chat_ui_android"), + tools: model.tools, unlisted: model.unlisted, hasInferenceAPI: model.hasInferenceAPI, })), diff --git a/src/routes/conversation/[id]/+server.ts b/src/routes/conversation/[id]/+server.ts index 50fe126a468..80c72ee01e2 100644 --- a/src/routes/conversation/[id]/+server.ts +++ b/src/routes/conversation/[id]/+server.ts @@ -159,14 +159,7 @@ export async function POST({ request, locals, params, getClientAddress }) { is_retry: z.optional(z.boolean()), is_continue: z.optional(z.boolean()), web_search: z.optional(z.boolean()), - tools: z - .array(z.string()) - .optional() - .transform((tools) => - // disable tools on huggingchat android app - request.headers.get("user-agent")?.includes("co.huggingface.chat_ui_android") ? [] : tools - ), - + tools: z.array(z.string()).optional(), files: z.optional( z.array( z.object({