euriai 1.0.4__tar.gz → 1.0.5__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/PKG-INFO ADDED
@@ -0,0 +1,251 @@
1
+ Metadata-Version: 2.4
2
+ Name: euriai
3
+ Version: 1.0.5
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.5/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,118 @@
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")
@@ -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