File size: 393 Bytes
ceb70c7
 
 
 
 
 
 
4359d28
ceb70c7
 
4359d28
ceb70c7
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# SPDX-FileCopyrightText: Hadad <hadad@linuxmail.org>
# SPDX-License-Identifier: Apache-2.0
#

import json

def tools_parser(raw_parameters):
    try:
        parsed_params = json.loads(raw_parameters or "{}")
        parsed_params["engine"] = "google"
        return parsed_params, None
    except Exception as parse_error:
        return None, f"Invalid tool arguments: {str(parse_error)}"