Spaces:
Running
Running
Download src/processor/tools/executor.py from Jakob08/moneychatbot: direct link, hf CLI and curl.
- Browser
- Download file 575 Bytes
-
https://huggingface.co/spaces/Jakob08/moneychatbot/resolve/main/src/processor/tools/executor.py
- Command line
-
hf download hf://spaces/Jakob08/moneychatbot/src/processor/tools/executor.py
-
curl -L -o executor.py https://huggingface.co/spaces/Jakob08/moneychatbot/resolve/main/src/processor/tools/executor.py
575 Bytes
| # | |
| # SPDX-FileCopyrightText: Hadad <hadad@linuxmail.org> | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| def tools_call(search_engine, function_name, function_params): | |
| if function_name == "web_search": | |
| return search_engine.perform_search( | |
| search_query=function_params.get("query", ""), | |
| search_provider=function_params.get("engine", "google") | |
| ) | |
| if function_name == "read_url": | |
| return search_engine.extract_page_content( | |
| target_url=function_params.get("url", "") | |
| ) | |
| return f"Unknown tool: {function_name}" |