euriai 1.0.4__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.6/PKG-INFO ADDED
@@ -0,0 +1,251 @@
1
+ Metadata-Version: 2.4
2
+ Name: euriai
3
+ Version: 1.0.6
4
+ Summary: Python client for Euri API (euron.one) with CLI, LangChain, and LlamaIndex integration
5
+ Author: Euri
6
+ Author-email: tech@euron.one
7
+ License: MIT
8
+ Keywords: euriai,llm,langchain,llamaindex,langgraph,smolagents,n8n,agents,ai,sdk
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Intended Audience :: Developers
13
+ Requires-Python: >=3.6
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: requests
16
+ Requires-Dist: numpy
17
+ Requires-Dist: pyyaml
18
+ Provides-Extra: langchain-core
19
+ Requires-Dist: langchain-core; extra == "langchain-core"
20
+ Provides-Extra: langchain
21
+ Requires-Dist: langchain; extra == "langchain"
22
+ Provides-Extra: llama-index
23
+ Requires-Dist: llama-index>=0.10.0; extra == "llama-index"
24
+ Provides-Extra: langgraph
25
+ Requires-Dist: langgraph; extra == "langgraph"
26
+ Provides-Extra: smolagents
27
+ Requires-Dist: smolagents; extra == "smolagents"
28
+ Provides-Extra: n8n
29
+ Requires-Dist: requests; extra == "n8n"
30
+ Provides-Extra: crewai
31
+ Requires-Dist: crewai; extra == "crewai"
32
+ Provides-Extra: autogen
33
+ Requires-Dist: pyautogen; extra == "autogen"
34
+ Provides-Extra: test
35
+ Requires-Dist: pytest; extra == "test"
36
+ Provides-Extra: all
37
+ Requires-Dist: langchain-core; extra == "all"
38
+ Requires-Dist: langchain; extra == "all"
39
+ Requires-Dist: llama-index>=0.10.0; extra == "all"
40
+ Requires-Dist: langgraph; extra == "all"
41
+ Requires-Dist: smolagents; extra == "all"
42
+ Requires-Dist: crewai; extra == "all"
43
+ Requires-Dist: pyautogen; extra == "all"
44
+ Dynamic: author
45
+ Dynamic: author-email
46
+ Dynamic: classifier
47
+ Dynamic: description
48
+ Dynamic: description-content-type
49
+ Dynamic: license
50
+ Dynamic: provides-extra
51
+ Dynamic: requires-dist
52
+ Dynamic: requires-python
53
+ Dynamic: summary
54
+
55
+ # Euri AI Python SDK
56
+
57
+ A comprehensive Python SDK for the Euri AI API with integrations for popular AI frameworks.
58
+
59
+ ## Installation
60
+
61
+ ### Basic Installation
62
+ ```bash
63
+ pip install euriai
64
+ ```
65
+
66
+ ### With Optional Integrations
67
+ ```bash
68
+ # Install specific integrations
69
+ pip install euriai[autogen] # AutoGen integration
70
+ pip install euriai[crewai] # CrewAI integration
71
+ pip install euriai[langchain] # LangChain integration
72
+ pip install euriai[smolagents] # SmolAgents integration
73
+ pip install euriai[langgraph] # LangGraph integration
74
+ pip install euriai[llama-index] # LlamaIndex integration
75
+
76
+ # Install all integrations
77
+ pip install euriai[all]
78
+ ```
79
+
80
+ ## Quick Start
81
+
82
+ ### Basic Usage
83
+ ```python
84
+ from euriai import EuriaiClient
85
+
86
+ # Initialize client
87
+ client = EuriaiClient(
88
+ api_key="your-euri-api-key",
89
+ model="gpt-4.1-nano"
90
+ )
91
+
92
+ # Generate completion
93
+ response = client.generate_completion(
94
+ prompt="What is artificial intelligence?",
95
+ temperature=0.7,
96
+ max_tokens=1000
97
+ )
98
+
99
+ print(response["choices"][0]["message"]["content"])
100
+ ```
101
+
102
+ ### Framework Integrations
103
+
104
+ The SDK provides seamless integrations with popular AI frameworks. Each integration is optional and can be installed separately.
105
+
106
+ #### AutoGen Integration
107
+ ```python
108
+ # This will automatically check if AutoGen is installed
109
+ # and provide helpful installation instructions if not
110
+ from euriai.autogen import EuriaiAutoGen
111
+
112
+ autogen = EuriaiAutoGen(
113
+ api_key="your-euri-api-key",
114
+ default_model="gpt-4.1-nano"
115
+ )
116
+ ```
117
+
118
+ #### CrewAI Integration
119
+ ```python
120
+ from euriai.crewai import EuriaiCrewAI
121
+
122
+ crew = EuriaiCrewAI(
123
+ api_key="your-euri-api-key",
124
+ default_model="gpt-4.1-nano"
125
+ )
126
+ ```
127
+
128
+ #### LangChain Integration
129
+ ```python
130
+ from euriai.langchain import EuriaiChatModel
131
+
132
+ chat_model = EuriaiChatModel(
133
+ api_key="your-euri-api-key",
134
+ model="gpt-4.1-nano"
135
+ )
136
+ ```
137
+
138
+ ### Handling Optional Dependencies
139
+
140
+ If you try to use an integration without installing its dependencies, you'll get helpful error messages:
141
+
142
+ ```python
143
+ try:
144
+ from euriai.autogen import EuriaiAutoGen
145
+ except ImportError as e:
146
+ print(e)
147
+ # This will show:
148
+ # AutoGen is not installed. Please install it using one of these methods:
149
+ #
150
+ # Option 1 (Recommended): Install with euriai extras:
151
+ # pip install euriai[autogen]
152
+ #
153
+ # Option 2: Install AutoGen directly:
154
+ # pip install pyautogen
155
+ #
156
+ # Option 3: Install all euriai integrations:
157
+ # pip install euriai[all]
158
+ ```
159
+
160
+ ### Semi-Automatic Installation (Optional)
161
+
162
+ For convenience, you can use the helper function to prompt for automatic installation:
163
+
164
+ ```python
165
+ from euriai import install_optional_dependency
166
+
167
+ # This will ask user permission before installing
168
+ if install_optional_dependency("pyautogen", "AutoGen", "autogen"):
169
+ from euriai.autogen import EuriaiAutoGen
170
+ # Now you can use AutoGen integration
171
+ ```
172
+
173
+ ## Available Models
174
+
175
+ - `gpt-4.1-nano` - Fast and efficient model
176
+ - `gpt-4.1-mini` - Balanced performance model
177
+ - `gemini-2.5-flash` - Google's Gemini model
178
+ - And more...
179
+
180
+ ## Framework Support
181
+
182
+ | Framework | Installation | Description |
183
+ |-----------|-------------|-------------|
184
+ | **AutoGen** | `pip install euriai[autogen]` | Multi-agent conversation framework |
185
+ | **CrewAI** | `pip install euriai[crewai]` | Role-playing AI agent framework |
186
+ | **LangChain** | `pip install euriai[langchain]` | Building applications with LLMs |
187
+ | **LangGraph** | `pip install euriai[langgraph]` | Building stateful, multi-actor applications |
188
+ | **SmolAgents** | `pip install euriai[smolagents]` | Minimalist agent framework |
189
+ | **LlamaIndex** | `pip install euriai[llama-index]` | Data framework for LLM applications |
190
+
191
+ ## Examples
192
+
193
+ ### AutoGen Multi-Agent Chat
194
+ ```python
195
+ from euriai.autogen import EuriaiAutoGen
196
+
197
+ autogen = EuriaiAutoGen(api_key="your-api-key")
198
+
199
+ assistant = autogen.create_assistant_agent(
200
+ name="Assistant",
201
+ model="gpt-4.1-nano"
202
+ )
203
+
204
+ user_proxy = autogen.create_user_proxy_agent(
205
+ name="User",
206
+ human_input_mode="NEVER"
207
+ )
208
+
209
+ result = autogen.run_chat(
210
+ agent1=user_proxy,
211
+ agent2=assistant,
212
+ message="Explain quantum computing",
213
+ max_turns=3
214
+ )
215
+ ```
216
+
217
+ ### CrewAI Workflow
218
+ ```python
219
+ from euriai.crewai import EuriaiCrewAI
220
+
221
+ crew = EuriaiCrewAI(api_key="your-api-key")
222
+
223
+ crew.add_agent("researcher", {
224
+ "role": "Researcher",
225
+ "goal": "Research {topic}",
226
+ "backstory": "Expert researcher with analytical skills",
227
+ "model": "gpt-4.1-nano"
228
+ })
229
+
230
+ crew.add_task("research_task", {
231
+ "description": "Research the given topic",
232
+ "expected_output": "Comprehensive research report",
233
+ "agent": "researcher"
234
+ })
235
+
236
+ result = crew.run(inputs={"topic": "AI in Healthcare"})
237
+ ```
238
+
239
+ ## API Reference
240
+
241
+ For detailed API documentation, visit: [https://euron.one/euri](https://euron.one/euri)
242
+
243
+ ## Support
244
+
245
+ - **Documentation**: [https://docs.euron.one](https://euron.one/euri)
246
+ - **GitHub**: [https://github.com/euri-ai/euriai-python-sdk](https://github.com/euri-ai/euriai-python-sdk)
247
+ - **Email**: tech@euron.one
248
+
249
+ ## License
250
+
251
+ MIT License - see LICENSE file for details.
euriai-1.0.6/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # Euri AI Python SDK
2
+
3
+ A comprehensive Python SDK for the Euri AI API with integrations for popular AI frameworks.
4
+
5
+ ## Installation
6
+
7
+ ### Basic Installation
8
+ ```bash
9
+ pip install euriai
10
+ ```
11
+
12
+ ### With Optional Integrations
13
+ ```bash
14
+ # Install specific integrations
15
+ pip install euriai[autogen] # AutoGen integration
16
+ pip install euriai[crewai] # CrewAI integration
17
+ pip install euriai[langchain] # LangChain integration
18
+ pip install euriai[smolagents] # SmolAgents integration
19
+ pip install euriai[langgraph] # LangGraph integration
20
+ pip install euriai[llama-index] # LlamaIndex integration
21
+
22
+ # Install all integrations
23
+ pip install euriai[all]
24
+ ```
25
+
26
+ ## Quick Start
27
+
28
+ ### Basic Usage
29
+ ```python
30
+ from euriai import EuriaiClient
31
+
32
+ # Initialize client
33
+ client = EuriaiClient(
34
+ api_key="your-euri-api-key",
35
+ model="gpt-4.1-nano"
36
+ )
37
+
38
+ # Generate completion
39
+ response = client.generate_completion(
40
+ prompt="What is artificial intelligence?",
41
+ temperature=0.7,
42
+ max_tokens=1000
43
+ )
44
+
45
+ print(response["choices"][0]["message"]["content"])
46
+ ```
47
+
48
+ ### Framework Integrations
49
+
50
+ The SDK provides seamless integrations with popular AI frameworks. Each integration is optional and can be installed separately.
51
+
52
+ #### AutoGen Integration
53
+ ```python
54
+ # This will automatically check if AutoGen is installed
55
+ # and provide helpful installation instructions if not
56
+ from euriai.autogen import EuriaiAutoGen
57
+
58
+ autogen = EuriaiAutoGen(
59
+ api_key="your-euri-api-key",
60
+ default_model="gpt-4.1-nano"
61
+ )
62
+ ```
63
+
64
+ #### CrewAI Integration
65
+ ```python
66
+ from euriai.crewai import EuriaiCrewAI
67
+
68
+ crew = EuriaiCrewAI(
69
+ api_key="your-euri-api-key",
70
+ default_model="gpt-4.1-nano"
71
+ )
72
+ ```
73
+
74
+ #### LangChain Integration
75
+ ```python
76
+ from euriai.langchain import EuriaiChatModel
77
+
78
+ chat_model = EuriaiChatModel(
79
+ api_key="your-euri-api-key",
80
+ model="gpt-4.1-nano"
81
+ )
82
+ ```
83
+
84
+ ### Handling Optional Dependencies
85
+
86
+ If you try to use an integration without installing its dependencies, you'll get helpful error messages:
87
+
88
+ ```python
89
+ try:
90
+ from euriai.autogen import EuriaiAutoGen
91
+ except ImportError as e:
92
+ print(e)
93
+ # This will show:
94
+ # AutoGen is not installed. Please install it using one of these methods:
95
+ #
96
+ # Option 1 (Recommended): Install with euriai extras:
97
+ # pip install euriai[autogen]
98
+ #
99
+ # Option 2: Install AutoGen directly:
100
+ # pip install pyautogen
101
+ #
102
+ # Option 3: Install all euriai integrations:
103
+ # pip install euriai[all]
104
+ ```
105
+
106
+ ### Semi-Automatic Installation (Optional)
107
+
108
+ For convenience, you can use the helper function to prompt for automatic installation:
109
+
110
+ ```python
111
+ from euriai import install_optional_dependency
112
+
113
+ # This will ask user permission before installing
114
+ if install_optional_dependency("pyautogen", "AutoGen", "autogen"):
115
+ from euriai.autogen import EuriaiAutoGen
116
+ # Now you can use AutoGen integration
117
+ ```
118
+
119
+ ## Available Models
120
+
121
+ - `gpt-4.1-nano` - Fast and efficient model
122
+ - `gpt-4.1-mini` - Balanced performance model
123
+ - `gemini-2.5-flash` - Google's Gemini model
124
+ - And more...
125
+
126
+ ## Framework Support
127
+
128
+ | Framework | Installation | Description |
129
+ |-----------|-------------|-------------|
130
+ | **AutoGen** | `pip install euriai[autogen]` | Multi-agent conversation framework |
131
+ | **CrewAI** | `pip install euriai[crewai]` | Role-playing AI agent framework |
132
+ | **LangChain** | `pip install euriai[langchain]` | Building applications with LLMs |
133
+ | **LangGraph** | `pip install euriai[langgraph]` | Building stateful, multi-actor applications |
134
+ | **SmolAgents** | `pip install euriai[smolagents]` | Minimalist agent framework |
135
+ | **LlamaIndex** | `pip install euriai[llama-index]` | Data framework for LLM applications |
136
+
137
+ ## Examples
138
+
139
+ ### AutoGen Multi-Agent Chat
140
+ ```python
141
+ from euriai.autogen import EuriaiAutoGen
142
+
143
+ autogen = EuriaiAutoGen(api_key="your-api-key")
144
+
145
+ assistant = autogen.create_assistant_agent(
146
+ name="Assistant",
147
+ model="gpt-4.1-nano"
148
+ )
149
+
150
+ user_proxy = autogen.create_user_proxy_agent(
151
+ name="User",
152
+ human_input_mode="NEVER"
153
+ )
154
+
155
+ result = autogen.run_chat(
156
+ agent1=user_proxy,
157
+ agent2=assistant,
158
+ message="Explain quantum computing",
159
+ max_turns=3
160
+ )
161
+ ```
162
+
163
+ ### CrewAI Workflow
164
+ ```python
165
+ from euriai.crewai import EuriaiCrewAI
166
+
167
+ crew = EuriaiCrewAI(api_key="your-api-key")
168
+
169
+ crew.add_agent("researcher", {
170
+ "role": "Researcher",
171
+ "goal": "Research {topic}",
172
+ "backstory": "Expert researcher with analytical skills",
173
+ "model": "gpt-4.1-nano"
174
+ })
175
+
176
+ crew.add_task("research_task", {
177
+ "description": "Research the given topic",
178
+ "expected_output": "Comprehensive research report",
179
+ "agent": "researcher"
180
+ })
181
+
182
+ result = crew.run(inputs={"topic": "AI in Healthcare"})
183
+ ```
184
+
185
+ ## API Reference
186
+
187
+ For detailed API documentation, visit: [https://euron.one/euri](https://euron.one/euri)
188
+
189
+ ## Support
190
+
191
+ - **Documentation**: [https://docs.euron.one](https://euron.one/euri)
192
+ - **GitHub**: [https://github.com/euri-ai/euriai-python-sdk](https://github.com/euri-ai/euriai-python-sdk)
193
+ - **Email**: tech@euron.one
194
+
195
+ ## License
196
+
197
+ MIT License - see LICENSE file for details.
@@ -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}'")
@@ -198,7 +198,8 @@ class EuriaiAutoGen:
198
198
  default_model: Default model to use
199
199
  """
200
200
  if autogen is None:
201
- raise ImportError("AutoGen is not installed. Please install with `pip install pyautogen`.")
201
+ from . import check_optional_dependency
202
+ check_optional_dependency("pyautogen", "AutoGen", "autogen")
202
203
 
203
204
  self.api_key = api_key
204
205
  self.default_model = default_model