agent-mcp 0.1.3__py3-none-any.whl → 0.1.4__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.
- agent_mcp/__init__.py +2 -2
- agent_mcp/camel_mcp_adapter.py +521 -0
- agent_mcp/cli.py +47 -0
- agent_mcp/heterogeneous_group_chat.py +412 -38
- agent_mcp/langchain_mcp_adapter.py +176 -43
- agent_mcp/mcp_agent.py +26 -0
- agent_mcp/mcp_transport.py +11 -5
- {agent_mcp-0.1.3.dist-info → agent_mcp-0.1.4.dist-info}/METADATA +6 -4
- agent_mcp-0.1.4.dist-info/RECORD +49 -0
- {agent_mcp-0.1.3.dist-info → agent_mcp-0.1.4.dist-info}/WHEEL +1 -1
- agent_mcp-0.1.4.dist-info/entry_points.txt +2 -0
- agent_mcp-0.1.4.dist-info/top_level.txt +3 -0
- demos/__init__.py +1 -0
- demos/basic/__init__.py +1 -0
- demos/basic/framework_examples.py +108 -0
- demos/basic/langchain_camel_demo.py +272 -0
- demos/basic/simple_chat.py +355 -0
- demos/basic/simple_integration_example.py +51 -0
- demos/collaboration/collaborative_task_example.py +437 -0
- demos/collaboration/group_chat_example.py +130 -0
- demos/collaboration/simplified_crewai_example.py +39 -0
- demos/langgraph/autonomous_langgraph_network.py +808 -0
- demos/langgraph/langgraph_agent_network.py +415 -0
- demos/langgraph/langgraph_collaborative_task.py +619 -0
- demos/langgraph/langgraph_example.py +227 -0
- demos/langgraph/run_langgraph_examples.py +213 -0
- demos/network/agent_network_example.py +381 -0
- demos/network/email_agent.py +130 -0
- demos/network/email_agent_demo.py +46 -0
- demos/network/heterogeneous_network_example.py +216 -0
- demos/network/multi_framework_example.py +199 -0
- demos/utils/check_imports.py +49 -0
- demos/workflows/autonomous_agent_workflow.py +248 -0
- demos/workflows/mcp_features_demo.py +353 -0
- demos/workflows/run_agent_collaboration_demo.py +63 -0
- demos/workflows/run_agent_collaboration_with_logs.py +396 -0
- demos/workflows/show_agent_interactions.py +107 -0
- demos/workflows/simplified_autonomous_demo.py +74 -0
- functions/main.py +144 -0
- functions/mcp_network_server.py +513 -0
- functions/utils.py +47 -0
- agent_mcp-0.1.3.dist-info/RECORD +0 -18
- agent_mcp-0.1.3.dist-info/entry_points.txt +0 -2
- agent_mcp-0.1.3.dist-info/top_level.txt +0 -1
functions/utils.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from typing import Dict, List, Any, Union
|
|
2
|
+
import datetime
|
|
3
|
+
|
|
4
|
+
# Import the specific Firestore timestamp types
|
|
5
|
+
try:
|
|
6
|
+
from google.cloud.firestore_v1.base_document import DatetimeWithNanoseconds
|
|
7
|
+
except ImportError:
|
|
8
|
+
# Handle cases where the specific type might not be directly importable
|
|
9
|
+
# or if using an older/different version of the library.
|
|
10
|
+
DatetimeWithNanoseconds = None # Rely on datetime.datetime check
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
# Also handle the base Timestamp type
|
|
14
|
+
from google.cloud.firestore_v1.types.base import Timestamp
|
|
15
|
+
except ImportError:
|
|
16
|
+
Timestamp = None # Rely on datetime.datetime check if this fails
|
|
17
|
+
|
|
18
|
+
# Define the types to check against - use tuple for isinstance
|
|
19
|
+
TIMESTAMP_TYPES = (datetime.datetime,) # datetime.datetime covers DatetimeWithNanoseconds
|
|
20
|
+
if Timestamp:
|
|
21
|
+
TIMESTAMP_TYPES += (Timestamp,)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def convert_timestamps_to_isoformat(data: Union[Dict, List, Any]) -> Union[Dict, List, Any]:
|
|
25
|
+
"""Recursively convert Firestore/datetime timestamp fields to ISO format strings."""
|
|
26
|
+
if isinstance(data, dict):
|
|
27
|
+
# Recursively process dictionary values
|
|
28
|
+
return {k: convert_timestamps_to_isoformat(v) for k, v in data.items()}
|
|
29
|
+
elif isinstance(data, list):
|
|
30
|
+
# Recursively process list items
|
|
31
|
+
return [convert_timestamps_to_isoformat(item) for item in data]
|
|
32
|
+
elif isinstance(data, TIMESTAMP_TYPES):
|
|
33
|
+
# Check if the item is one of the timestamp types we handle
|
|
34
|
+
try:
|
|
35
|
+
# Ensure timezone info is present (assume UTC if naive)
|
|
36
|
+
if data.tzinfo is None:
|
|
37
|
+
dt_aware = data.replace(tzinfo=datetime.timezone.utc)
|
|
38
|
+
else:
|
|
39
|
+
dt_aware = data
|
|
40
|
+
return dt_aware.isoformat()
|
|
41
|
+
except Exception as e:
|
|
42
|
+
# Fallback in case isoformat fails for some reason
|
|
43
|
+
print(f"Warning: Could not convert timestamp {data} to ISO format: {e}")
|
|
44
|
+
return str(data) # Convert to basic string as fallback
|
|
45
|
+
else:
|
|
46
|
+
# Return data unchanged if it's not a dict, list, or known timestamp type
|
|
47
|
+
return data
|
agent_mcp-0.1.3.dist-info/RECORD
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
agent_mcp/__init__.py,sha256=zc1ZfkK7pNKWzl5BLIxmLc8WMPnGWpQ3WJSvDUWe2eo,494
|
|
2
|
-
agent_mcp/crewai_mcp_adapter.py,sha256=WbJNr4d6lQuesQ-ONKIt0KE1XsLN1Yl5Hh3Fo3dVwx8,12073
|
|
3
|
-
agent_mcp/enhanced_mcp_agent.py,sha256=DJyyL0Cf6Qp0mIAgu4uV4y1wueinl6W0UN3idn2B0Ds,28813
|
|
4
|
-
agent_mcp/heterogeneous_group_chat.py,sha256=OCuqjH_4VtSE7VWM5u0sMldlq7Y3OjKTU2D7IuuJGe0,20556
|
|
5
|
-
agent_mcp/langchain_mcp_adapter.py,sha256=S3vyD0j75cruknMjuHXFrZYx2gkKGhfyYFaiNK2-f2g,16069
|
|
6
|
-
agent_mcp/langgraph_mcp_adapter.py,sha256=eIiW3P2MBrEzLHHKpPBd4Rci5EFLAaOQrnSILH4RWBM,14028
|
|
7
|
-
agent_mcp/mcp_agent.py,sha256=WkITvLx7xPWQL2NSRNhCg_rl22EksO-o5oX50Fz5cOY,24612
|
|
8
|
-
agent_mcp/mcp_decorator.py,sha256=CDhq9jDliY0cnpc5JiJj2u8uC9nAHMEQaW7G2e1MapA,12126
|
|
9
|
-
agent_mcp/mcp_langgraph.py,sha256=TdhHVwXzrM-Oe2dy-biR1lIQ1f37LxQlkeE147v5hG8,26975
|
|
10
|
-
agent_mcp/mcp_transaction.py,sha256=iSr_DSFSMAU30TEQMTHbHDNooy1w80CkF9tIGKHbqZQ,3069
|
|
11
|
-
agent_mcp/mcp_transport.py,sha256=pyrcDIKevMmqy4Uc9dHmTCgvhJtAQwSBEtYwKUd4qUk,35126
|
|
12
|
-
agent_mcp/mcp_transport_enhanced.py,sha256=RSkHQ_fUXaFI7_6wZk5oAF3vSIM_mgvpTcJrRX_tuDE,1711
|
|
13
|
-
agent_mcp/proxy_agent.py,sha256=YAlOoEpKSO5hGF638kS_XJfKa-pIgY2pS6Z3J9XF1-4,1038
|
|
14
|
-
agent_mcp-0.1.3.dist-info/METADATA,sha256=N-FJk-FJ_qVDsLMJ5s5u2CLhY5Z-aU4JOzOecgpvY0s,11323
|
|
15
|
-
agent_mcp-0.1.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
16
|
-
agent_mcp-0.1.3.dist-info/entry_points.txt,sha256=6wJ3TtpqqkX4cL5kz1ZUCc7f8xUI7bUbDk4oSXMQswE,61
|
|
17
|
-
agent_mcp-0.1.3.dist-info/top_level.txt,sha256=f130_t3z42hdpoMm0bBj6JRxw0COUs5CUwo7Qd3BDog,10
|
|
18
|
-
agent_mcp-0.1.3.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
agent_mcp
|