File size: 4,075 Bytes
ce0bf87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d0f82e
ce0bf87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
773eb83
ce0bf87
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
"""
Enhanced Search Functions for Native Function Calling
This file defines all the function calling schemas for the enhanced research system
"""

ENHANCED_SEARCH_FUNCTIONS = [
    {
        "type": "function",
        "function": {
            "name": "search_web",
            "description": "Search the web for current information and real-time data using DuckDuckGo",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string",
                        "description": "The search query to find current information relevant to the expert analysis"
                    },
                    "depth": {
                        "type": "string",
                        "enum": ["standard", "deep"],
                        "description": "Search depth - 'standard' for single source, 'deep' for multi-source synthesis",
                        "default": "standard"
                    }
                },
                "required": ["query"]
            }
        }
    },
    {
        "type": "function", 
        "function": {
            "name": "search_wikipedia",
            "description": "Search Wikipedia for comprehensive background information and authoritative encyclopedic data",
            "parameters": {
                "type": "object",
                "properties": {
                    "topic": {
                        "type": "string",
                        "description": "The topic to research on Wikipedia for comprehensive background information"
                    }
                },
                "required": ["topic"]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "search_academic",
            "description": "Search academic papers and research on arXiv for scientific evidence",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string",
                        "description": "Academic research query to find peer-reviewed papers and scientific studies"
                    }
                },
                "required": ["query"]
            }
        }
    },
    {
        "type": "function", 
        "function": {
            "name": "search_technology_trends",
            "description": "Search GitHub for technology adoption, development trends, and open source activity",
            "parameters": {
                "type": "object",
                "properties": {
                    "technology": {
                        "type": "string",
                        "description": "Technology, framework, or programming language to research for adoption trends"
                    }
                },
                "required": ["technology"]
            }
        }
    },
    {
        "type": "function",
        "function": {
            "name": "search_financial_data", 
            "description": "Search SEC EDGAR filings and financial data for public companies",
            "parameters": {
                "type": "object",
                "properties": {
                    "company": {
                        "type": "string",
                        "description": "Company name or ticker symbol to research financial data and SEC filings"
                    }
                },
                "required": ["company"]
            }
        }
    }
]

def get_function_definitions():
    """Get the complete function definitions for API calls"""
    return ENHANCED_SEARCH_FUNCTIONS

def get_function_names():
    """Get list of all available function names"""
    return [func["function"]["name"] for func in ENHANCED_SEARCH_FUNCTIONS]

# Function routing map for backward compatibility
FUNCTION_ROUTING = {
    "search_web": "web_search",
    "search_wikipedia": "wikipedia_search", 
    "search_academic": "academic_search",
    "search_technology_trends": "github_search",
    "search_financial_data": "sec_search"
}