sunholo 0.143.15__py3-none-any.whl → 0.144.0__py3-none-any.whl
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.
- sunholo/agents/dispatch_to_qa.py +16 -2
- sunholo/agents/fastapi/__init__.py +2 -1
- sunholo/agents/fastapi/vac_routes.py +1017 -0
- sunholo/mcp/cli.py +22 -338
- sunholo/mcp/cli_fastmcp.py +201 -0
- sunholo/mcp/stdio_http_bridge.py +7 -7
- sunholo/mcp/vac_mcp_server.py +4 -247
- sunholo/mcp/vac_mcp_server_fastmcp.py +193 -0
- sunholo/streaming/streaming.py +26 -6
- {sunholo-0.143.15.dist-info → sunholo-0.144.0.dist-info}/METADATA +12 -10
- {sunholo-0.143.15.dist-info → sunholo-0.144.0.dist-info}/RECORD +15 -12
- {sunholo-0.143.15.dist-info → sunholo-0.144.0.dist-info}/WHEEL +0 -0
- {sunholo-0.143.15.dist-info → sunholo-0.144.0.dist-info}/entry_points.txt +0 -0
- {sunholo-0.143.15.dist-info → sunholo-0.144.0.dist-info}/licenses/LICENSE.txt +0 -0
- {sunholo-0.143.15.dist-info → sunholo-0.144.0.dist-info}/top_level.txt +0 -0
sunholo/agents/dispatch_to_qa.py
CHANGED
@@ -15,12 +15,17 @@ from ..custom_logging import log
|
|
15
15
|
from ..utils import ConfigManager
|
16
16
|
from ..auth import get_header
|
17
17
|
import requests
|
18
|
-
import aiohttp
|
19
18
|
from .langserve import prepare_request_data
|
20
19
|
import traceback
|
21
20
|
from .route import route_endpoint
|
22
21
|
import os
|
23
22
|
|
23
|
+
try:
|
24
|
+
import aiohttp
|
25
|
+
AIOHTTP_AVAILABLE = True
|
26
|
+
except ImportError:
|
27
|
+
AIOHTTP_AVAILABLE = False
|
28
|
+
|
24
29
|
|
25
30
|
def prep_request_payload(user_input, chat_history, vector_name, stream, **kwargs):
|
26
31
|
"""
|
@@ -177,7 +182,16 @@ async def send_to_qa_async(user_input, vector_name, chat_history, stream=False,
|
|
177
182
|
async for response_chunk in send_to_qa_async("What is AI?", "my_vector", []):
|
178
183
|
print(response_chunk)
|
179
184
|
```
|
180
|
-
|
185
|
+
|
186
|
+
Raises:
|
187
|
+
ImportError: If aiohttp is not installed.
|
188
|
+
"""
|
189
|
+
if not AIOHTTP_AVAILABLE:
|
190
|
+
raise ImportError(
|
191
|
+
"aiohttp is required for async operations. "
|
192
|
+
"Install it with: pip install aiohttp or pip install sunholo[http]"
|
193
|
+
)
|
194
|
+
|
181
195
|
qna_endpoint, qna_data = prep_request_payload(user_input, chat_history, vector_name, stream, **kwargs)
|
182
196
|
header = get_header(vector_name)
|
183
197
|
header = add_header_ids(header, **kwargs)
|