euriai 1.0.6__tar.gz → 1.0.8__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euriai
3
- Version: 1.0.6
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
@@ -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.6"
7
+ __version__ = "1.0.8"
8
8
 
9
9
  # Core imports that should always work
10
10
  try:
@@ -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:
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,6 +272,16 @@ class EuriaiAutoGen:
231
272
  Returns:
232
273
  Configured AssistantAgent
233
274
  """
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:
282
+ from . import check_optional_dependency
283
+ check_optional_dependency("pyautogen", "AutoGen", "autogen")
284
+
234
285
  # Create config for Euri API
235
286
  config_list = [{
236
287
  "model": model or self.default_model,
@@ -260,7 +311,7 @@ class EuriaiAutoGen:
260
311
  is_termination_msg: Optional[callable] = None,
261
312
  code_execution_config: Optional[Dict[str, Any]] = None,
262
313
  **kwargs
263
- ) -> UserProxyAgent:
314
+ ) -> "UserProxyAgent":
264
315
  """
265
316
  Create a user proxy agent.
266
317
 
@@ -273,6 +324,16 @@ class EuriaiAutoGen:
273
324
  Returns:
274
325
  Configured UserProxyAgent
275
326
  """
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:
334
+ from . import check_optional_dependency
335
+ check_optional_dependency("pyautogen", "AutoGen", "autogen")
336
+
276
337
  agent = UserProxyAgent(
277
338
  name=name,
278
339
  is_termination_msg=is_termination_msg,
@@ -306,6 +367,9 @@ class EuriaiAutoGen:
306
367
  Returns:
307
368
  Configured GroupChat
308
369
  """
370
+ # Ensure AutoGen classes are properly imported
371
+ _ensure_autogen_imports()
372
+
309
373
  self.group_chat = GroupChat(
310
374
  agents=agents,
311
375
  messages=messages or [],
@@ -338,6 +402,9 @@ class EuriaiAutoGen:
338
402
  Returns:
339
403
  Configured GroupChatManager
340
404
  """
405
+ # Ensure AutoGen classes are properly imported
406
+ _ensure_autogen_imports()
407
+
341
408
  # Create config for Euri API
342
409
  config_list = [{
343
410
  "model": model or self.default_model,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euriai
3
- Version: 1.0.6
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
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="euriai",
5
- version="1.0.6",
5
+ version="1.0.8",
6
6
  description="Python client for Euri API (euron.one) with CLI, LangChain, and LlamaIndex integration",
7
7
  long_description=open("README.md", encoding="utf-8").read(),
8
8
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes