Skip to content

Custom tooluse instruction #143

@sontx

Description

@sontx

Hello,

First of all, thank you for this excellent library. It has been very helpful in my project, especially in addressing the limitations of Chrome Prompt AI.

I am currently encountering a limitation when attempting to customize more advanced behaviors-specifically, modifying the tool-use instruction. At the moment, this instruction appears to be hardcoded in the build-json-system-prompt.ts file, which makes it difficult to override or extend from outside the library.

It would be highly beneficial to have a mechanism that allows consumers to override the tool-use instruction externally. For example:

generateText({
  model: browserAI(),
  system: SYSTEM_PROMPT, // Manually specify the tool-use instruction
  prompt: userPrompt,
  providerOptions: {
    // Informs doGenerate and doStream to skip the internal tool-use instruction builder
    overrideTooluseInstruction: true, 
  }
})

This approach would provide greater flexibility for advanced use cases while preserving the existing default behavior for standard scenarios.

Thank you for considering this enhancement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    core@browser-ai/core packageenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions