euriai 1.0.11__tar.gz → 1.0.12__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.11
3
+ Version: 1.0.12
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.11"
7
+ __version__ = "1.0.12"
8
8
 
9
9
  # Core imports that should always work
10
10
  try:
@@ -285,17 +285,23 @@ class EuriaiAutoGen:
285
285
  Returns:
286
286
  Configured AssistantAgent
287
287
  """
288
- # 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
+
289
292
  try:
290
293
  # Try newer AutoGen structure first (v0.6+)
291
294
  try:
292
295
  from autogen_agentchat.agents import AssistantAgent
296
+ autogen_version = "0.6+"
293
297
  except ImportError:
294
298
  try:
295
299
  from autogen_agentchat.base import AssistantAgent
300
+ autogen_version = "0.6+"
296
301
  except ImportError:
297
302
  # Fall back to older AutoGen structure
298
303
  from autogen import AssistantAgent
304
+ autogen_version = "0.2"
299
305
  except ImportError:
300
306
  from . import check_optional_dependency
301
307
  check_optional_dependency("pyautogen", "AutoGen", "autogen")
@@ -303,25 +309,53 @@ class EuriaiAutoGen:
303
309
  # because check_optional_dependency raises ImportError
304
310
  raise # Re-raise the original ImportError
305
311
 
306
- # Create config for Euri API
307
- config_list = [{
308
- "model": model or self.default_model,
309
- "model_client_cls": "EuriaiModelClient",
310
- "api_key": self.api_key,
311
- "temperature": temperature,
312
- "max_tokens": max_tokens
313
- }]
314
-
315
- # Create agent
316
- agent = AssistantAgent(
317
- name=name,
318
- system_message=system_message,
319
- llm_config={"config_list": config_list},
320
- **kwargs
321
- )
312
+ model_name = model or self.default_model
322
313
 
323
- # Register the custom model client
324
- agent.register_model_client(model_client_cls=EuriaiModelClient)
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
+ )
325
359
 
326
360
  self.agents.append(agent)
327
361
  return agent
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euriai
3
- Version: 1.0.11
3
+ Version: 1.0.12
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.11",
5
+ version="1.0.12",
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