Skip to content

Commit

Permalink
chores: remove android specific flags (#1524)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin authored Oct 16, 2024
1 parent cc5dfd4 commit bf0bc92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
7 changes: 2 additions & 5 deletions src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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,
})),
Expand Down
9 changes: 1 addition & 8 deletions src/routes/conversation/[id]/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit bf0bc92

Please sign in to comment.