Skip to content

tools

langroid/agent/special/arangodb/tools.py

AQLRetrievalTool

Bases: ToolMessage

examples() classmethod

Few-shot examples to include in tool instructions.

Source code in langroid/agent/special/arangodb/tools.py
@classmethod
def examples(cls) -> List[ToolMessage | Tuple[str, ToolMessage]]:
    """Few-shot examples to include in tool instructions."""
    return [
        (
            "I want to see who Bob's Father is",
            cls(
                aql_query="""
                FOR v, e, p IN 1..1 OUTBOUND 'users/Bob' GRAPH 'family_tree'
                FILTER p.edges[0].type == 'father'
                RETURN v
                """
            ),
        ),
        (
            "I want to know the properties of the Actor node",
            cls(
                aql_query="""
                FOR doc IN Actor
                LIMIT 1
                RETURN ATTRIBUTES(doc)                    
                """
            ),
        ),
    ]

AQLCreationTool

Bases: ToolMessage

examples() classmethod

Few-shot examples to include in tool instructions.

Source code in langroid/agent/special/arangodb/tools.py
@classmethod
def examples(cls) -> List[ToolMessage | Tuple[str, ToolMessage]]:
    """Few-shot examples to include in tool instructions."""
    return [
        (
            "Create a new document in the collection 'users'",
            cls(
                aql_query="""
                INSERT {
                  "name": "Alice",
                  "age": 30
                } INTO users
                """
            ),
        ),
    ]