euriai 1.0.3__py3-none-any.whl → 1.0.5__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 CHANGED
@@ -1,30 +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
+
1
7
  from .client import EuriaiClient
2
- from .langchain import EuriaiChatModel, EuriaiEmbeddings, EuriaiLLM, create_chat_model, create_embeddings, create_llm
3
- from .embedding import EuriaiEmbeddingClient
4
- from .euri_chat import EuriaiLlamaIndexLLM
5
- from .euri_embed import EuriaiLlamaIndexEmbedding
6
- from .crewai import EuriaiCrewAI
7
- from .autogen import EuriaiAutoGen
8
- from .llamaindex import EuriaiLlamaIndex
9
- from .langgraph import EuriaiLangGraph
10
- from .smolagents import EuriaiSmolAgent
11
- from .n8n import EuriaiN8N
8
+ from .embedding import EuriaiEmbedding
9
+
10
+ # Version
11
+ __version__ = "1.0.5"
12
12
 
13
+ # Main exports
13
14
  __all__ = [
14
- "EuriaiClient",
15
- "EuriaiEmbeddingClient",
16
- "EuriaiLlamaIndexLLM",
17
- "EuriaiLlamaIndexEmbedding",
18
- "EuriaiCrewAI",
19
- "EuriaiAutoGen",
20
- "EuriaiLlamaIndex",
21
- "EuriaiLangGraph",
22
- "EuriaiSmolAgent",
23
- "EuriaiN8N",
24
- "EuriaiChatModel",
25
- "EuriaiEmbeddings",
26
- "EuriaiLLM",
27
- "create_chat_model",
28
- "create_embeddings",
29
- "create_llm",
30
- ]
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")
euriai/autogen.py CHANGED
@@ -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
euriai/crewai.py CHANGED
@@ -17,7 +17,8 @@ except ImportError:
17
17
  class Task:
18
18
  pass
19
19
  class Process:
20
- pass
20
+ sequential = "sequential"
21
+ parallel = "parallel"
21
22
  class LLM:
22
23
  pass
23
24
 
euriai/euri_embed.py CHANGED
@@ -34,13 +34,29 @@ class EuriaiLlamaIndexEmbedding(BaseEmbedding):
34
34
  response.raise_for_status()
35
35
  return [np.array(obj["embedding"]).tolist() for obj in response.json()["data"]]
36
36
 
37
+ # Abstract methods required by BaseEmbedding (with underscore prefixes)
38
+ def _get_text_embedding(self, text: str) -> List[float]:
39
+ """Get embedding for a single text. Required abstract method."""
40
+ return self._post_embedding([text])[0]
41
+
42
+ def _get_query_embedding(self, query: str) -> List[float]:
43
+ """Get embedding for a query string. Required abstract method."""
44
+ return self._get_text_embedding(query)
45
+
46
+ async def _aget_query_embedding(self, query: str) -> List[float]:
47
+ """Async version of get_query_embedding. Required abstract method."""
48
+ # For now, we don't support async, so we'll use the sync version
49
+ # In a real implementation, you'd want to use aiohttp or similar
50
+ return self._get_query_embedding(query)
51
+
52
+ # Public methods for backward compatibility
37
53
  def get_text_embedding(self, text: str) -> List[float]:
38
54
  """Get embedding for a single text."""
39
- return self._post_embedding([text])[0]
55
+ return self._get_text_embedding(text)
40
56
 
41
57
  def get_query_embedding(self, query: str) -> List[float]:
42
58
  """Get embedding for a query string."""
43
- return self.get_text_embedding(query)
59
+ return self._get_query_embedding(query)
44
60
 
45
61
  def get_text_embeddings(self, texts: List[str]) -> List[List[float]]:
46
62
  """Get embeddings for multiple texts."""
@@ -48,5 +64,4 @@ class EuriaiLlamaIndexEmbedding(BaseEmbedding):
48
64
 
49
65
  async def aget_query_embedding(self, query: str) -> List[float]:
50
66
  """Async version of get_query_embedding."""
51
- # We don't support async, so raise NotImplementedError
52
- raise NotImplementedError("Async embeddings not supported")
67
+ return await self._aget_query_embedding(query)
@@ -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.
@@ -1,18 +1,18 @@
1
- euriai/__init__.py,sha256=WE4zl0HNxDm4zwR3d0uRyjl3fjcD_pccKvPsbtuDysw,916
2
- euriai/autogen.py,sha256=4YAHrY65YYOKVsBjQa9G8pr-_Xxss1uR08qLAFzo7Rk,16023
1
+ euriai/__init__.py,sha256=P1kgfg-wUrzUOMPu5hIuwogi75xW69S5GJe2_ELvo8s,4541
2
+ euriai/autogen.py,sha256=a_uKUn1FTxlFx7d7LwFnsM6TsdGbdecYxwujIp6xU0w,16044
3
3
  euriai/cli.py,sha256=hF1wiiL2QQSfWf8WlLQyNVDBd4YkbiwmMSoPxVbyPTM,3290
4
4
  euriai/client.py,sha256=L-o6hv9N3md-l-hz-kz5nYVaaZqnrREZlo_0jguhF7E,4066
5
- euriai/crewai.py,sha256=eeDfZQC9LtEePSnaj94DA0Kcb8Ayq0Gn_eDSQwbcMBU,7543
5
+ euriai/crewai.py,sha256=nfMMOOhKiCIc2v42nj2Zf9rP0U5m4GrfK_6zkXL77gw,7594
6
6
  euriai/embedding.py,sha256=uP66Ph1k9Ou6J5RAkztJxlfyj0S0MESOvZ4ulhnVo-o,1270
7
7
  euriai/euri_chat.py,sha256=DEAiet1ReRwB4ljkPYaTl1Nb5uc20-JF-3PQjGQZXk4,3567
8
- euriai/euri_embed.py,sha256=VE-RLUb5bYnEFA_dxFkj2c3Jr_SYyJKPmFOzsDOR0Ys,2137
8
+ euriai/euri_embed.py,sha256=g7zs1G-ZBDJjOGJtkkfIcV4LPtRcm9wpVWmrfMGn5EM,2919
9
9
  euriai/langchain.py,sha256=gVF9eh21RC1WtDn7SQoEREUDqOObm5IRx6BFZtB5xcc,34968
10
10
  euriai/langgraph.py,sha256=sw9e-PnfwAwmp_tUCnAGIUB78GyJsMkAzxOGvFUafiM,34128
11
11
  euriai/llamaindex.py,sha256=c-ujod2bjL6QIvfAyuIxm1SvSCS00URFElYybKQ5Ew0,26551
12
12
  euriai/n8n.py,sha256=hjkckqyW_hZNL78UkBCof1WvKCKCIjwdvZdAgx6NrB8,3764
13
13
  euriai/smolagents.py,sha256=xlixGx2IWzAPTpSJGsYIK2L-SHGY9Mw1-8GbwVsEYtU,28507
14
- euriai-1.0.3.dist-info/METADATA,sha256=VL-iLUQt3qiPi5EMJg2_-19Z7m4zO74RvDtJ3CgwVu0,6881
15
- euriai-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- euriai-1.0.3.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
17
- euriai-1.0.3.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
18
- euriai-1.0.3.dist-info/RECORD,,
14
+ euriai-1.0.5.dist-info/METADATA,sha256=CJxhIdp9ydjeH4QtwA8PTd-abReVJ4eqt94diMDNLlU,6806
15
+ euriai-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ euriai-1.0.5.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
17
+ euriai-1.0.5.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
18
+ euriai-1.0.5.dist-info/RECORD,,
@@ -1,282 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: euriai
3
- Version: 1.0.3
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
- Dynamic: author
37
- Dynamic: author-email
38
- Dynamic: classifier
39
- Dynamic: description
40
- Dynamic: description-content-type
41
- Dynamic: license
42
- Dynamic: provides-extra
43
- Dynamic: requires-dist
44
- Dynamic: requires-python
45
- Dynamic: summary
46
-
47
- # euriai 🧠
48
-
49
- **EURI AI Python Client** – A simple wrapper and CLI tool for the [Euri API](https://euron.one/euri). Supports completions, streaming responses, embeddings, CLI interaction, and an interactive guided wizard!
50
-
51
- ---
52
-
53
- ## 🔧 Installation
54
-
55
- ```bash
56
- pip install euriai
57
- ```
58
-
59
- ## 🚀 Python Usage
60
-
61
- ### Text Generation
62
-
63
- ```python
64
- from euriai import EuriaiClient
65
-
66
- client = EuriaiClient(
67
- api_key="your_api_key_here",
68
- model="gpt-4.1-nano" # You can also try: "gemini-2.0-flash-001", "llama-4-maverick", etc.
69
- )
70
-
71
- response = client.generate_completion(
72
- prompt="Write a short poem about artificial intelligence.",
73
- temperature=0.7,
74
- max_tokens=300
75
- )
76
-
77
- print(response)
78
- ```
79
-
80
- ### Embeddings
81
-
82
- ```python
83
- from euriai.embedding import EuriaiEmbeddingClient
84
-
85
- client = EuriaiEmbeddingClient(api_key="your_key")
86
- embedding = client.embed("Hello world")
87
- print(embedding[:5]) # Print first 5 dimensions of the embedding vector
88
- ```
89
-
90
- ## 💻 Command-Line Interface (CLI) Usage
91
-
92
- Run prompts directly from the terminal:
93
-
94
- ```bash
95
- euriai --api_key YOUR_API_KEY --prompt "Tell me a joke"
96
- ```
97
-
98
- Enable streaming output (if supported by the model):
99
-
100
- ```bash
101
- euriai --api_key YOUR_API_KEY --prompt "Stream a fun fact" --stream
102
- ```
103
-
104
- List all supported model IDs with recommended use-cases and temperature/token advice:
105
-
106
- ```bash
107
- euriai --models
108
- ```
109
-
110
- ## 🤖 LangChain Integration
111
-
112
- ### Text Generation
113
-
114
- Use Euriai with LangChain directly:
115
-
116
- ```python
117
- from euriai import EuriaiLangChainLLM
118
-
119
- llm = EuriaiLangChainLLM(
120
- api_key="your_api_key",
121
- model="gpt-4.1-nano",
122
- temperature=0.7,
123
- max_tokens=300
124
- )
125
-
126
- print(llm.invoke("Write a poem about time travel."))
127
- ```
128
-
129
- ### Embeddings
130
-
131
- Use Euriai embeddings with LangChain:
132
-
133
- ```python
134
- from euriai.langchain_embed import EuriaiEmbeddings
135
-
136
- embedding_model = EuriaiEmbeddings(api_key="your_key")
137
- print(embedding_model.embed_query("What's AI?")[:5]) # Print first 5 dimensions
138
- ```
139
-
140
- ## Usage Examples
141
-
142
- ### CrewAI Integration
143
- ```python
144
- from euriai import EuriaiCrewAI
145
-
146
- # Example: Create a crew from YAML config files
147
- crew = EuriaiCrewAI.from_yaml('agents.yaml', 'tasks.yaml')
148
- result = crew.run(inputs={"topic": "AI in Healthcare"})
149
- print(result)
150
-
151
- # Or programmatically
152
- crew = EuriaiCrewAI()
153
- crew.add_agent("researcher", {
154
- "role": "Researcher",
155
- "goal": "Find information about {topic}",
156
- "llm": "openai/gpt-4o"
157
- })
158
- crew.add_task("research_task", {
159
- "description": "Research the topic {topic}",
160
- "agent": "researcher"
161
- })
162
- crew.build_crew()
163
- result = crew.run(inputs={"topic": "AI in Healthcare"})
164
- print(result)
165
- ```
166
-
167
- ### AutoGen Integration
168
- ```python
169
- from euriai import EuriaiAutoGen
170
-
171
- autogen = EuriaiAutoGen()
172
- # Add an agent (see AutoGen docs for agent config details)
173
- agent = autogen.add_agent({
174
- "name": "assistant",
175
- "llm_config": {"api_key": "YOUR_OPENAI_KEY", "model": "gpt-4o"}
176
- })
177
- # Run a chat
178
- response = autogen.run_chat("Hello, what is the weather today?")
179
- print(response)
180
- # Access chat history
181
- print(autogen.get_history())
182
- ```
183
-
184
- ### LlamaIndex Integration
185
- ```python
186
- from euriai import EuriaiLlamaIndex
187
-
188
- llama = EuriaiLlamaIndex()
189
- llama.add_documents([
190
- "Abraham Lincoln was the 16th President of the United States.",
191
- "He led the country during the American Civil War."
192
- ])
193
- llama.build_index()
194
- response = llama.query("Who was Abraham Lincoln?")
195
- print(response)
196
- ```
197
-
198
- ### LangGraph Integration
199
- ```python
200
- from euriai import EuriaiLangGraph
201
-
202
- def greet_node(state):
203
- print(f"Hello, {state['name']}!")
204
- state['greeted'] = True
205
- return state
206
-
207
- def farewell_node(state):
208
- if state.get('greeted'):
209
- print(f"Goodbye, {state['name']}!")
210
- return state
211
-
212
- # Create the graph
213
- graph = EuriaiLangGraph()
214
- graph.add_node("greet", greet_node)
215
- graph.add_node("farewell", farewell_node)
216
- graph.add_edge("greet", "farewell")
217
- graph.set_state({"name": "Alice"})
218
- result = graph.run()
219
- print(result)
220
- ```
221
-
222
- ---
223
-
224
- ## 2. **SmolAgents Integration**
225
-
226
- ```python
227
- from euriai import EuriaiSmolAgent
228
-
229
- # Define a tool using the @tool decorator
230
- try:
231
- from smolagents import tool
232
- except ImportError:
233
- raise ImportError("Please install smolagents: pip install smolagents")
234
-
235
- @tool
236
- def add(a: int, b: int) -> int:
237
- """Add two numbers."""
238
- return a + b
239
-
240
- # Create the agent with the tool
241
- agent = EuriaiSmolAgent(tools=[add])
242
- response = agent.run("What is 2 + 3?")
243
- print(response)
244
- ```
245
-
246
- ---
247
-
248
- ## 3. **n8n Integration**
249
-
250
- ```python
251
- from euriai import EuriaiN8N
252
-
253
- # Initialize with your n8n instance URL and (optionally) API key
254
- n8n = EuriaiN8N(base_url="http://localhost:5678", api_key="YOUR_N8N_API_KEY")
255
-
256
- # Trigger a workflow by its webhook ID, passing data as needed
257
- workflow_id = "your-workflow-webhook-id"
258
- data = {"message": "Hello from EURI SDK!"}
259
- result = n8n.trigger_workflow(workflow_id, data)
260
- print(result)
261
- ```
262
-
263
- ---
264
-
265
- **You can copy-paste these code blocks into your client documentation or UI for user reference.**
266
- If you want advanced examples (e.g., multi-tool SmolAgents, LangGraph with more nodes, or n8n with authentication), just let me know!
267
-
268
- ## 📘 Documentation
269
-
270
- For full documentation, visit our [official docs site](https://euron.one/euri).
271
-
272
- ## 🔑 Getting an API Key
273
-
274
- Sign up for an API key at [Euron AI Platform](https://euron.one/euri).
275
-
276
- ## 🤝 Contributing
277
-
278
- Contributions are welcome! Please feel free to submit a Pull Request.
279
-
280
- ## 📄 License
281
-
282
- This project is licensed under the MIT License - see the LICENSE file for details.
File without changes