Download src/lib/utils/tools.ts from mishig/chat-ui: direct link, hf CLI and curl.
- Browser
- Download file 615 Bytes
-
https://huggingface.co/spaces/mishig/chat-ui/resolve/ad6c8550d3c9ea2bb45490c8e085fc055ee1f33d/src/lib/utils/tools.ts
- Command line
-
hf download hf://spaces/mishig/chat-ui@ad6c8550d3c9ea2bb45490c8e085fc055ee1f33d/src/lib/utils/tools.ts
-
curl -L -o tools.ts https://huggingface.co/spaces/mishig/chat-ui/resolve/ad6c8550d3c9ea2bb45490c8e085fc055ee1f33d/src/lib/utils/tools.ts
615 Bytes
| import type { Tool } from "$lib/types/Tool"; | |
| /** | |
| * Checks if a tool's name equals a value. Replaces all hyphens with underscores before comparison | |
| * since some models return underscores even when hyphens are used in the request. | |
| **/ | |
| export function toolHasName(name: string, tool: Pick<Tool, "name">): boolean { | |
| return tool.name.replaceAll("-", "_") === name.replaceAll("-", "_"); | |
| } | |
| export const colors = ["purple", "blue", "green", "yellow", "red"] as const; | |
| export const icons = [ | |
| "wikis", | |
| "tools", | |
| "camera", | |
| "code", | |
| "email", | |
| "cloud", | |
| "terminal", | |
| "game", | |
| "chat", | |
| "speaker", | |
| "video", | |
| ] as const; | |