euriai 0.4__py3-none-any.whl → 1.0.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euriai
3
- Version: 0.4
3
+ Version: 1.0.0
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
@@ -0,0 +1,18 @@
1
+ euriai/__init__.py,sha256=5AFG_ovSriY5Kfz0kb1uKuNK_ei6o4k-kcCgoTZqNk0,795
2
+ euriai/autogen.py,sha256=4YAHrY65YYOKVsBjQa9G8pr-_Xxss1uR08qLAFzo7Rk,16023
3
+ euriai/cli.py,sha256=hF1wiiL2QQSfWf8WlLQyNVDBd4YkbiwmMSoPxVbyPTM,3290
4
+ euriai/client.py,sha256=L-o6hv9N3md-l-hz-kz5nYVaaZqnrREZlo_0jguhF7E,4066
5
+ euriai/crewai.py,sha256=stnwsChy4MYXwWP6JBk_twg61EZTaTj8zoBiLN5n_I0,7135
6
+ euriai/embedding.py,sha256=uP66Ph1k9Ou6J5RAkztJxlfyj0S0MESOvZ4ulhnVo-o,1270
7
+ euriai/euri_chat.py,sha256=DEAiet1ReRwB4ljkPYaTl1Nb5uc20-JF-3PQjGQZXk4,3567
8
+ euriai/euri_embed.py,sha256=VE-RLUb5bYnEFA_dxFkj2c3Jr_SYyJKPmFOzsDOR0Ys,2137
9
+ euriai/langchain.py,sha256=ZHET7cO9CslXIMSKFYcjwCLWfP8pov22Udal5gSMOoo,29640
10
+ euriai/langgraph.py,sha256=sw9e-PnfwAwmp_tUCnAGIUB78GyJsMkAzxOGvFUafiM,34128
11
+ euriai/llamaindex.py,sha256=c-ujod2bjL6QIvfAyuIxm1SvSCS00URFElYybKQ5Ew0,26551
12
+ euriai/n8n.py,sha256=hjkckqyW_hZNL78UkBCof1WvKCKCIjwdvZdAgx6NrB8,3764
13
+ euriai/smolagents.py,sha256=xlixGx2IWzAPTpSJGsYIK2L-SHGY9Mw1-8GbwVsEYtU,28507
14
+ euriai-1.0.0.dist-info/METADATA,sha256=3qQs4Z403ImXKfKnzI3__uftPhwdd_MSEFyT9rn5iPA,6881
15
+ euriai-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ euriai-1.0.0.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
17
+ euriai-1.0.0.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
18
+ euriai-1.0.0.dist-info/RECORD,,
euriai/euri_autogen.py DELETED
@@ -1,74 +0,0 @@
1
- from typing import Optional, Dict, Any, List
2
-
3
- try:
4
- import autogen
5
- except ImportError:
6
- autogen = None
7
-
8
- class EuriaiAutoGen:
9
- """
10
- Full-featured wrapper for AutoGen integration in the EURI SDK.
11
- Allows programmatic agent, tool, and workflow management, and chat execution.
12
- """
13
- def __init__(self, config: Optional[Dict[str, Any]] = None):
14
- """
15
- Initialize the AutoGen wrapper.
16
- Args:
17
- config: Dict of config options (API keys, model, etc.)
18
- """
19
- if autogen is None:
20
- raise ImportError("AutoGen is not installed. Please install with `pip install pyautogen`.")
21
- self.config = config or {}
22
- self.agents: List[Any] = []
23
- self.tools: List[Any] = []
24
- self.memory: Optional[Any] = None
25
- self.workflow: Optional[Any] = None
26
- self.history: List[Dict[str, Any]] = []
27
-
28
- def add_agent(self, agent_config: Dict[str, Any]) -> Any:
29
- """Add an agent with config."""
30
- agent = autogen.Agent(**agent_config)
31
- self.agents.append(agent)
32
- return agent
33
-
34
- def add_tool(self, tool_config: Dict[str, Any]) -> Any:
35
- """Add a tool with config."""
36
- tool = autogen.Tool(**tool_config)
37
- self.tools.append(tool)
38
- return tool
39
-
40
- def set_memory(self, memory_config: Dict[str, Any]) -> None:
41
- """Set memory for the workflow."""
42
- self.memory = autogen.Memory(**memory_config)
43
-
44
- def run_chat(self, prompt: str, agent_idx: int = 0, **kwargs) -> str:
45
- """
46
- Run a chat with the specified agent and prompt.
47
- Returns the agent's response.
48
- """
49
- if not self.agents:
50
- raise ValueError("No agents defined. Use add_agent().")
51
- agent = self.agents[agent_idx]
52
- response = agent.chat(prompt, **kwargs)
53
- self.history.append({"agent": agent, "prompt": prompt, "response": response})
54
- return response
55
-
56
- def run_workflow(self, workflow_config: Dict[str, Any], **kwargs) -> Any:
57
- """
58
- Run a custom workflow (advanced usage).
59
- """
60
- workflow = autogen.Workflow(**workflow_config)
61
- self.workflow = workflow
62
- result = workflow.run(**kwargs)
63
- return result
64
-
65
- def get_history(self) -> List[Dict[str, Any]]:
66
- return self.history
67
-
68
- def reset(self):
69
- """Reset agents, tools, memory, and history."""
70
- self.agents = []
71
- self.tools = []
72
- self.memory = None
73
- self.workflow = None
74
- self.history = []
euriai/euri_crewai.py DELETED
@@ -1,92 +0,0 @@
1
- import os
2
- from typing import Optional, Dict, Any, List, Union
3
-
4
- # CrewAI imports (user must install crewai)
5
- try:
6
- from crewai import Agent, Crew, Task, Process
7
- except ImportError:
8
- Agent = Crew = Task = Process = None
9
-
10
- class EuriaiCrewAI:
11
- """
12
- Full-featured wrapper for CrewAI integration in the EURI SDK.
13
- Allows programmatic and config-based crew creation, agent/task management, and workflow execution.
14
- """
15
- def __init__(self, agents: Optional[Dict[str, Any]] = None, tasks: Optional[Dict[str, Any]] = None, process: str = "sequential", verbose: bool = True):
16
- """
17
- Initialize the CrewAI wrapper.
18
- Args:
19
- agents: Dict of agent configs or Agent objects.
20
- tasks: Dict of task configs or Task objects.
21
- process: 'sequential' or 'parallel'.
22
- verbose: Print detailed logs.
23
- """
24
- if Agent is None:
25
- raise ImportError("CrewAI is not installed. Please install with `pip install crewai`.")
26
- self.agents_config = agents or {}
27
- self.tasks_config = tasks or {}
28
- self.process = Process.sequential if process == "sequential" else Process.parallel
29
- self.verbose = verbose
30
- self._agents: List[Agent] = []
31
- self._tasks: List[Task] = []
32
- self._crew: Optional[Crew] = None
33
-
34
- def add_agent(self, name: str, config: Dict[str, Any]) -> None:
35
- """Add an agent by config."""
36
- agent = Agent(**config)
37
- self._agents.append(agent)
38
- self.agents_config[name] = config
39
-
40
- def add_task(self, name: str, config: Dict[str, Any]) -> None:
41
- """Add a task by config."""
42
- task = Task(**config)
43
- self._tasks.append(task)
44
- self.tasks_config[name] = config
45
-
46
- def build_crew(self) -> Crew:
47
- """Build the Crew object from current agents and tasks."""
48
- if not self._agents:
49
- self._agents = [Agent(**cfg) for cfg in self.agents_config.values()]
50
- if not self._tasks:
51
- self._tasks = [Task(**cfg) for cfg in self.tasks_config.values()]
52
- self._crew = Crew(agents=self._agents, tasks=self._tasks, process=self.process, verbose=self.verbose)
53
- return self._crew
54
-
55
- def run(self, inputs: Optional[Dict[str, Any]] = None) -> Any:
56
- """
57
- Run the crew workflow. Optionally pass input variables for tasks.
58
- Returns the final result or report.
59
- """
60
- if self._crew is None:
61
- self.build_crew()
62
- return self._crew.kickoff(inputs=inputs or {})
63
-
64
- @classmethod
65
- def from_yaml(cls, agents_yaml: str, tasks_yaml: str, process: str = "sequential", verbose: bool = True):
66
- """
67
- Create a CrewAI wrapper from YAML config files.
68
- Args:
69
- agents_yaml: Path to agents.yaml
70
- tasks_yaml: Path to tasks.yaml
71
- """
72
- import yaml
73
- with open(agents_yaml, "r") as f:
74
- agents = yaml.safe_load(f)
75
- with open(tasks_yaml, "r") as f:
76
- tasks = yaml.safe_load(f)
77
- return cls(agents=agents, tasks=tasks, process=process, verbose=verbose)
78
-
79
- def get_agents(self) -> List[Agent]:
80
- return self._agents
81
-
82
- def get_tasks(self) -> List[Task]:
83
- return self._tasks
84
-
85
- def get_crew(self) -> Optional[Crew]:
86
- return self._crew
87
-
88
- def reset(self):
89
- """Reset agents, tasks, and crew."""
90
- self._agents = []
91
- self._tasks = []
92
- self._crew = None
euriai/euri_langgraph.py DELETED
@@ -1,64 +0,0 @@
1
- from typing import Any, Callable, Dict, List, Optional, Union
2
-
3
- try:
4
- from langgraph.graph import StateGraph
5
- except ImportError:
6
- StateGraph = None
7
-
8
- class EuriaiLangGraph:
9
- """
10
- Full-featured wrapper for LangGraph integration in the EURI SDK.
11
- Allows programmatic graph construction, node/edge management, and workflow execution.
12
- """
13
- def __init__(self, name: str = "EuriaiLangGraph", state: Optional[Dict[str, Any]] = None):
14
- """
15
- Initialize the LangGraph wrapper.
16
- Args:
17
- name: Name of the graph.
18
- state: Initial state dictionary.
19
- """
20
- if StateGraph is None:
21
- raise ImportError("LangGraph is not installed. Please install with `pip install langgraph`.")
22
- self.name = name
23
- self.state = state or {}
24
- self.graph = StateGraph()
25
- self.nodes: Dict[str, Callable] = {}
26
- self.edges: List[tuple] = []
27
-
28
- def add_node(self, node_name: str, node_fn: Callable) -> None:
29
- """Add a node to the graph."""
30
- self.graph.add_node(node_name, node_fn)
31
- self.nodes[node_name] = node_fn
32
-
33
- def add_edge(self, from_node: str, to_node: str) -> None:
34
- """Add an edge between two nodes."""
35
- self.graph.add_edge(from_node, to_node)
36
- self.edges.append((from_node, to_node))
37
-
38
- def set_state(self, state: Dict[str, Any]) -> None:
39
- """Set the initial state for the graph execution."""
40
- self.state = state
41
-
42
- def run(self, input_state: Optional[Dict[str, Any]] = None, **kwargs) -> Any:
43
- """
44
- Run the graph workflow with the given state.
45
- Returns the final state/output.
46
- """
47
- state = input_state or self.state
48
- return self.graph.run(state, **kwargs)
49
-
50
- def get_nodes(self) -> Dict[str, Callable]:
51
- return self.nodes
52
-
53
- def get_edges(self) -> List[tuple]:
54
- return self.edges
55
-
56
- def get_graph(self) -> Any:
57
- return self.graph
58
-
59
- def reset(self):
60
- """Reset the graph, nodes, and edges."""
61
- self.graph = StateGraph()
62
- self.nodes = {}
63
- self.edges = []
64
- self.state = {}
euriai/euri_llamaindex.py DELETED
@@ -1,58 +0,0 @@
1
- from typing import Optional, List, Any, Dict, Union
2
-
3
- try:
4
- from llama_index.core import VectorStoreIndex, ServiceContext
5
- from llama_index.core.llms import LLM
6
- from llama_index.core.schema import Document
7
- except ImportError:
8
- VectorStoreIndex = ServiceContext = LLM = Document = None
9
-
10
- class EuriaiLlamaIndex:
11
- """
12
- Full-featured wrapper for LlamaIndex integration in the EURI SDK.
13
- Allows document ingestion, index building, and querying with advanced config.
14
- """
15
- def __init__(self, llm: Optional[Any] = None, service_context: Optional[Any] = None):
16
- """
17
- Initialize the LlamaIndex wrapper.
18
- Args:
19
- llm: LLM object (optional)
20
- service_context: ServiceContext object (optional)
21
- """
22
- if VectorStoreIndex is None:
23
- raise ImportError("LlamaIndex is not installed. Please install with `pip install llama_index`.")
24
- self.llm = llm
25
- self.service_context = service_context or (ServiceContext.from_defaults(llm=llm) if llm else ServiceContext.from_defaults())
26
- self.index: Optional[Any] = None
27
- self.documents: List[Any] = []
28
-
29
- def add_documents(self, docs: List[Union[str, Dict[str, Any]]]) -> None:
30
- """Add documents (as strings or dicts) to the index."""
31
- for doc in docs:
32
- if isinstance(doc, str):
33
- self.documents.append(Document(text=doc))
34
- elif isinstance(doc, dict):
35
- self.documents.append(Document(**doc))
36
- else:
37
- raise ValueError("Document must be str or dict.")
38
-
39
- def build_index(self) -> None:
40
- """Build the vector index from current documents."""
41
- self.index = VectorStoreIndex.from_documents(self.documents)
42
-
43
- def query(self, query: str, **kwargs) -> Any:
44
- """
45
- Query the index with a string. Returns the response object.
46
- """
47
- if self.index is None:
48
- self.build_index()
49
- query_engine = self.index.as_query_engine(service_context=self.service_context)
50
- return query_engine.query(query, **kwargs)
51
-
52
- def get_index(self) -> Optional[Any]:
53
- return self.index
54
-
55
- def reset(self):
56
- """Reset documents and index."""
57
- self.documents = []
58
- self.index = None
euriai/euri_n8n.py DELETED
@@ -1,30 +0,0 @@
1
- import requests
2
- from typing import Any, Dict, Optional
3
-
4
- class EuriaiN8N:
5
- """
6
- Wrapper for n8n workflow automation integration in the EURI SDK.
7
- Allows triggering n8n workflows and exchanging data via REST API.
8
- """
9
- def __init__(self, base_url: str, api_key: Optional[str] = None):
10
- """
11
- Initialize the n8n wrapper.
12
- Args:
13
- base_url: Base URL of the n8n instance (e.g., http://localhost:5678 or cloud URL)
14
- api_key: Optional API key for authentication
15
- """
16
- self.base_url = base_url.rstrip('/')
17
- self.api_key = api_key
18
-
19
- def trigger_workflow(self, workflow_id: str, data: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
20
- """
21
- Trigger an n8n workflow by ID, optionally passing data.
22
- Returns the workflow execution response.
23
- """
24
- url = f"{self.base_url}/webhook/{workflow_id}"
25
- headers = {}
26
- if self.api_key:
27
- headers["Authorization"] = f"Bearer {self.api_key}"
28
- response = requests.post(url, json=data or {}, headers=headers)
29
- response.raise_for_status()
30
- return response.json()
euriai/euri_smolagents.py DELETED
@@ -1,44 +0,0 @@
1
- from typing import Any, Callable, Dict, List, Optional
2
-
3
- try:
4
- from smolagents import CodeAgent, HfApiModel, tool
5
- except ImportError:
6
- CodeAgent = HfApiModel = tool = None
7
-
8
- class EuriaiSmolAgent:
9
- """
10
- Full-featured wrapper for SmolAgents integration in the EURI SDK.
11
- Allows agent creation, tool integration, and task execution.
12
- """
13
- def __init__(self, model: Optional[Any] = None, tools: Optional[List[Callable]] = None):
14
- """
15
- Initialize the SmolAgent wrapper.
16
- Args:
17
- model: LLM model (default: HfApiModel())
18
- tools: List of tool functions (decorated with @tool)
19
- """
20
- if CodeAgent is None:
21
- raise ImportError("SmolAgents is not installed. Please install with `pip install smolagents`.")
22
- self.model = model or HfApiModel()
23
- self.tools = tools or []
24
- self.agent = CodeAgent(tools=self.tools, model=self.model)
25
-
26
- def add_tool(self, tool_fn: Callable) -> None:
27
- """Add a tool to the agent."""
28
- self.tools.append(tool_fn)
29
- self.agent = CodeAgent(tools=self.tools, model=self.model)
30
-
31
- def run(self, prompt: str, **kwargs) -> Any:
32
- """
33
- Run the agent on a prompt/task.
34
- Returns the agent's response.
35
- """
36
- return self.agent.run(prompt, **kwargs)
37
-
38
- def get_agent(self) -> Any:
39
- return self.agent
40
-
41
- def reset(self):
42
- """Reset the agent and tools."""
43
- self.tools = []
44
- self.agent = CodeAgent(tools=self.tools, model=self.model)
euriai/langchain_embed.py DELETED
@@ -1,17 +0,0 @@
1
- try:
2
- from langchain_core.embeddings import Embeddings
3
- except ImportError:
4
- raise ImportError("LangChain is not installed. Please install with 'pip install euriai[langchain]' or 'pip install langchain'.")
5
- from typing import List
6
- from euriai.embedding import EuriaiEmbeddingClient
7
-
8
-
9
- class EuriaiEmbeddings(Embeddings):
10
- def __init__(self, api_key: str, model: str = "text-embedding-3-small"):
11
- self.client = EuriaiEmbeddingClient(api_key=api_key, model=model)
12
-
13
- def embed_documents(self, texts: List[str]) -> List[List[float]]:
14
- return [embedding.tolist() for embedding in self.client.embed_batch(texts)]
15
-
16
- def embed_query(self, text: str) -> List[float]:
17
- return self.client.embed(text).tolist()
euriai/langchain_llm.py DELETED
@@ -1,29 +0,0 @@
1
- try:
2
- from langchain.llms.base import LLM
3
- except ImportError:
4
- raise ImportError("LangChain is not installed. Please install with 'pip install euriai[langchain]' or 'pip install langchain'.")
5
- from typing import Optional, List
6
- from euriai import EuriaiClient
7
-
8
-
9
- class EuriaiLangChainLLM(LLM):
10
- model: str = "gpt-4.1-nano"
11
- temperature: float = 0.7
12
- max_tokens: int = 300
13
-
14
- def __init__(self, api_key: str, model: str = "gpt-4.1-nano", temperature: float = 0.7, max_tokens: int = 300, **kwargs):
15
- super().__init__(model=model, temperature=temperature, max_tokens=max_tokens, **kwargs)
16
- object.__setattr__(self, "_client", EuriaiClient(api_key=api_key, model=model))
17
-
18
- @property
19
- def _llm_type(self) -> str:
20
- return "euriai"
21
-
22
- def _call(self, prompt: str, stop: Optional[List[str]] = None) -> str:
23
- response = self._client.generate_completion(
24
- prompt=prompt,
25
- temperature=self.temperature,
26
- max_tokens=self.max_tokens,
27
- stop=stop
28
- )
29
- return response.get("choices", [{}])[0].get("message", {}).get("content", "")
@@ -1,19 +0,0 @@
1
- euriai/__init__.py,sha256=JaXTVZFPARYHzpICgl-F5hd5OCYcwG0IOdTXV4wsrK4,835
2
- euriai/cli.py,sha256=hF1wiiL2QQSfWf8WlLQyNVDBd4YkbiwmMSoPxVbyPTM,3290
3
- euriai/client.py,sha256=L-o6hv9N3md-l-hz-kz5nYVaaZqnrREZlo_0jguhF7E,4066
4
- euriai/embedding.py,sha256=uP66Ph1k9Ou6J5RAkztJxlfyj0S0MESOvZ4ulhnVo-o,1270
5
- euriai/euri_autogen.py,sha256=OSrQJbbPXXgZ5bubofxnvq-dabs8B8G2dfSHn-LCbw0,2515
6
- euriai/euri_chat.py,sha256=DEAiet1ReRwB4ljkPYaTl1Nb5uc20-JF-3PQjGQZXk4,3567
7
- euriai/euri_crewai.py,sha256=1Z_lqHr4Jn0mt7jTsh8JXWdjpC_q1AhN-Mm6PDigG10,3443
8
- euriai/euri_embed.py,sha256=VE-RLUb5bYnEFA_dxFkj2c3Jr_SYyJKPmFOzsDOR0Ys,2137
9
- euriai/euri_langgraph.py,sha256=x8RNSrdcCzY6AunNNHzeX3297srecNUwHdDLTrBb1u8,2131
10
- euriai/euri_llamaindex.py,sha256=AVBgfm_cQiZEpfcIAcMeIs55eW_SvDPJPZ31Y_blN0I,2281
11
- euriai/euri_n8n.py,sha256=8JvEgvq14ZI7k5_Rfimpbht4RtYSwMh2gKyo1H4Wl6M,1148
12
- euriai/euri_smolagents.py,sha256=RcxwI9coXF_DmIy_0TqEF737CIIpZn8f0p_9G5rSFpY,1530
13
- euriai/langchain_embed.py,sha256=9nZgD_99CCpsGvXpLUW-Gklxp-pJ4IMhO8ZfbesqLyI,749
14
- euriai/langchain_llm.py,sha256=BKNg1i48EAciEXyBVK7_Y9glkhLGWF_OfkKPzvnLtB0,1151
15
- euriai-0.4.dist-info/METADATA,sha256=G0fouJYynkW0KG8mcqABkL5TKbEoLLwAJSInBSOgHxg,6879
16
- euriai-0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- euriai-0.4.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
18
- euriai-0.4.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
19
- euriai-0.4.dist-info/RECORD,,
File without changes