MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / __init__

Method __init__

bmtools/tools/tool.py:26–92  ·  view source on GitHub ↗

Diagram: Root API server (ToolServer object) │ ├───── "./weather": Tool object │ ├── "./get_weather_today": function_get_weather(location: str) -> str │ ├── "./get_weather_forecast": function_get_weather_forcast(

(
            self,
            tool_name : str,
            description : str,
            name_for_human : Optional[str] = None,
            name_for_model : Optional[str] = None,
            description_for_human : Optional[str] = None,
            description_for_model : Optional[str] = None,
            logo_url : Optional[str] = None,
            author_github : Optional[str] = None,
            contact_email : str = "",
            legal_info_url : str = "",
            version : str = "0.1.0",
        )

Source from the content-addressed store, hash-verified

24 """
25
26 def __init__(
27 self,
28 tool_name : str,
29 description : str,
30 name_for_human : Optional[str] = None,
31 name_for_model : Optional[str] = None,
32 description_for_human : Optional[str] = None,
33 description_for_model : Optional[str] = None,
34 logo_url : Optional[str] = None,
35 author_github : Optional[str] = None,
36 contact_email : str = "",
37 legal_info_url : str = "",
38 version : str = "0.1.0",
39 ):
40 """
41 Diagram:
42 Root API server (ToolServer object)
43
44 ├───── "./weather": Tool object
45 │ ├── "./get_weather_today": function_get_weather(location: str) -> str
46 │ ├── "./get_weather_forecast": function_get_weather_forcast(location: str, day_offset: int) -> str
47 │ └── "...more routes"
48 ├───── "./wikidata": Tool object
49 │ ├── "... more routes"
50 └───── "... more routes"
51 """
52 super().__init__(
53 title=tool_name,
54 description=description,
55 version=version,
56 )
57
58 if name_for_human is None:
59 name_for_human = tool_name
60 if name_for_model is None:
61 name_for_model = name_for_human
62 if description_for_human is None:
63 description_for_human = description
64 if description_for_model is None:
65 description_for_model = description_for_human
66
67 self.api_info = {
68 "schema_version": "v1",
69 "name_for_human": name_for_human,
70 "name_for_model": name_for_model,
71 "description_for_human": description_for_human,
72 "description_for_model": description_for_model,
73 "auth": {
74 "type": "none",
75 },
76 "api": {
77 "type": "openapi",
78 "url": "/openapi.json",
79 "is_user_authenticated": False,
80 },
81 "author_github": author_github,
82 "logo_url": logo_url,
83 "contact_email": contact_email,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected