Chore: pw tools to be disabled as default

This commit is contained in:
Grail Finder
2026-03-04 11:45:54 +03:00
parent abcaad6609
commit d144ee76d9
5 changed files with 15 additions and 6 deletions

2
bot.go
View File

@@ -1524,7 +1524,7 @@ func init() {
if cfg.STT_ENABLED { if cfg.STT_ENABLED {
asr = NewSTT(logger, cfg) asr = NewSTT(logger, cfg)
} }
if !cfg.NoPlaywright { if cfg.PlaywrightEnabled {
if err := checkPlaywright(); err != nil { if err := checkPlaywright(); err != nil {
// slow, need a faster check if playwright install // slow, need a faster check if playwright install
if err := installPW(); err != nil { if err := installPW(); err != nil {

View File

@@ -56,6 +56,6 @@ StripThinkingFromAPI = true # Strip <think> blocks from messages before sending
# Valid values: xhigh, high, medium, low, minimal, none (empty or none = disabled) # Valid values: xhigh, high, medium, low, minimal, none (empty or none = disabled)
# Models that support reasoning will include thinking content wrapped in <think> tags # Models that support reasoning will include thinking content wrapped in <think> tags
ReasoningEffort = "medium" ReasoningEffort = "medium"
# playwright # playwright tools
NoPlaywright = false PlaywrightEnabled = false
PlaywrightDebug = false PlaywrightDebug = false

View File

@@ -71,7 +71,7 @@ type Config struct {
CharSpecificContextTag string `toml:"CharSpecificContextTag"` CharSpecificContextTag string `toml:"CharSpecificContextTag"`
AutoTurn bool `toml:"AutoTurn"` AutoTurn bool `toml:"AutoTurn"`
// playwright browser // playwright browser
NoPlaywright bool `toml:"NoPlaywright"` // when we want to avoid pw tool use PlaywrightEnabled bool `toml:"PlaywrightEnabled"`
PlaywrightDebug bool `toml:"PlaywrightDebug"` // !headless PlaywrightDebug bool `toml:"PlaywrightDebug"` // !headless
} }

View File

@@ -162,6 +162,15 @@ Those could be switched in program, but also bould be setup in config.
#### ToolUse #### ToolUse
- Enable or disable explanation of tools to llm, so it could use them. - Enable or disable explanation of tools to llm, so it could use them.
#### Playwright Browser Automation
These settings enable browser automation tools available to the LLM.
- **PlaywrightEnabled** (`false`)
- Enable or disable Playwright browser automation tools for the LLM. When enabled, the LLM can use tools like `pw_browser`, `pw_close`, and `pw_status` to automate browser interactions.
- **PlaywrightDebug** (`false`)
- Enable debug mode for Playwright browser. When set to `true`, the browser runs in visible (non-headless) mode, displaying the GUI for debugging purposes. When `false`, the browser runs in headless mode by default.
### StripThinkingFromAPI (`true`) ### StripThinkingFromAPI (`true`)
- Strip thinking blocks from messages before sending to LLM. Keeps them in chat history for local viewing but reduces token usage in API calls. - Strip thinking blocks from messages before sending to LLM. Keeps them in chat history for local viewing but reduces token usage in API calls.

View File

@@ -1505,7 +1505,7 @@ func registerWindowTools() {
func registerPlaywrightTools() { func registerPlaywrightTools() {
removePlaywrightToolsFromBaseTools() removePlaywrightToolsFromBaseTools()
if cfg != nil && !cfg.NoPlaywright { if cfg != nil && cfg.PlaywrightEnabled {
fnMap["pw_start"] = pwStart fnMap["pw_start"] = pwStart
fnMap["pw_stop"] = pwStop fnMap["pw_stop"] = pwStop
fnMap["pw_is_running"] = pwIsRunning fnMap["pw_is_running"] = pwIsRunning