euriai 1.0.10__py3-none-any.whl → 1.0.12__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 +1 -1
- euriai/autogen.py +88 -35
- {euriai-1.0.10.dist-info → euriai-1.0.12.dist-info}/METADATA +1 -1
- {euriai-1.0.10.dist-info → euriai-1.0.12.dist-info}/RECORD +7 -7
- {euriai-1.0.10.dist-info → euriai-1.0.12.dist-info}/WHEEL +0 -0
- {euriai-1.0.10.dist-info → euriai-1.0.12.dist-info}/entry_points.txt +0 -0
- {euriai-1.0.10.dist-info → euriai-1.0.12.dist-info}/top_level.txt +0 -0
euriai/__init__.py
CHANGED
euriai/autogen.py
CHANGED
@@ -5,12 +5,19 @@ from euriai.client import EuriaiClient
|
|
5
5
|
try:
|
6
6
|
# Try newer AutoGen structure first (v0.6+)
|
7
7
|
try:
|
8
|
-
from autogen_agentchat import AssistantAgent, UserProxyAgent
|
8
|
+
from autogen_agentchat.agents import AssistantAgent, UserProxyAgent
|
9
|
+
from autogen_agentchat.teams import GroupChat, GroupChatManager
|
9
10
|
import autogen_agentchat as autogen
|
10
11
|
except ImportError:
|
11
|
-
#
|
12
|
-
|
13
|
-
|
12
|
+
# Try alternative newer structure
|
13
|
+
try:
|
14
|
+
from autogen_agentchat.base import AssistantAgent, UserProxyAgent
|
15
|
+
from autogen_agentchat import GroupChat, GroupChatManager
|
16
|
+
import autogen_agentchat as autogen
|
17
|
+
except ImportError:
|
18
|
+
# Fall back to older AutoGen structure
|
19
|
+
import autogen
|
20
|
+
from autogen import AssistantAgent, UserProxyAgent, GroupChat, GroupChatManager
|
14
21
|
except ImportError:
|
15
22
|
autogen = None
|
16
23
|
AssistantAgent = UserProxyAgent = GroupChat = GroupChatManager = None
|
@@ -278,14 +285,23 @@ class EuriaiAutoGen:
|
|
278
285
|
Returns:
|
279
286
|
Configured AssistantAgent
|
280
287
|
"""
|
281
|
-
# Import AutoGen AssistantAgent class
|
288
|
+
# Import AutoGen AssistantAgent class and detect version
|
289
|
+
autogen_version = "0.2" # Default to old version
|
290
|
+
AssistantAgent = None
|
291
|
+
|
282
292
|
try:
|
283
293
|
# Try newer AutoGen structure first (v0.6+)
|
284
294
|
try:
|
285
|
-
from autogen_agentchat import AssistantAgent
|
295
|
+
from autogen_agentchat.agents import AssistantAgent
|
296
|
+
autogen_version = "0.6+"
|
286
297
|
except ImportError:
|
287
|
-
|
288
|
-
|
298
|
+
try:
|
299
|
+
from autogen_agentchat.base import AssistantAgent
|
300
|
+
autogen_version = "0.6+"
|
301
|
+
except ImportError:
|
302
|
+
# Fall back to older AutoGen structure
|
303
|
+
from autogen import AssistantAgent
|
304
|
+
autogen_version = "0.2"
|
289
305
|
except ImportError:
|
290
306
|
from . import check_optional_dependency
|
291
307
|
check_optional_dependency("pyautogen", "AutoGen", "autogen")
|
@@ -293,25 +309,53 @@ class EuriaiAutoGen:
|
|
293
309
|
# because check_optional_dependency raises ImportError
|
294
310
|
raise # Re-raise the original ImportError
|
295
311
|
|
296
|
-
|
297
|
-
config_list = [{
|
298
|
-
"model": model or self.default_model,
|
299
|
-
"model_client_cls": "EuriaiModelClient",
|
300
|
-
"api_key": self.api_key,
|
301
|
-
"temperature": temperature,
|
302
|
-
"max_tokens": max_tokens
|
303
|
-
}]
|
304
|
-
|
305
|
-
# Create agent
|
306
|
-
agent = AssistantAgent(
|
307
|
-
name=name,
|
308
|
-
system_message=system_message,
|
309
|
-
llm_config={"config_list": config_list},
|
310
|
-
**kwargs
|
311
|
-
)
|
312
|
+
model_name = model or self.default_model
|
312
313
|
|
313
|
-
|
314
|
-
|
314
|
+
if autogen_version == "0.6+":
|
315
|
+
# Use new AutoGen 0.6+ API with model_client
|
316
|
+
try:
|
317
|
+
# Try to import the model client for new API
|
318
|
+
from autogen_ext.models.openai import OpenAIChatCompletionClient
|
319
|
+
|
320
|
+
# Create model client that connects to Euri API
|
321
|
+
model_client = OpenAIChatCompletionClient(
|
322
|
+
model=model_name,
|
323
|
+
api_key=self.api_key,
|
324
|
+
base_url="https://api.euriai.com/v1/",
|
325
|
+
temperature=temperature,
|
326
|
+
max_tokens=max_tokens
|
327
|
+
)
|
328
|
+
|
329
|
+
# Create and return assistant agent with new API
|
330
|
+
agent = AssistantAgent(
|
331
|
+
name=name,
|
332
|
+
model_client=model_client,
|
333
|
+
system_message=system_message or "You are a helpful AI assistant.",
|
334
|
+
**kwargs
|
335
|
+
)
|
336
|
+
|
337
|
+
except ImportError:
|
338
|
+
raise ImportError(
|
339
|
+
"AutoGen 0.6+ detected but autogen_ext.models.openai is not available. "
|
340
|
+
"Please install the full AutoGen package with: pip install pyautogen[openai]"
|
341
|
+
)
|
342
|
+
else:
|
343
|
+
# Use old AutoGen 0.2 API with llm_config
|
344
|
+
config_list = [{
|
345
|
+
"model": model_name,
|
346
|
+
"api_key": self.api_key,
|
347
|
+
"base_url": "https://api.euriai.com/v1/",
|
348
|
+
"temperature": temperature,
|
349
|
+
"max_tokens": max_tokens
|
350
|
+
}]
|
351
|
+
|
352
|
+
# Create agent with old API
|
353
|
+
agent = AssistantAgent(
|
354
|
+
name=name,
|
355
|
+
system_message=system_message,
|
356
|
+
llm_config={"config_list": config_list},
|
357
|
+
**kwargs
|
358
|
+
)
|
315
359
|
|
316
360
|
self.agents.append(agent)
|
317
361
|
return agent
|
@@ -339,10 +383,13 @@ class EuriaiAutoGen:
|
|
339
383
|
try:
|
340
384
|
# Try newer AutoGen structure first (v0.6+)
|
341
385
|
try:
|
342
|
-
from autogen_agentchat import UserProxyAgent
|
386
|
+
from autogen_agentchat.agents import UserProxyAgent
|
343
387
|
except ImportError:
|
344
|
-
|
345
|
-
|
388
|
+
try:
|
389
|
+
from autogen_agentchat.base import UserProxyAgent
|
390
|
+
except ImportError:
|
391
|
+
# Fall back to older AutoGen structure
|
392
|
+
from autogen import UserProxyAgent
|
346
393
|
except ImportError:
|
347
394
|
from . import check_optional_dependency
|
348
395
|
check_optional_dependency("pyautogen", "AutoGen", "autogen")
|
@@ -387,10 +434,13 @@ class EuriaiAutoGen:
|
|
387
434
|
try:
|
388
435
|
# Try newer AutoGen structure first (v0.6+)
|
389
436
|
try:
|
390
|
-
from autogen_agentchat import GroupChat
|
437
|
+
from autogen_agentchat.teams import GroupChat
|
391
438
|
except ImportError:
|
392
|
-
|
393
|
-
|
439
|
+
try:
|
440
|
+
from autogen_agentchat import GroupChat
|
441
|
+
except ImportError:
|
442
|
+
# Fall back to older AutoGen structure
|
443
|
+
from autogen import GroupChat
|
394
444
|
except ImportError:
|
395
445
|
from . import check_optional_dependency
|
396
446
|
check_optional_dependency("pyautogen", "AutoGen", "autogen")
|
@@ -432,10 +482,13 @@ class EuriaiAutoGen:
|
|
432
482
|
try:
|
433
483
|
# Try newer AutoGen structure first (v0.6+)
|
434
484
|
try:
|
435
|
-
from autogen_agentchat import GroupChatManager
|
485
|
+
from autogen_agentchat.teams import GroupChatManager
|
436
486
|
except ImportError:
|
437
|
-
|
438
|
-
|
487
|
+
try:
|
488
|
+
from autogen_agentchat import GroupChatManager
|
489
|
+
except ImportError:
|
490
|
+
# Fall back to older AutoGen structure
|
491
|
+
from autogen import GroupChatManager
|
439
492
|
except ImportError:
|
440
493
|
from . import check_optional_dependency
|
441
494
|
check_optional_dependency("pyautogen", "AutoGen", "autogen")
|
@@ -1,5 +1,5 @@
|
|
1
|
-
euriai/__init__.py,sha256=
|
2
|
-
euriai/autogen.py,sha256=
|
1
|
+
euriai/__init__.py,sha256=fOu_GfzC0JWBu232SdRHJQoBNk-pP4pb77qlGoEBKm0,6630
|
2
|
+
euriai/autogen.py,sha256=SACnTH7d_gnb6nIaaMN4bvMkNUxpeRq_VZ3o0thEB08,22678
|
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.
|
16
|
-
euriai-1.0.
|
17
|
-
euriai-1.0.
|
18
|
-
euriai-1.0.
|
19
|
-
euriai-1.0.
|
15
|
+
euriai-1.0.12.dist-info/METADATA,sha256=cWWOJemR6qbJjHI3CRQ8kpIa5hpIuUeCtGchD8A8XHU,6807
|
16
|
+
euriai-1.0.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
17
|
+
euriai-1.0.12.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
|
18
|
+
euriai-1.0.12.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
|
19
|
+
euriai-1.0.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|