|
@@ -23,6 +23,7 @@ You have access to the full json-render documentation via the bash and readFile
|
|
|
When answering questions:
|
|
When answering questions:
|
|
|
- Use the bash tool to list files (ls /workspace/docs/) or search for content (grep -r "keyword" /workspace/docs/)
|
|
- Use the bash tool to list files (ls /workspace/docs/) or search for content (grep -r "keyword" /workspace/docs/)
|
|
|
- Use the readFile tool to read specific documentation pages (e.g. readFile with path "/workspace/docs/index.md")
|
|
- Use the readFile tool to read specific documentation pages (e.g. readFile with path "/workspace/docs/index.md")
|
|
|
|
|
+- Do NOT use bash to write, create, modify, or delete files (no tee, cat >, sed -i, echo >, cp, mv, rm, mkdir, touch, etc.) — you are read-only
|
|
|
- Always base your answers on the actual documentation content
|
|
- Always base your answers on the actual documentation content
|
|
|
- Be concise and accurate
|
|
- Be concise and accurate
|
|
|
- If the docs don't cover a topic, say so honestly
|
|
- If the docs don't cover a topic, say so honestly
|
|
@@ -107,14 +108,19 @@ export async function POST(req: Request) {
|
|
|
const { messages }: { messages: UIMessage[] } = await req.json();
|
|
const { messages }: { messages: UIMessage[] } = await req.json();
|
|
|
|
|
|
|
|
const docsFiles = await loadDocsFiles();
|
|
const docsFiles = await loadDocsFiles();
|
|
|
- const { tools } = await createBashTool({ files: docsFiles });
|
|
|
|
|
|
|
+ const {
|
|
|
|
|
+ tools: { bash, readFile },
|
|
|
|
|
+ } = await createBashTool({ files: docsFiles });
|
|
|
|
|
|
|
|
const result = streamText({
|
|
const result = streamText({
|
|
|
model: DEFAULT_MODEL,
|
|
model: DEFAULT_MODEL,
|
|
|
system: SYSTEM_PROMPT,
|
|
system: SYSTEM_PROMPT,
|
|
|
messages: await convertToModelMessages(messages),
|
|
messages: await convertToModelMessages(messages),
|
|
|
stopWhen: stepCountIs(5),
|
|
stopWhen: stepCountIs(5),
|
|
|
- tools,
|
|
|
|
|
|
|
+ tools: {
|
|
|
|
|
+ bash,
|
|
|
|
|
+ readFile,
|
|
|
|
|
+ },
|
|
|
prepareStep: ({ messages: stepMessages }) => ({
|
|
prepareStep: ({ messages: stepMessages }) => ({
|
|
|
messages: addCacheControl(stepMessages),
|
|
messages: addCacheControl(stepMessages),
|
|
|
}),
|
|
}),
|