euriai 1.0.7__py3-none-any.whl → 1.0.9__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.9"
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,10 +272,15 @@ 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 AssistantAgent class
276
+ try:
277
+ from autogen import AssistantAgent
278
+ except ImportError:
236
279
  from . import check_optional_dependency
237
280
  check_optional_dependency("pyautogen", "AutoGen", "autogen")
281
+ # This line will never be reached if AutoGen is missing
282
+ # because check_optional_dependency raises ImportError
283
+ raise # Re-raise the original ImportError
238
284
 
239
285
  # Create config for Euri API
240
286
  config_list = [{
@@ -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,10 +324,15 @@ 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 UserProxyAgent class
328
+ try:
329
+ from autogen import UserProxyAgent
330
+ except ImportError:
283
331
  from . import check_optional_dependency
284
332
  check_optional_dependency("pyautogen", "AutoGen", "autogen")
333
+ # This line will never be reached if AutoGen is missing
334
+ # because check_optional_dependency raises ImportError
335
+ raise # Re-raise the original ImportError
285
336
 
286
337
  agent = UserProxyAgent(
287
338
  name=name,
@@ -316,10 +367,13 @@ class EuriaiAutoGen:
316
367
  Returns:
317
368
  Configured GroupChat
318
369
  """
319
- # Check if AutoGen is properly imported
320
- if GroupChat is None:
370
+ # Import AutoGen GroupChat class
371
+ try:
372
+ from autogen import GroupChat
373
+ except ImportError:
321
374
  from . import check_optional_dependency
322
375
  check_optional_dependency("pyautogen", "AutoGen", "autogen")
376
+ raise # Re-raise the original ImportError
323
377
 
324
378
  self.group_chat = GroupChat(
325
379
  agents=agents,
@@ -353,10 +407,13 @@ class EuriaiAutoGen:
353
407
  Returns:
354
408
  Configured GroupChatManager
355
409
  """
356
- # Check if AutoGen is properly imported
357
- if GroupChatManager is None:
410
+ # Import AutoGen GroupChatManager class
411
+ try:
412
+ from autogen import GroupChatManager
413
+ except ImportError:
358
414
  from . import check_optional_dependency
359
415
  check_optional_dependency("pyautogen", "AutoGen", "autogen")
416
+ raise # Re-raise the original ImportError
360
417
 
361
418
  # Create config for Euri API
362
419
  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.9
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=fksM6G1zY6KcjKLpF35I68RASjsKPb03_bLPt0WAhZ4,6629
2
+ euriai/autogen.py,sha256=46lCZ4mx0h3ktwtNB0L8mL9O4aJ1-5aLCiwitQ6JXOU,19075
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.9.dist-info/METADATA,sha256=zUkt1tEuYAXBm0Up4zKgP7D4bgC310CbEV69LCSaqgY,6806
16
+ euriai-1.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ euriai-1.0.9.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
18
+ euriai-1.0.9.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
19
+ euriai-1.0.9.dist-info/RECORD,,
File without changes