euriai 0.3.14__tar.gz → 0.3.16__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-0.3.14 → euriai-0.3.16}/PKG-INFO +1 -1
- {euriai-0.3.14 → euriai-0.3.16}/euriai/llamaindex/euri_chat.py +19 -8
- {euriai-0.3.14 → euriai-0.3.16}/euriai.egg-info/PKG-INFO +1 -1
- {euriai-0.3.14 → euriai-0.3.16}/setup.py +1 -1
- {euriai-0.3.14 → euriai-0.3.16}/README.md +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/__init__.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/cli.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/client.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/embedding.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/langchain_embed.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/langchain_llm.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/llamaindex/__init__.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai/llamaindex/euri_embed.py +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai.egg-info/SOURCES.txt +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai.egg-info/dependency_links.txt +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai.egg-info/entry_points.txt +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai.egg-info/requires.txt +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/euriai.egg-info/top_level.txt +0 -0
- {euriai-0.3.14 → euriai-0.3.16}/setup.cfg +0 -0
@@ -1,17 +1,30 @@
|
|
1
1
|
import requests
|
2
|
-
from typing import List
|
3
|
-
from dataclasses import dataclass, field
|
2
|
+
from typing import List, Optional
|
4
3
|
from llama_index.core.llms import LLM
|
5
4
|
from llama_index.core.base.llms.types import ChatMessage, CompletionResponse, CompletionResponseGen
|
6
5
|
|
7
6
|
|
8
|
-
@dataclass
|
9
7
|
class EuriaiLlamaIndexLLM(LLM):
|
10
8
|
api_key: str
|
11
9
|
model: str = "gpt-4.1-nano"
|
12
10
|
temperature: float = 0.7
|
13
11
|
max_tokens: int = 1000
|
14
|
-
url: str =
|
12
|
+
url: str = "https://api.euron.one/api/v1/chat/completions"
|
13
|
+
|
14
|
+
def __init__(
|
15
|
+
self,
|
16
|
+
api_key: str,
|
17
|
+
model: Optional[str] = None,
|
18
|
+
temperature: Optional[float] = None,
|
19
|
+
max_tokens: Optional[int] = None,
|
20
|
+
):
|
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
28
|
|
16
29
|
@property
|
17
30
|
def metadata(self):
|
@@ -38,18 +51,16 @@ class EuriaiLlamaIndexLLM(LLM):
|
|
38
51
|
response.raise_for_status()
|
39
52
|
result = response.json()
|
40
53
|
content = result["choices"][0]["message"]["content"]
|
41
|
-
|
42
54
|
return CompletionResponse(text=content)
|
43
55
|
|
44
56
|
def complete(self, prompt: str, **kwargs) -> CompletionResponse:
|
45
57
|
return self.chat([ChatMessage(role="user", content=prompt)])
|
46
58
|
|
47
|
-
# Async & streaming not implemented
|
48
59
|
async def achat(self, messages: List[ChatMessage], **kwargs) -> CompletionResponse:
|
49
|
-
raise NotImplementedError("Async chat not
|
60
|
+
raise NotImplementedError("Async chat not supported.")
|
50
61
|
|
51
62
|
async def acomplete(self, prompt: str, **kwargs) -> CompletionResponse:
|
52
|
-
raise NotImplementedError("Async complete not
|
63
|
+
raise NotImplementedError("Async complete not supported.")
|
53
64
|
|
54
65
|
def stream_chat(self, messages: List[ChatMessage], **kwargs) -> CompletionResponseGen:
|
55
66
|
raise NotImplementedError("Streaming not supported.")
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="euriai",
|
5
|
-
version="0.3.
|
5
|
+
version="0.3.16",
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|