buildResearchSystemPrompt (builtinTools/researchPrompt.ts)

chat-ui · src/lib/server/textGeneration/builtinTools/researchPrompt.ts · typescript · Apache-2.0
scraping

Generates research prompts for ML assistants by adapting to available tools.

// Source: https://github.com/huggingface/chat-ui | License: Apache-2.0 | Copyright 2018- The Hugging Face team. All rights reserved
// Provided via justclaw.it.com; keep this notice with the code.
import { GITHUB_FIND_EXAMPLES, GITHUB_LIST_REPOS, GITHUB_READ_FILE } from "$lib/server/github";

/**
 * The research sub-agent's prompts, ported from ml-intern's
 * agent/tools/research_tool.py (RESEARCH_SYSTEM_PROMPT and the three
 * budget/stop prompts). The loop mechanics live in researchTool.ts.
 *
 * Deliberate deviations from the source:
 * - ml-intern's `hf_papers` tool was Semantic Scholar-backed, so its prompt
 *   could order a citation-graph crawl. This mode has no citation index, so
 *   the crawl is rewritten to what the tools can do: walk the bibliography
 *   already present in pa

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key