MindsDB 25.5.4.0__py3-none-any.whl → 25.5.4.1__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.
Potentially problematic release.
This version of MindsDB might be problematic. Click here for more details.
- mindsdb/__about__.py +8 -8
- mindsdb/api/a2a/__main__.py +38 -8
- mindsdb/api/a2a/run_a2a.py +10 -53
- mindsdb/api/a2a/task_manager.py +19 -53
- mindsdb/api/executor/command_executor.py +147 -291
- mindsdb/api/http/namespaces/config.py +61 -86
- mindsdb/integrations/handlers/byom_handler/requirements.txt +1 -2
- mindsdb/integrations/handlers/lancedb_handler/requirements.txt +0 -1
- mindsdb/integrations/handlers/litellm_handler/litellm_handler.py +37 -20
- mindsdb/integrations/libs/llm/config.py +13 -0
- mindsdb/integrations/libs/llm/utils.py +37 -65
- mindsdb/integrations/utilities/rag/rerankers/base_reranker.py +230 -227
- mindsdb/interfaces/agents/constants.py +17 -13
- mindsdb/interfaces/agents/langchain_agent.py +93 -94
- mindsdb/interfaces/knowledge_base/controller.py +230 -221
- mindsdb/utilities/config.py +43 -84
- {mindsdb-25.5.4.0.dist-info → mindsdb-25.5.4.1.dist-info}/METADATA +261 -259
- {mindsdb-25.5.4.0.dist-info → mindsdb-25.5.4.1.dist-info}/RECORD +21 -25
- mindsdb/api/a2a/a2a_client.py +0 -439
- mindsdb/api/a2a/common/client/__init__.py +0 -4
- mindsdb/api/a2a/common/client/card_resolver.py +0 -21
- mindsdb/api/a2a/common/client/client.py +0 -86
- {mindsdb-25.5.4.0.dist-info → mindsdb-25.5.4.1.dist-info}/WHEEL +0 -0
- {mindsdb-25.5.4.0.dist-info → mindsdb-25.5.4.1.dist-info}/licenses/LICENSE +0 -0
- {mindsdb-25.5.4.0.dist-info → mindsdb-25.5.4.1.dist-info}/top_level.txt +0 -0
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import httpx
|
|
2
|
-
from httpx_sse import connect_sse
|
|
3
|
-
from typing import Any, AsyncIterable
|
|
4
|
-
from common.types import (
|
|
5
|
-
AgentCard,
|
|
6
|
-
GetTaskRequest,
|
|
7
|
-
SendTaskRequest,
|
|
8
|
-
SendTaskResponse,
|
|
9
|
-
JSONRPCRequest,
|
|
10
|
-
GetTaskResponse,
|
|
11
|
-
CancelTaskResponse,
|
|
12
|
-
CancelTaskRequest,
|
|
13
|
-
SetTaskPushNotificationRequest,
|
|
14
|
-
SetTaskPushNotificationResponse,
|
|
15
|
-
GetTaskPushNotificationRequest,
|
|
16
|
-
GetTaskPushNotificationResponse,
|
|
17
|
-
A2AClientHTTPError,
|
|
18
|
-
A2AClientJSONError,
|
|
19
|
-
SendTaskStreamingRequest,
|
|
20
|
-
SendTaskStreamingResponse,
|
|
21
|
-
)
|
|
22
|
-
import json
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class A2AClient:
|
|
26
|
-
def __init__(self, agent_card: AgentCard = None, url: str = None):
|
|
27
|
-
if agent_card:
|
|
28
|
-
self.url = agent_card.url
|
|
29
|
-
elif url:
|
|
30
|
-
self.url = url
|
|
31
|
-
else:
|
|
32
|
-
raise ValueError("Must provide either agent_card or url")
|
|
33
|
-
|
|
34
|
-
async def send_task(self, payload: dict[str, Any]) -> SendTaskResponse:
|
|
35
|
-
request = SendTaskRequest(params=payload)
|
|
36
|
-
return SendTaskResponse(**await self._send_request(request))
|
|
37
|
-
|
|
38
|
-
async def send_task_streaming(
|
|
39
|
-
self, payload: dict[str, Any]
|
|
40
|
-
) -> AsyncIterable[SendTaskStreamingResponse]:
|
|
41
|
-
request = SendTaskStreamingRequest(params=payload)
|
|
42
|
-
with httpx.Client(timeout=None) as client:
|
|
43
|
-
with connect_sse(
|
|
44
|
-
client, "POST", self.url, json=request.model_dump()
|
|
45
|
-
) as event_source:
|
|
46
|
-
try:
|
|
47
|
-
for sse in event_source.iter_sse():
|
|
48
|
-
yield SendTaskStreamingResponse(**json.loads(sse.data))
|
|
49
|
-
except json.JSONDecodeError as e:
|
|
50
|
-
raise A2AClientJSONError(str(e)) from e
|
|
51
|
-
except httpx.RequestError as e:
|
|
52
|
-
raise A2AClientHTTPError(400, str(e)) from e
|
|
53
|
-
|
|
54
|
-
async def _send_request(self, request: JSONRPCRequest) -> dict[str, Any]:
|
|
55
|
-
async with httpx.AsyncClient() as client:
|
|
56
|
-
try:
|
|
57
|
-
# Image generation could take time, adding timeout
|
|
58
|
-
response = await client.post(
|
|
59
|
-
self.url, json=request.model_dump(), timeout=30
|
|
60
|
-
)
|
|
61
|
-
response.raise_for_status()
|
|
62
|
-
return response.json()
|
|
63
|
-
except httpx.HTTPStatusError as e:
|
|
64
|
-
raise A2AClientHTTPError(e.response.status_code, str(e)) from e
|
|
65
|
-
except json.JSONDecodeError as e:
|
|
66
|
-
raise A2AClientJSONError(str(e)) from e
|
|
67
|
-
|
|
68
|
-
async def get_task(self, payload: dict[str, Any]) -> GetTaskResponse:
|
|
69
|
-
request = GetTaskRequest(params=payload)
|
|
70
|
-
return GetTaskResponse(**await self._send_request(request))
|
|
71
|
-
|
|
72
|
-
async def cancel_task(self, payload: dict[str, Any]) -> CancelTaskResponse:
|
|
73
|
-
request = CancelTaskRequest(params=payload)
|
|
74
|
-
return CancelTaskResponse(**await self._send_request(request))
|
|
75
|
-
|
|
76
|
-
async def set_task_callback(
|
|
77
|
-
self, payload: dict[str, Any]
|
|
78
|
-
) -> SetTaskPushNotificationResponse:
|
|
79
|
-
request = SetTaskPushNotificationRequest(params=payload)
|
|
80
|
-
return SetTaskPushNotificationResponse(**await self._send_request(request))
|
|
81
|
-
|
|
82
|
-
async def get_task_callback(
|
|
83
|
-
self, payload: dict[str, Any]
|
|
84
|
-
) -> GetTaskPushNotificationResponse:
|
|
85
|
-
request = GetTaskPushNotificationRequest(params=payload)
|
|
86
|
-
return GetTaskPushNotificationResponse(**await self._send_request(request))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|