Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
| from langchain.agents import Tool | |
| from langchain_core.tools import StructuredTool | |
| from config import SanatanConfig | |
| from push_notifications_helper import push | |
| from serperdev_helper import search as search_web | |
| from sanatan_assistant import format_scripture_answer, query | |
| tool_push = Tool( | |
| name="push", description="Send a push notification to the user", func=push | |
| ) | |
| allowed_collections = [s["collection_name"] for s in SanatanConfig.scriptures] | |
| tool_search_db = StructuredTool.from_function( | |
| query, | |
| description=( | |
| "Search within a specific scripture collection. " | |
| f"The collection_name must be one of: {', '.join(allowed_collections)}." | |
| " Use this to find relevant scripture verses or explanations." | |
| ), | |
| ) | |
| tool_search_web = Tool( | |
| name="search_web", description="Search the web for information", func=search_web | |
| ) | |
| tool_format_scripture_answer = StructuredTool.from_function(format_scripture_answer) | |