euriai 0.3.25__py3-none-any.whl → 0.3.26__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/euri_embed.py +7 -1
- {euriai-0.3.25.dist-info → euriai-0.3.26.dist-info}/METADATA +1 -1
- {euriai-0.3.25.dist-info → euriai-0.3.26.dist-info}/RECORD +6 -6
- {euriai-0.3.25.dist-info → euriai-0.3.26.dist-info}/WHEEL +0 -0
- {euriai-0.3.25.dist-info → euriai-0.3.26.dist-info}/entry_points.txt +0 -0
- {euriai-0.3.25.dist-info → euriai-0.3.26.dist-info}/top_level.txt +0 -0
euriai/euri_embed.py
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
import requests
|
2
2
|
import numpy as np
|
3
|
-
from llama_index.core.embeddings
|
3
|
+
from llama_index.core.embeddings import BaseEmbedding # Correct import path
|
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."""
|
7
8
|
self.api_key = api_key
|
8
9
|
self.model = model
|
9
10
|
self.url = "https://api.euron.one/api/v1/euri/alpha/embeddings"
|
11
|
+
# Call the parent class constructor (important!)
|
12
|
+
super().__init__()
|
10
13
|
|
11
14
|
def _post_embedding(self, texts):
|
15
|
+
"""Helper method to post data to API and get embeddings."""
|
12
16
|
headers = {
|
13
17
|
"Content-Type": "application/json",
|
14
18
|
"Authorization": f"Bearer {self.api_key}"
|
@@ -22,7 +26,9 @@ class EuriaiLlamaIndexEmbedding(BaseEmbedding):
|
|
22
26
|
return [np.array(obj["embedding"]).tolist() for obj in response.json()["data"]]
|
23
27
|
|
24
28
|
def get_text_embedding(self, text: str) -> list[float]:
|
29
|
+
"""Get embedding for a single text."""
|
25
30
|
return self._post_embedding([text])[0]
|
26
31
|
|
27
32
|
def get_text_embeddings(self, texts: list[str]) -> list[list[float]]:
|
33
|
+
"""Get embeddings for multiple texts."""
|
28
34
|
return self._post_embedding(texts)
|
@@ -3,11 +3,11 @@ euriai/cli.py,sha256=hF1wiiL2QQSfWf8WlLQyNVDBd4YkbiwmMSoPxVbyPTM,3290
|
|
3
3
|
euriai/client.py,sha256=USiqdMULgAiky7nkrJKF3FyKcOS2DtDmUdbeBSnyLYk,4076
|
4
4
|
euriai/embedding.py,sha256=z-LLKU68tCrPi9QMs1tlKwyr7WJcjceCTkNQIFMG6vA,1276
|
5
5
|
euriai/euri_chat.py,sha256=MWm_S4aEERGtOMRRDVaYeNIBe1Rw7S2mIlpz1qJJA_Y,2962
|
6
|
-
euriai/euri_embed.py,sha256=
|
6
|
+
euriai/euri_embed.py,sha256=JP95iXt3CXQN7KDf3SWj_apmohJzFQaWuZi2wbcA5bM,1403
|
7
7
|
euriai/langchain_embed.py,sha256=OXWWxiKJ4g24TFgnWPOCZvhK7G8xtSf0ppQ2zwHkIPM,584
|
8
8
|
euriai/langchain_llm.py,sha256=D5YvYwV7q9X2_vdoaQiPs7tNiUmjkGz-9Q-7M61hhkg,986
|
9
|
-
euriai-0.3.
|
10
|
-
euriai-0.3.
|
11
|
-
euriai-0.3.
|
12
|
-
euriai-0.3.
|
13
|
-
euriai-0.3.
|
9
|
+
euriai-0.3.26.dist-info/METADATA,sha256=paZYemP9F8IP1lyab5vkeJrOQsiqLaU4XZryxFUloyY,3249
|
10
|
+
euriai-0.3.26.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
11
|
+
euriai-0.3.26.dist-info/entry_points.txt,sha256=9OkET8KIGcsjQn8UlnpPKRT75s2KW34jq1__1SXtpMA,43
|
12
|
+
euriai-0.3.26.dist-info/top_level.txt,sha256=TG1htJ8cuD62MXn-NJ7DVF21QHY16w6M_QgfF_Er_EQ,7
|
13
|
+
euriai-0.3.26.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|