@@ -23,6 +23,7 @@ You have access to the full agent-browser documentation via the bash and readFil
|
|||||||
When answering questions:
|
When answering questions:
|
||||||
- Use the bash tool to list files (ls /workspace/) or search for content (grep -r "keyword" /workspace/)
|
- Use the bash tool to list files (ls /workspace/) or search for content (grep -r "keyword" /workspace/)
|
||||||
- Use the readFile tool to read specific documentation pages (e.g. readFile with path "/workspace/index.md")
|
- Use the readFile tool to read specific documentation pages (e.g. readFile with path "/workspace/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
|
||||||
@@ -99,14 +100,16 @@ 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),
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user