chore: import upstream snapshot with attribution
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Backend release / release (push) Has been cancelled
Bandit Security Scan / bandit_scan (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / manifest (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / manifest (push) Has been cancelled
Python linting / ruff (push) Has been cancelled
Run python tests with pytest / Run tests and count coverage (3.12) (push) Has been cancelled
React Widget Build / build (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Backend release / release (push) Has been cancelled
Bandit Security Scan / bandit_scan (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push multi-arch DocsGPT Docker image / manifest (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Has been cancelled
Build and push DocsGPT FE Docker image for development / manifest (push) Has been cancelled
Python linting / ruff (push) Has been cancelled
Run python tests with pytest / Run tests and count coverage (3.12) (push) Has been cancelled
React Widget Build / build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
"""Tests for ThinkTool — the chain-of-thought pseudo-tool."""
|
||||
|
||||
import pytest
|
||||
from application.agents.tools.think import (
|
||||
THINK_TOOL_ENTRY,
|
||||
THINK_TOOL_ID,
|
||||
ThinkTool,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
class TestThinkTool:
|
||||
|
||||
def test_id_constant(self):
|
||||
assert THINK_TOOL_ID == "think"
|
||||
|
||||
def test_entry_has_reason_action(self):
|
||||
actions = THINK_TOOL_ENTRY["actions"]
|
||||
assert len(actions) == 1
|
||||
assert actions[0]["name"] == "reason"
|
||||
assert actions[0]["active"] is True
|
||||
|
||||
def test_execute_reason_returns_continue(self):
|
||||
tool = ThinkTool()
|
||||
result = tool.execute_action("reason", reasoning="step by step thinking")
|
||||
assert result == "Continue."
|
||||
|
||||
def test_execute_unknown_action_returns_continue(self):
|
||||
tool = ThinkTool()
|
||||
result = tool.execute_action("unknown_action")
|
||||
assert result == "Continue."
|
||||
|
||||
def test_get_actions_metadata(self):
|
||||
tool = ThinkTool()
|
||||
meta = tool.get_actions_metadata()
|
||||
assert len(meta) == 1
|
||||
assert meta[0]["name"] == "reason"
|
||||
props = meta[0]["parameters"]["properties"]
|
||||
assert "reasoning" in props
|
||||
assert props["reasoning"]["filled_by_llm"] is True
|
||||
|
||||
def test_get_config_requirements_empty(self):
|
||||
tool = ThinkTool()
|
||||
assert tool.get_config_requirements() == {}
|
||||
|
||||
def test_init_accepts_no_config(self):
|
||||
tool = ThinkTool()
|
||||
assert tool is not None
|
||||
|
||||
def test_init_accepts_config(self):
|
||||
tool = ThinkTool(config={"key": "value"})
|
||||
assert tool is not None
|
||||
Reference in New Issue
Block a user