euriai 1.0.5__tar.gz → 1.0.6__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.
- {euriai-1.0.5 → euriai-1.0.6}/PKG-INFO +1 -1
- euriai-1.0.6/euriai/__init__.py +204 -0
- euriai-1.0.6/euriai/direct.py +82 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai.egg-info/PKG-INFO +1 -1
- {euriai-1.0.5 → euriai-1.0.6}/euriai.egg-info/SOURCES.txt +1 -0
- {euriai-1.0.5 → euriai-1.0.6}/setup.py +1 -1
- euriai-1.0.5/euriai/__init__.py +0 -118
- {euriai-1.0.5 → euriai-1.0.6}/README.md +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/autogen.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/cli.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/client.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/crewai.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/embedding.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/euri_chat.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/euri_embed.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/langchain.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/langgraph.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/llamaindex.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/n8n.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai/smolagents.py +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai.egg-info/dependency_links.txt +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai.egg-info/entry_points.txt +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai.egg-info/requires.txt +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/euriai.egg-info/top_level.txt +0 -0
- {euriai-1.0.5 → euriai-1.0.6}/setup.cfg +0 -0
@@ -0,0 +1,204 @@
|
|
1
|
+
"""
|
2
|
+
Euri AI Python SDK
|
3
|
+
|
4
|
+
A comprehensive Python SDK for the Euri AI API with integrations for popular frameworks.
|
5
|
+
"""
|
6
|
+
|
7
|
+
__version__ = "1.0.6"
|
8
|
+
|
9
|
+
# Core imports that should always work
|
10
|
+
try:
|
11
|
+
from .client import EuriaiClient
|
12
|
+
except ImportError as e:
|
13
|
+
print(f"Warning: Could not import EuriaiClient: {e}")
|
14
|
+
EuriaiClient = None
|
15
|
+
|
16
|
+
try:
|
17
|
+
from .embedding import EuriaiEmbeddingClient
|
18
|
+
# Backward compatibility alias
|
19
|
+
EuriaiEmbedding = EuriaiEmbeddingClient
|
20
|
+
except ImportError as e:
|
21
|
+
print(f"Warning: Could not import EuriaiEmbeddingClient: {e}")
|
22
|
+
EuriaiEmbeddingClient = None
|
23
|
+
EuriaiEmbedding = None
|
24
|
+
|
25
|
+
# Main exports (only include what was successfully imported)
|
26
|
+
__all__ = []
|
27
|
+
if EuriaiClient is not None:
|
28
|
+
__all__.append("EuriaiClient")
|
29
|
+
if EuriaiEmbeddingClient is not None:
|
30
|
+
__all__.extend(["EuriaiEmbeddingClient", "EuriaiEmbedding"])
|
31
|
+
|
32
|
+
|
33
|
+
# Helper functions for optional dependencies
|
34
|
+
def check_optional_dependency(package_name: str, integration_name: str, install_extra: str = None) -> bool:
|
35
|
+
"""
|
36
|
+
Check if an optional dependency is installed and provide helpful installation instructions.
|
37
|
+
|
38
|
+
Args:
|
39
|
+
package_name: The actual package name to import
|
40
|
+
integration_name: The friendly name for the integration
|
41
|
+
install_extra: The extras_require key for pip install euriai[extra]
|
42
|
+
|
43
|
+
Returns:
|
44
|
+
bool: True if package is available, False otherwise
|
45
|
+
|
46
|
+
Raises:
|
47
|
+
ImportError: With helpful installation instructions
|
48
|
+
"""
|
49
|
+
try:
|
50
|
+
__import__(package_name)
|
51
|
+
return True
|
52
|
+
except ImportError:
|
53
|
+
extra_option = f"euriai[{install_extra}]" if install_extra else f"euriai[{integration_name.lower()}]"
|
54
|
+
|
55
|
+
error_msg = (
|
56
|
+
f"{integration_name} is not installed. Please install it using one of these methods:\n\n"
|
57
|
+
f"Option 1 (Recommended): Install with euriai extras:\n"
|
58
|
+
f" pip install {extra_option}\n\n"
|
59
|
+
f"Option 2: Install {integration_name} directly:\n"
|
60
|
+
f" pip install {package_name}\n\n"
|
61
|
+
f"Option 3: Install all euriai integrations:\n"
|
62
|
+
f" pip install euriai[all]\n"
|
63
|
+
)
|
64
|
+
|
65
|
+
raise ImportError(error_msg)
|
66
|
+
|
67
|
+
|
68
|
+
def install_optional_dependency(package_name: str, integration_name: str, install_extra: str = None) -> bool:
|
69
|
+
"""
|
70
|
+
Attempt to automatically install an optional dependency (USE WITH CAUTION).
|
71
|
+
|
72
|
+
This function is provided for convenience but automatic installation can be risky.
|
73
|
+
It's generally better to install dependencies manually.
|
74
|
+
|
75
|
+
Args:
|
76
|
+
package_name: The actual package name to install
|
77
|
+
integration_name: The friendly name for the integration
|
78
|
+
install_extra: The extras_require key for pip install euriai[extra]
|
79
|
+
|
80
|
+
Returns:
|
81
|
+
bool: True if installation succeeded, False otherwise
|
82
|
+
"""
|
83
|
+
import subprocess
|
84
|
+
import sys
|
85
|
+
|
86
|
+
try:
|
87
|
+
# Try to import first
|
88
|
+
__import__(package_name)
|
89
|
+
print(f"✓ {integration_name} is already installed")
|
90
|
+
return True
|
91
|
+
except ImportError:
|
92
|
+
pass
|
93
|
+
|
94
|
+
# Ask user for confirmation
|
95
|
+
extra_option = f"euriai[{install_extra}]" if install_extra else f"euriai[{integration_name.lower()}]"
|
96
|
+
|
97
|
+
print(f"🔍 {integration_name} is not installed.")
|
98
|
+
print(f"📦 Recommended installation: pip install {extra_option}")
|
99
|
+
|
100
|
+
response = input(f"Would you like to automatically install {package_name}? (y/N): ").lower()
|
101
|
+
|
102
|
+
if response in ['y', 'yes']:
|
103
|
+
try:
|
104
|
+
print(f"📥 Installing {package_name}...")
|
105
|
+
subprocess.check_call([sys.executable, "-m", "pip", "install", package_name])
|
106
|
+
print(f"✅ {integration_name} installed successfully!")
|
107
|
+
return True
|
108
|
+
except subprocess.CalledProcessError as e:
|
109
|
+
print(f"❌ Failed to install {package_name}: {e}")
|
110
|
+
print(f"💡 Try manually: pip install {extra_option}")
|
111
|
+
return False
|
112
|
+
else:
|
113
|
+
print(f"💡 To install manually run: pip install {extra_option}")
|
114
|
+
return False
|
115
|
+
|
116
|
+
|
117
|
+
# Lazy loading functions for optional integrations
|
118
|
+
def _get_langchain():
|
119
|
+
"""Lazy import for LangChain integration."""
|
120
|
+
try:
|
121
|
+
from . import langchain
|
122
|
+
return langchain
|
123
|
+
except ImportError:
|
124
|
+
check_optional_dependency("langchain-core", "LangChain", "langchain")
|
125
|
+
|
126
|
+
def _get_crewai():
|
127
|
+
"""Lazy import for CrewAI integration."""
|
128
|
+
try:
|
129
|
+
from . import crewai
|
130
|
+
return crewai
|
131
|
+
except ImportError:
|
132
|
+
check_optional_dependency("crewai", "CrewAI", "crewai")
|
133
|
+
|
134
|
+
def _get_autogen():
|
135
|
+
"""Lazy import for AutoGen integration."""
|
136
|
+
try:
|
137
|
+
from . import autogen
|
138
|
+
return autogen
|
139
|
+
except ImportError:
|
140
|
+
check_optional_dependency("pyautogen", "AutoGen", "autogen")
|
141
|
+
|
142
|
+
def _get_smolagents():
|
143
|
+
"""Lazy import for SmolAgents integration."""
|
144
|
+
try:
|
145
|
+
from . import smolagents
|
146
|
+
return smolagents
|
147
|
+
except ImportError:
|
148
|
+
check_optional_dependency("smolagents", "SmolAgents", "smolagents")
|
149
|
+
|
150
|
+
def _get_langgraph():
|
151
|
+
"""Lazy import for LangGraph integration."""
|
152
|
+
try:
|
153
|
+
from . import langgraph
|
154
|
+
return langgraph
|
155
|
+
except ImportError:
|
156
|
+
check_optional_dependency("langgraph", "LangGraph", "langgraph")
|
157
|
+
|
158
|
+
def _get_llamaindex():
|
159
|
+
"""Lazy import for LlamaIndex integration."""
|
160
|
+
try:
|
161
|
+
from . import llamaindex
|
162
|
+
return llamaindex
|
163
|
+
except ImportError:
|
164
|
+
check_optional_dependency("llama-index", "LlamaIndex", "llama-index")
|
165
|
+
|
166
|
+
|
167
|
+
# Create lazy loading properties
|
168
|
+
class _LazyLoader:
|
169
|
+
"""Lazy loader for optional integrations."""
|
170
|
+
|
171
|
+
@property
|
172
|
+
def langchain(self):
|
173
|
+
return _get_langchain()
|
174
|
+
|
175
|
+
@property
|
176
|
+
def crewai(self):
|
177
|
+
return _get_crewai()
|
178
|
+
|
179
|
+
@property
|
180
|
+
def autogen(self):
|
181
|
+
return _get_autogen()
|
182
|
+
|
183
|
+
@property
|
184
|
+
def smolagents(self):
|
185
|
+
return _get_smolagents()
|
186
|
+
|
187
|
+
@property
|
188
|
+
def langgraph(self):
|
189
|
+
return _get_langgraph()
|
190
|
+
|
191
|
+
@property
|
192
|
+
def llamaindex(self):
|
193
|
+
return _get_llamaindex()
|
194
|
+
|
195
|
+
|
196
|
+
# Create the lazy loader instance
|
197
|
+
_lazy = _LazyLoader()
|
198
|
+
|
199
|
+
# Make the integrations available as module-level attributes
|
200
|
+
def __getattr__(name: str):
|
201
|
+
"""Handle lazy loading of optional integrations."""
|
202
|
+
if hasattr(_lazy, name):
|
203
|
+
return getattr(_lazy, name)
|
204
|
+
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
|
@@ -0,0 +1,82 @@
|
|
1
|
+
"""
|
2
|
+
Direct Import Module for Euri AI SDK
|
3
|
+
|
4
|
+
This module provides direct access to integrations without going through the main __init__.py,
|
5
|
+
which can be useful if there are import issues with the main package.
|
6
|
+
|
7
|
+
Usage:
|
8
|
+
# Instead of: from euriai.langchain import EuriaiChatModel
|
9
|
+
# Use: from euriai.direct import langchain_chat_model
|
10
|
+
|
11
|
+
from euriai.direct import langchain_chat_model, langchain_embeddings
|
12
|
+
|
13
|
+
chat_model = langchain_chat_model(
|
14
|
+
api_key="your-key",
|
15
|
+
model="gpt-4.1-nano"
|
16
|
+
)
|
17
|
+
"""
|
18
|
+
|
19
|
+
# Direct imports that bypass __init__.py
|
20
|
+
def langchain_chat_model(api_key: str, model: str = "gpt-4.1-nano", **kwargs):
|
21
|
+
"""Create a LangChain chat model directly."""
|
22
|
+
from .langchain import EuriaiChatModel
|
23
|
+
return EuriaiChatModel(api_key=api_key, model=model, **kwargs)
|
24
|
+
|
25
|
+
def langchain_llm(api_key: str, model: str = "gpt-4.1-nano", **kwargs):
|
26
|
+
"""Create a LangChain LLM directly."""
|
27
|
+
from .langchain import EuriaiLLM
|
28
|
+
return EuriaiLLM(api_key=api_key, model=model, **kwargs)
|
29
|
+
|
30
|
+
def langchain_embeddings(api_key: str, model: str = "text-embedding-3-small", **kwargs):
|
31
|
+
"""Create LangChain embeddings directly."""
|
32
|
+
from .langchain import EuriaiEmbeddings
|
33
|
+
return EuriaiEmbeddings(api_key=api_key, model=model, **kwargs)
|
34
|
+
|
35
|
+
def autogen_instance(api_key: str, default_model: str = "gpt-4.1-nano"):
|
36
|
+
"""Create an AutoGen instance directly."""
|
37
|
+
from .autogen import EuriaiAutoGen
|
38
|
+
return EuriaiAutoGen(api_key=api_key, default_model=default_model)
|
39
|
+
|
40
|
+
def crewai_instance(api_key: str, default_model: str = "gpt-4.1-nano", **kwargs):
|
41
|
+
"""Create a CrewAI instance directly."""
|
42
|
+
from .crewai import EuriaiCrewAI
|
43
|
+
return EuriaiCrewAI(api_key=api_key, default_model=default_model, **kwargs)
|
44
|
+
|
45
|
+
def client(api_key: str, model: str = "gpt-4.1-nano", **kwargs):
|
46
|
+
"""Create a basic Euri client directly."""
|
47
|
+
from .client import EuriaiClient
|
48
|
+
return EuriaiClient(api_key=api_key, model=model, **kwargs)
|
49
|
+
|
50
|
+
def embedding_client(api_key: str, model: str = "text-embedding-3-small"):
|
51
|
+
"""Create an embedding client directly."""
|
52
|
+
from .embedding import EuriaiEmbeddingClient
|
53
|
+
return EuriaiEmbeddingClient(api_key=api_key, model=model)
|
54
|
+
|
55
|
+
# Class exports for direct import
|
56
|
+
def get_langchain_classes():
|
57
|
+
"""Get LangChain classes for direct import."""
|
58
|
+
from .langchain import EuriaiChatModel, EuriaiLLM, EuriaiEmbeddings
|
59
|
+
return {
|
60
|
+
'EuriaiChatModel': EuriaiChatModel,
|
61
|
+
'EuriaiLLM': EuriaiLLM,
|
62
|
+
'EuriaiEmbeddings': EuriaiEmbeddings
|
63
|
+
}
|
64
|
+
|
65
|
+
def get_autogen_classes():
|
66
|
+
"""Get AutoGen classes for direct import."""
|
67
|
+
from .autogen import EuriaiAutoGen
|
68
|
+
return {'EuriaiAutoGen': EuriaiAutoGen}
|
69
|
+
|
70
|
+
def get_crewai_classes():
|
71
|
+
"""Get CrewAI classes for direct import."""
|
72
|
+
from .crewai import EuriaiCrewAI
|
73
|
+
return {'EuriaiCrewAI': EuriaiCrewAI}
|
74
|
+
|
75
|
+
def get_core_classes():
|
76
|
+
"""Get core classes for direct import."""
|
77
|
+
from .client import EuriaiClient
|
78
|
+
from .embedding import EuriaiEmbeddingClient
|
79
|
+
return {
|
80
|
+
'EuriaiClient': EuriaiClient,
|
81
|
+
'EuriaiEmbeddingClient': EuriaiEmbeddingClient
|
82
|
+
}
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="euriai",
|
5
|
-
version="1.0.
|
5
|
+
version="1.0.6",
|
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",
|
euriai-1.0.5/euriai/__init__.py
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Euri AI Python SDK
|
3
|
-
|
4
|
-
A comprehensive Python SDK for the Euri AI API with integrations for popular frameworks.
|
5
|
-
"""
|
6
|
-
|
7
|
-
from .client import EuriaiClient
|
8
|
-
from .embedding import EuriaiEmbedding
|
9
|
-
|
10
|
-
# Version
|
11
|
-
__version__ = "1.0.5"
|
12
|
-
|
13
|
-
# Main exports
|
14
|
-
__all__ = [
|
15
|
-
"EuriaiClient",
|
16
|
-
"EuriaiEmbedding"
|
17
|
-
]
|
18
|
-
|
19
|
-
|
20
|
-
def check_optional_dependency(package_name: str, integration_name: str, install_extra: str = None) -> bool:
|
21
|
-
"""
|
22
|
-
Check if an optional dependency is installed and provide helpful installation instructions.
|
23
|
-
|
24
|
-
Args:
|
25
|
-
package_name: The actual package name to import
|
26
|
-
integration_name: The friendly name for the integration
|
27
|
-
install_extra: The extras_require key for pip install euriai[extra]
|
28
|
-
|
29
|
-
Returns:
|
30
|
-
bool: True if package is available, False otherwise
|
31
|
-
|
32
|
-
Raises:
|
33
|
-
ImportError: With helpful installation instructions
|
34
|
-
"""
|
35
|
-
try:
|
36
|
-
__import__(package_name)
|
37
|
-
return True
|
38
|
-
except ImportError:
|
39
|
-
extra_option = f"euriai[{install_extra}]" if install_extra else f"euriai[{integration_name.lower()}]"
|
40
|
-
|
41
|
-
error_msg = (
|
42
|
-
f"{integration_name} is not installed. Please install it using one of these methods:\n\n"
|
43
|
-
f"Option 1 (Recommended): Install with euriai extras:\n"
|
44
|
-
f" pip install {extra_option}\n\n"
|
45
|
-
f"Option 2: Install {integration_name} directly:\n"
|
46
|
-
f" pip install {package_name}\n\n"
|
47
|
-
f"Option 3: Install all euriai integrations:\n"
|
48
|
-
f" pip install euriai[all]\n"
|
49
|
-
)
|
50
|
-
|
51
|
-
raise ImportError(error_msg)
|
52
|
-
|
53
|
-
|
54
|
-
def install_optional_dependency(package_name: str, integration_name: str, install_extra: str = None) -> bool:
|
55
|
-
"""
|
56
|
-
Attempt to automatically install an optional dependency (USE WITH CAUTION).
|
57
|
-
|
58
|
-
This function is provided for convenience but automatic installation can be risky.
|
59
|
-
It's generally better to install dependencies manually.
|
60
|
-
|
61
|
-
Args:
|
62
|
-
package_name: The actual package name to install
|
63
|
-
integration_name: The friendly name for the integration
|
64
|
-
install_extra: The extras_require key for pip install euriai[extra]
|
65
|
-
|
66
|
-
Returns:
|
67
|
-
bool: True if installation succeeded, False otherwise
|
68
|
-
"""
|
69
|
-
import subprocess
|
70
|
-
import sys
|
71
|
-
|
72
|
-
try:
|
73
|
-
# Try to import first
|
74
|
-
__import__(package_name)
|
75
|
-
print(f"✓ {integration_name} is already installed")
|
76
|
-
return True
|
77
|
-
except ImportError:
|
78
|
-
pass
|
79
|
-
|
80
|
-
# Ask user for confirmation
|
81
|
-
extra_option = f"euriai[{install_extra}]" if install_extra else f"euriai[{integration_name.lower()}]"
|
82
|
-
|
83
|
-
print(f"🔍 {integration_name} is not installed.")
|
84
|
-
print(f"📦 Recommended installation: pip install {extra_option}")
|
85
|
-
|
86
|
-
response = input(f"Would you like to automatically install {package_name}? (y/N): ").lower()
|
87
|
-
|
88
|
-
if response in ['y', 'yes']:
|
89
|
-
try:
|
90
|
-
print(f"📥 Installing {package_name}...")
|
91
|
-
subprocess.check_call([sys.executable, "-m", "pip", "install", package_name])
|
92
|
-
print(f"✅ {integration_name} installed successfully!")
|
93
|
-
return True
|
94
|
-
except subprocess.CalledProcessError as e:
|
95
|
-
print(f"❌ Failed to install {package_name}: {e}")
|
96
|
-
print(f"💡 Try manually: pip install {extra_option}")
|
97
|
-
return False
|
98
|
-
else:
|
99
|
-
print(f"💡 To install manually run: pip install {extra_option}")
|
100
|
-
return False
|
101
|
-
|
102
|
-
|
103
|
-
# Optional integrations with lazy loading
|
104
|
-
def _lazy_import_with_check(module_name: str, package_name: str, integration_name: str, install_extra: str = None):
|
105
|
-
"""Lazy import with automatic dependency checking."""
|
106
|
-
def _import():
|
107
|
-
check_optional_dependency(package_name, integration_name, install_extra)
|
108
|
-
from importlib import import_module
|
109
|
-
return import_module(f"euriai.{module_name}")
|
110
|
-
return _import
|
111
|
-
|
112
|
-
# Lazy imports for optional integrations
|
113
|
-
langchain = _lazy_import_with_check("langchain", "langchain-core", "LangChain", "langchain")
|
114
|
-
crewai = _lazy_import_with_check("crewai", "crewai", "CrewAI")
|
115
|
-
autogen = _lazy_import_with_check("autogen", "pyautogen", "AutoGen")
|
116
|
-
smolagents = _lazy_import_with_check("smolagents", "smolagents", "SmolAgents")
|
117
|
-
langgraph = _lazy_import_with_check("langgraph", "langgraph", "LangGraph")
|
118
|
-
llamaindex = _lazy_import_with_check("llamaindex", "llama-index", "LlamaIndex", "llama-index")
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|