You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/categorization.py
+31-41Lines changed: 31 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,18 @@
1
+
importasyncio
2
+
importjson
3
+
importlogging
4
+
importos
1
5
fromdataclassesimportdataclass
2
-
fromtypingimportList, Dict, Any, Optional
3
6
fromenumimportEnum
4
-
importos
5
-
importjson
6
-
importasyncio
7
-
fromopenaiimportOpenAI
8
-
fromloguruimportlogger
7
+
fromtypingimportAny, Dict, List, Optional
9
8
10
9
importdotenv
10
+
fromopenaiimportOpenAI
11
+
11
12
dotenv.load_dotenv()
12
13
14
+
logger=logging.getLogger(__name__)
15
+
13
16
14
17
classMCPCategory(Enum):
15
18
DATABASES="Databases"
@@ -34,6 +37,7 @@ class LLMModel:
34
37
@dataclass
35
38
classCategorizationWorkflowState:
36
39
"""Holds the state for the categorization workflow"""
40
+
37
41
server_name: str=""
38
42
server_description: str=""
39
43
selected_category: Optional[MCPCategory] =None
@@ -42,6 +46,7 @@ class CategorizationWorkflowState:
42
46
@dataclass
43
47
classCategorizationAgentBuildPromptTemplateArgs:
44
48
"""Arguments for building the prompt template"""
49
+
45
50
include_examples: bool=False
46
51
47
52
@@ -57,8 +62,7 @@ def __init__(self):
57
62
58
63
defbuild_system_prompt(self) ->str:
59
64
"""Build the system prompt for the categorization agent"""
60
-
return (
61
-
"""You are an expert at categorizing MCP (Model Context Protocol) servers.
65
+
return"""You are an expert at categorizing MCP (Model Context Protocol) servers.
62
66
Your task is to categorize each server into exactly one of the following categories:
63
67
## 1. Databases
64
68
Systems that connect LLMs to structured data repositories, enabling querying, analysis, and management of various types of databases including relational databases (PostgreSQL, MySQL, MSSQL), NoSQL databases (MongoDB, Redis, ArangoDB), vector databases (Pinecone, Chroma), cloud data warehouses (Snowflake, BigQuery), and search engines (Elasticsearch, Typesense).
0 commit comments