File size: 433 Bytes
ca00577
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from typing import Any, Optional
from smolagents.tools import Tool

class CustomTool(Tool):
    name = "custom_tool"
    description = "A custom test tool"
    inputs = {'input_text': {'type': 'string', 'description': 'Some input text'}}
    output_type = "string"

    def forward(self, input_text: str) -> str:
        return f"Processed: {input_text}"

    def __init__(self, *args, **kwargs):
        self.is_initialized = False