euriai 0.3.25__tar.gz → 0.3.27__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euriai
3
- Version: 0.3.25
3
+ Version: 0.3.27
4
4
  Summary: Python client for EURI LLM API (euron.one) with CLI, LangChain, and LlamaIndex integration
5
5
  Author: euron.one
6
6
  Author-email: sudhanshu@euron.one
@@ -5,12 +5,6 @@ from llama_index.core.base.llms.types import ChatMessage, CompletionResponse, Co
5
5
 
6
6
 
7
7
  class EuriaiLlamaIndexLLM(LLM):
8
- api_key: str
9
- model: str = "gpt-4.1-nano"
10
- temperature: float = 0.7
11
- max_tokens: int = 1000
12
- url: str = "https://api.euron.one/api/v1/euri/alpha/chat/completions"
13
-
14
8
  def __init__(
15
9
  self,
16
10
  api_key: str,
@@ -18,13 +12,24 @@ class EuriaiLlamaIndexLLM(LLM):
18
12
  temperature: Optional[float] = None,
19
13
  max_tokens: Optional[int] = None,
20
14
  ):
21
- # ✅ Pydantic-style super init with all fields
22
- super().__init__(
23
- api_key=api_key,
24
- model=model or self.model,
25
- temperature=temperature if temperature is not None else self.temperature,
26
- max_tokens=max_tokens if max_tokens is not None else self.max_tokens,
27
- )
15
+ """
16
+ Initializes the EuriaiLlamaIndexLLM.
17
+
18
+ Args:
19
+ api_key (str): Your EURI API key.
20
+ model (str, optional): Model ID to use. Defaults to "gpt-4.1-nano".
21
+ temperature (float, optional): Sampling temperature. Defaults to 0.7.
22
+ max_tokens (int, optional): Maximum number of tokens. Defaults to 1000.
23
+ """
24
+ # Set default values first
25
+ self.api_key = api_key
26
+ self.model = model if model is not None else "gpt-4.1-nano"
27
+ self.temperature = temperature if temperature is not None else 0.7
28
+ self.max_tokens = max_tokens if max_tokens is not None else 1000
29
+ self.url = "https://api.euron.one/api/v1/euri/alpha/chat/completions"
30
+
31
+ # Now initialize the parent class
32
+ super().__init__()
28
33
 
29
34
  @property
30
35
  def metadata(self):
@@ -1,14 +1,20 @@
1
1
  import requests
2
2
  import numpy as np
3
- from llama_index.core.embeddings.base import BaseEmbedding
3
+ from llama_index.core.embeddings import BaseEmbedding
4
4
 
5
5
  class EuriaiLlamaIndexEmbedding(BaseEmbedding):
6
6
  def __init__(self, api_key: str, model: str = "text-embedding-3-small"):
7
+ """Initialize embedding model with API key and model name."""
8
+ # Set instance attributes first
7
9
  self.api_key = api_key
8
10
  self.model = model
9
11
  self.url = "https://api.euron.one/api/v1/euri/alpha/embeddings"
12
+
13
+ # Then call the parent class constructor
14
+ super().__init__()
10
15
 
11
16
  def _post_embedding(self, texts):
17
+ """Helper method to post data to API and get embeddings."""
12
18
  headers = {
13
19
  "Content-Type": "application/json",
14
20
  "Authorization": f"Bearer {self.api_key}"
@@ -22,7 +28,9 @@ class EuriaiLlamaIndexEmbedding(BaseEmbedding):
22
28
  return [np.array(obj["embedding"]).tolist() for obj in response.json()["data"]]
23
29
 
24
30
  def get_text_embedding(self, text: str) -> list[float]:
31
+ """Get embedding for a single text."""
25
32
  return self._post_embedding([text])[0]
26
33
 
27
34
  def get_text_embeddings(self, texts: list[str]) -> list[list[float]]:
35
+ """Get embeddings for multiple texts."""
28
36
  return self._post_embedding(texts)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: euriai
3
- Version: 0.3.25
3
+ Version: 0.3.27
4
4
  Summary: Python client for EURI LLM API (euron.one) with CLI, LangChain, and LlamaIndex integration
5
5
  Author: euron.one
6
6
  Author-email: sudhanshu@euron.one
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="euriai",
5
- version="0.3.25",
5
+ version="0.3.27",
6
6
  description="Python client for EURI LLM 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",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes