suse-documentation-mcp-server 0.9.0__tar.gz → 0.11.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/PKG-INFO +1 -1
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/pyproject.toml +1 -1
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/server/search_suse_documentation.py +23 -5
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/suse_documentation_mcp_server.egg-info/PKG-INFO +1 -1
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/README.md +0 -0
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/setup.cfg +0 -0
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/suse_documentation_mcp_server.egg-info/SOURCES.txt +0 -0
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/suse_documentation_mcp_server.egg-info/dependency_links.txt +0 -0
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/suse_documentation_mcp_server.egg-info/entry_points.txt +0 -0
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/suse_documentation_mcp_server.egg-info/requires.txt +0 -0
- {suse_documentation_mcp_server-0.9.0 → suse_documentation_mcp_server-0.11.0}/suse_documentation_mcp_server.egg-info/top_level.txt +0 -0
@@ -32,6 +32,7 @@ def get_web_search_results_from_oi(query):
|
|
32
32
|
"collection_name": "your_collection_name"
|
33
33
|
}
|
34
34
|
|
35
|
+
print("Inside get_web_search_results_from_oi:", query)
|
35
36
|
search_response = requests.post(f"{base_url}/search", headers=headers, json=search_payload)
|
36
37
|
if search_response.status_code != 200:
|
37
38
|
raise Exception(f"Search API call failed: {search_response.status_code} - {search_response.text}")
|
@@ -73,23 +74,40 @@ def get_web_search_results_from_oi(query):
|
|
73
74
|
return combined_response
|
74
75
|
|
75
76
|
@mcp.tool()
|
76
|
-
async def get_web_search_results(
|
77
|
+
async def get_web_search_results(input_data: Any) -> str:
|
77
78
|
"""
|
78
79
|
Search SUSE documentation using web search and return results.
|
79
80
|
|
80
81
|
This function is designed to perform a web search on the SUSE documentation
|
81
82
|
for a given query and return the results. The function takes a search query as
|
82
|
-
a string,
|
83
|
-
the content from the search results.
|
83
|
+
a string, JSON object, or dictionary, normalizes it, performs the web search,
|
84
|
+
and returns a formatted string containing the content from the search results.
|
84
85
|
|
85
86
|
Args:
|
86
|
-
|
87
|
-
Examples:
|
87
|
+
input_data (Any): Web search query, either as a string, JSON object, or dictionary.
|
88
|
+
Examples:
|
89
|
+
- "sriov in rke2"
|
90
|
+
- {"query": "how to configure suse manager"}
|
91
|
+
- {"queries": "latest rancher version"}
|
88
92
|
|
89
93
|
Returns:
|
90
94
|
str: Combined content from the search results, cleaned and formatted
|
91
95
|
"""
|
92
96
|
try:
|
97
|
+
# Normalize input to extract the query string
|
98
|
+
if isinstance(input_data, str):
|
99
|
+
query = input_data
|
100
|
+
elif isinstance(input_data, dict):
|
101
|
+
query = input_data.get("query") or input_data.get("queries")
|
102
|
+
if not query:
|
103
|
+
raise ValueError("Input dictionary must contain 'query' or 'queries' key.")
|
104
|
+
else:
|
105
|
+
raise TypeError("Input must be a string or a dictionary containing 'query' or 'queries'.")
|
106
|
+
|
107
|
+
# Ensure query is a string
|
108
|
+
if not isinstance(query, str):
|
109
|
+
raise ValueError("The extracted query must be a string.")
|
110
|
+
print("Before web search:", query)
|
93
111
|
return get_web_search_results_from_oi(query)
|
94
112
|
except Exception as e:
|
95
113
|
return f"Error performing web search: {str(e)}\n\n{query}"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|