Files
wehub-resource-sync c889a57b6b
Test Suites / Build CI Environment (push) Has been cancelled
Test Suites / Basic Tests (push) Has been cancelled
Test Suites / End-to-End Tests (push) Has been cancelled
Test Suites / CLI Tests (push) Has been cancelled
Test Suites / Slow End-to-End Tests (push) Has been cancelled
Test Suites / Graph Database Tests (push) Has been cancelled
Test Suites / Vector DB Tests (push) Has been cancelled
Test Suites / Temporal Graph Test (push) Has been cancelled
Test Suites / Search Test on Different DBs (push) Has been cancelled
Test Suites / Example Tests (push) Has been cancelled
Test Suites / Notebook Tests (push) Has been cancelled
Test Suites / OS and Python Tests Ubuntu (push) Has been cancelled
Test Suites / OS and Python Tests Extended (push) Has been cancelled
Test Suites / LLM Test Suite (push) Has been cancelled
Test Suites / S3 File Storage Test (push) Has been cancelled
Test Suites / Run Integration Tests (push) Has been cancelled
Test Suites / MCP Tests (push) Has been cancelled
Test Suites / Docker Compose Test (push) Has been cancelled
Test Suites / Docker CI test (push) Has been cancelled
Test Suites / Relational DB Migration Tests (push) Has been cancelled
Test Suites / Distributed Cognee Test (push) Has been cancelled
Test Suites / DB Examples Tests (push) Has been cancelled
Test Suites / Test Completion Status (push) Has been cancelled
Test Suites / Claude Code Review (push) Has been cancelled
Test Suites / basic checks (push) Has been cancelled
build | Build and Push Cognee MCP Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
build | Build and Push Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.11) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.12) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (kuzu, kuzu) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (neo4j, neo4j) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Examples (push) Has been cancelled
Weighted Edges Tests / Code Quality for Weighted Edges (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:02:24 +08:00

37 lines
1.5 KiB
Python

from typing import Annotated, Any, Dict, Literal, Optional
from uuid import UUID
from pydantic import Field
from cognee.infrastructure.engine import DataPoint, Embeddable, LLMContext, Dedup
PermissionVerb = Literal["read", "write", "execute", "delete", "share"]
class Tool(DataPoint):
"""
Callable action available to the agentic retriever, scoped to a dataset and a
permission verb. Tools are registered either programmatically (built-in tools
at import time) or as graph-persisted DataPoints emitted by ingest (e.g. a SQL
toolset written when a Postgres source is attached to a dataset).
Instance attributes:
- name: Stable tool identifier used in tool_call messages.
- description: Short summary; embedded so tools are discoverable by vector search.
- input_schema: JSON Schema describing arguments accepted by the handler.
- handler_ref: Dotted path to an async handler function, e.g.
"cognee.modules.tools.builtin.memory_search.handler".
- dataset_id: Dataset this tool operates over. None means globally applicable.
- permission_required: Verb checked via get_authorized_existing_datasets.
- readonly_hint: Advisory flag for agents; does not enforce anything.
"""
name: Annotated[str, Embeddable(), Dedup()]
description: Annotated[str, Embeddable(), LLMContext()]
input_schema: Dict[str, Any] = Field(default_factory=dict)
handler_ref: Annotated[str, Dedup()]
dataset_id: Optional[UUID] = None
permission_required: PermissionVerb = "read"
readonly_hint: bool = True