euriai 1.0.7__py3-none-any.whl → 1.0.8__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.
euriai/__init__.py CHANGED
@@ -4,7 +4,7 @@ Euri AI Python SDK
4
4
  A comprehensive Python SDK for the Euri AI API with integrations for popular frameworks.
5
5
  """
6
6
 
7
- __version__ = "1.0.7"
7
+ __version__ = "1.0.8"
8
8
 
9
9
  # Core imports that should always work
10
10
  try:
euriai/autogen.py CHANGED
@@ -9,6 +9,49 @@ except ImportError:
9
9
  autogen = None
10
10
  AssistantAgent = UserProxyAgent = GroupChat = GroupChatManager = None
11
11
 
12
+ def _ensure_autogen_imports():
13
+ """Ensure AutoGen classes are properly imported."""
14
+ global autogen, AssistantAgent, UserProxyAgent, GroupChat, GroupChatManager
15
+
16
+ try:
17
+ # Force re-import of autogen module
18
+ import importlib
19
+ import sys
20
+
21
+ # Remove any cached modules to force fresh import
22
+ if 'autogen' in sys.modules:
23
+ importlib.reload(sys.modules['autogen'])
24
+
25
+ # Import the main module
26
+ import autogen as _autogen
27
+
28
+ # Import individual classes with explicit error handling
29
+ from autogen import AssistantAgent as _AssistantAgent
30
+ from autogen import UserProxyAgent as _UserProxyAgent
31
+ from autogen import GroupChat as _GroupChat
32
+ from autogen import GroupChatManager as _GroupChatManager
33
+
34
+ # Verify that all classes are not None
35
+ if _AssistantAgent is None or _UserProxyAgent is None:
36
+ raise ImportError("AutoGen classes imported as None")
37
+
38
+ # Update global variables
39
+ autogen = _autogen
40
+ AssistantAgent = _AssistantAgent
41
+ UserProxyAgent = _UserProxyAgent
42
+ GroupChat = _GroupChat
43
+ GroupChatManager = _GroupChatManager
44
+
45
+ # Verify the globals were updated
46
+ if AssistantAgent is None:
47
+ raise ImportError("Failed to update global AssistantAgent variable")
48
+
49
+ return True
50
+
51
+ except ImportError as e:
52
+ from . import check_optional_dependency
53
+ check_optional_dependency("pyautogen", "AutoGen", "autogen")
54
+
12
55
  class EuriaiModelClient:
13
56
  """
14
57
  Custom model client that uses Euri API for AutoGen integration.
@@ -197,9 +240,7 @@ class EuriaiAutoGen:
197
240
  api_key: Your Euri API key
198
241
  default_model: Default model to use
199
242
  """
200
- if autogen is None or AssistantAgent is None or UserProxyAgent is None:
201
- from . import check_optional_dependency
202
- check_optional_dependency("pyautogen", "AutoGen", "autogen")
243
+ _ensure_autogen_imports()
203
244
 
204
245
  self.api_key = api_key
205
246
  self.default_model = default_model
@@ -216,7 +257,7 @@ class EuriaiAutoGen:
216
257
  temperature: float = 0.7,
217
258
  max_tokens: int = 1000,
218
259
  **kwargs
219
- ) -> AssistantAgent:
260
+ ) -> "AssistantAgent":
220
261
  """
221
262
  Create an assistant agent with Euri API integration.
222
263
 
@@ -231,8 +272,13 @@ class EuriaiAutoGen:
231
272
  Returns:
232
273
  Configured AssistantAgent
233
274
  """
234
- # Check if AutoGen is properly imported
235
- if AssistantAgent is None:
275
+ # Import AutoGen classes directly to ensure they're available
276
+ try:
277
+ from autogen import AssistantAgent
278
+ # Verify the class is not None
279
+ if AssistantAgent is None:
280
+ raise ImportError("AutoGen AssistantAgent class is None")
281
+ except ImportError:
236
282
  from . import check_optional_dependency
237
283
  check_optional_dependency("pyautogen", "AutoGen", "autogen")
238
284
 
@@ -265,7 +311,7 @@ class EuriaiAutoGen:
265
311
  is_termination_msg: Optional[callable] = None,
266
312
  code_execution_config: Optional[Dict[str, Any]] = None,
267
313
  **kwargs
268
- ) -> UserProxyAgent:
314
+ ) -> "UserProxyAgent":
269
315
  """
270
316
  Create a user proxy agent.
271
317
 
@@ -278,8 +324,13 @@ class EuriaiAutoGen:
278
324
  Returns:
279
325
  Configured UserProxyAgent
280
326
  """
281
- # Check if AutoGen is properly imported
282
- if UserProxyAgent is None:
327
+ # Import AutoGen classes directly to ensure they're available
328
+ try:
329
+ from autogen import UserProxyAgent
330
+ # Verify the class is not None
331
+ if UserProxyAgent is None:
332
+ raise ImportError("AutoGen UserProxyAgent class is None")
333
+ except ImportError:
283
334
  from . import check_optional_dependency
284
335
  check_optional_dependency("pyautogen", "AutoGen", "autogen")
285
336
 
@@ -316,10 +367,8 @@ class EuriaiAutoGen:
316
367
  Returns:
317
368
  Configured GroupChat
318
369
  """
319
- # Check if AutoGen is properly imported
320
- if GroupChat is None:
321
- from . import check_optional_dependency
322
- check_optional_dependency("pyautogen", "AutoGen", "autogen")
370
+ # Ensure AutoGen classes are properly imported
371
+ _ensure_autogen_imports()
323
372
 
324
373
  self.group_chat = GroupChat(
325
374
  agents=agents,
@@ -353,10 +402,8 @@ class EuriaiAutoGen:
353
402
  Returns:
354
403
  Configured GroupChatManager
355
404
  """
356
- # Check if AutoGen is properly imported
357
- if GroupChatManager is None:
358
- from . import check_optional_dependency
359
- check_optional_dependency("pyautogen", "AutoGen", "autogen")
405
+ # Ensure AutoGen classes are properly imported
406
+ _ensure_autogen_imports()
360
407
 
361
408
  # Create config for Euri API
362
409
  config_list = [{
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euriai
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: Python client for Euri API (euron.one) with CLI, LangChain, and LlamaIndex integration
5
5
  Author: Euri
6
6
  Author-email: tech@euron.one
@@ -1,5 +1,5 @@
1
- euriai/__init__.py,sha256=Dvycjk0FyVASMXaSDBMHzpCsfJlJlmO6nLNtZ9rvrRs,6629
2
- euriai/autogen.py,sha256=7lT_T1RT9RdytrSwbj3UhQ6_mVdoMy4Mr7y4HdWDPkc,16961
1
+ euriai/__init__.py,sha256=gfkPrWaBzOwtzPHz4IaRIkr2euZTec0me8nMtxOlOeQ,6629
2
+ euriai/autogen.py,sha256=1AkzH0ctH4vR6kbPzYNzR2J6n9kdDpZIx9qQGgxl-Bg,18611
3
3
  euriai/cli.py,sha256=hF1wiiL2QQSfWf8WlLQyNVDBd4YkbiwmMSoPxVbyPTM,3290
4
4
  euriai/client.py,sha256=L-o6hv9N3md-l-hz-kz5nYVaaZqnrREZlo_0jguhF7E,4066
5
5
  euriai/crewai.py,sha256=nfMMOOhKiCIc2v42nj2Zf9rP0U5m4GrfK_6zkXL77gw,7594
@@ -12,8 +12,8 @@ euriai/langgraph.py,sha256=sw9e-PnfwAwmp_tUCnAGIUB78GyJsMkAzxOGvFUafiM,34128
12
12
  euriai/llamaindex.py,sha256=c-ujod2bjL6QIvfAyuIxm1SvSCS00URFElYybKQ5Ew0,26551
13
13
  euriai/n8n.py,sha256=hjkckqyW_hZNL78UkBCof1WvKCKCIjwdvZdAgx6NrB8,3764
14
14
  euriai/smolagents.py,sha256=xlixGx2IWzAPTpSJGsYIK2L-SHGY9Mw1-8GbwVsEYtU,28507
15
- euriai-1.0.7.dist-info/METADATA,sha256=gxZb_093o7FZ1-G599QQ6HCEuUpEPCMS-OXz72siVHE,6806
16
- euriai-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- euriai-1.0.7.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
18
- euriai-1.0.7.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
19
- euriai-1.0.7.dist-info/RECORD,,
15
+ euriai-1.0.8.dist-info/METADATA,sha256=SrcXi2Fcm7qHODmX1Du_XptolZTWvWR3WIXHfRYVGXs,6806
16
+ euriai-1.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ euriai-1.0.8.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
18
+ euriai-1.0.8.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
19
+ euriai-1.0.8.dist-info/RECORD,,
File without changes