uncertainty-engine-types 0.0.8__py3-none-any.whl → 0.0.9__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.
- uncertainty_engine_types/__init__.py +6 -2
- uncertainty_engine_types/dataset.py +5 -0
- uncertainty_engine_types/embeddings.py +32 -0
- uncertainty_engine_types/llm.py +13 -3
- uncertainty_engine_types/version.py +1 -1
- {uncertainty_engine_types-0.0.8.dist-info → uncertainty_engine_types-0.0.9.dist-info}/METADATA +1 -1
- {uncertainty_engine_types-0.0.8.dist-info → uncertainty_engine_types-0.0.9.dist-info}/RECORD +8 -6
- {uncertainty_engine_types-0.0.8.dist-info → uncertainty_engine_types-0.0.9.dist-info}/WHEEL +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
from . import utils
|
|
2
2
|
from .context import Context
|
|
3
3
|
from .conversation import Conversation
|
|
4
|
+
from .dataset import CSVDataset
|
|
5
|
+
from .embeddings import TextEmbeddingsConfig, TextEmbeddingsProvider
|
|
4
6
|
from .execution_error import ExecutionError
|
|
5
7
|
from .file import (
|
|
8
|
+
PDF,
|
|
6
9
|
Document,
|
|
7
10
|
File,
|
|
8
11
|
FileLocation,
|
|
9
12
|
Image,
|
|
10
13
|
LocalStorage,
|
|
11
14
|
Mesh,
|
|
12
|
-
PDF,
|
|
13
15
|
S3Storage,
|
|
14
16
|
SQLTable,
|
|
15
17
|
TabularData,
|
|
@@ -28,11 +30,11 @@ from .token import Token
|
|
|
28
30
|
from .vector_store import VectorStoreConfig, VectorStoreProvider
|
|
29
31
|
from .version import __version__
|
|
30
32
|
|
|
31
|
-
|
|
32
33
|
__all__ = [
|
|
33
34
|
"__version__",
|
|
34
35
|
"Context",
|
|
35
36
|
"Conversation",
|
|
37
|
+
"CSVDataset",
|
|
36
38
|
"Document",
|
|
37
39
|
"ExecutionError",
|
|
38
40
|
"File",
|
|
@@ -62,6 +64,8 @@ __all__ = [
|
|
|
62
64
|
"SQLTable",
|
|
63
65
|
"TabularData",
|
|
64
66
|
"TargetHandle",
|
|
67
|
+
"TextEmbeddingsConfig",
|
|
68
|
+
"TextEmbeddingsProvider",
|
|
65
69
|
"Token",
|
|
66
70
|
"utils",
|
|
67
71
|
"VectorStoreConfig",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from pydantic import BaseModel, model_validator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TextEmbeddingsProvider(StrEnum):
|
|
8
|
+
OPENAI = "openai"
|
|
9
|
+
OLLAMA = "ollama"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TextEmbeddingsConfig(BaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Connection configuration for text embedding models.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
provider: str
|
|
18
|
+
model: Optional[str] = None
|
|
19
|
+
ollama_url: Optional[str] = None
|
|
20
|
+
openai_api_key: Optional[str] = None
|
|
21
|
+
|
|
22
|
+
@model_validator(mode="before")
|
|
23
|
+
@classmethod
|
|
24
|
+
def check_provider(cls, values):
|
|
25
|
+
provider = values.get("provider")
|
|
26
|
+
if provider == TextEmbeddingsProvider.OLLAMA and not values.get("ollama_url"):
|
|
27
|
+
raise ValueError("ollama_url must be provided for 'ollama' provider.")
|
|
28
|
+
if provider == TextEmbeddingsProvider.OPENAI and not values.get(
|
|
29
|
+
"openai_api_key"
|
|
30
|
+
):
|
|
31
|
+
raise ValueError("openai_api_key must be provided for 'openai' provider.")
|
|
32
|
+
return values
|
uncertainty_engine_types/llm.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from enum import
|
|
1
|
+
from enum import StrEnum
|
|
2
2
|
from typing import Optional
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel
|
|
4
|
+
from pydantic import BaseModel, model_validator
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class LLMProvider(
|
|
7
|
+
class LLMProvider(StrEnum):
|
|
8
8
|
OPENAI = "openai"
|
|
9
9
|
OLLAMA = "ollama"
|
|
10
10
|
|
|
@@ -19,3 +19,13 @@ class LLMConfig(BaseModel):
|
|
|
19
19
|
temperature: float = 0.0
|
|
20
20
|
ollama_url: Optional[str] = None
|
|
21
21
|
openai_api_key: Optional[str] = None
|
|
22
|
+
|
|
23
|
+
@model_validator(mode="before")
|
|
24
|
+
@classmethod
|
|
25
|
+
def check_provider(cls, values):
|
|
26
|
+
provider = values.get("provider")
|
|
27
|
+
if provider == LLMProvider.OLLAMA and not values.get("ollama_url"):
|
|
28
|
+
raise ValueError("ollama_url must be provided for 'ollama' provider.")
|
|
29
|
+
if provider == LLMProvider.OPENAI and not values.get("openai_api_key"):
|
|
30
|
+
raise ValueError("openai_api_key must be provided for 'openai' provider.")
|
|
31
|
+
return values
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.9"
|
{uncertainty_engine_types-0.0.8.dist-info → uncertainty_engine_types-0.0.9.dist-info}/RECORD
RENAMED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
uncertainty_engine_types/__init__.py,sha256=
|
|
1
|
+
uncertainty_engine_types/__init__.py,sha256=G8H0XonAfxXoXlgeQK7FsxuMRgXosOZfm-jp6P5aHu0,1656
|
|
2
2
|
uncertainty_engine_types/context.py,sha256=k9rlArn-L2x1P5vWy5khfuqJW5tJOqr3NlhubZCbyG4,209
|
|
3
3
|
uncertainty_engine_types/conversation.py,sha256=uDHTr4uPzjkcflhyFAanfiQ1KbEIs4C9jogrwzOEt_s,122
|
|
4
|
+
uncertainty_engine_types/dataset.py,sha256=sDpQu5X3KxJ1lNkZOwhppJ2SY0Cv19cbcYfGpp_hyUQ,75
|
|
5
|
+
uncertainty_engine_types/embeddings.py,sha256=PmbaT7A7IuQ1UbGVNIg4usNnDbEgWiXM87gQPOeaff8,954
|
|
4
6
|
uncertainty_engine_types/execution_error.py,sha256=tvIBuZPM8UhFUERHCEqoW8blAYYuBq1ZqidO0i_BCGs,105
|
|
5
7
|
uncertainty_engine_types/file.py,sha256=J202bhOIVnvvvAG54sXyYF8fwjZGTUP3097ARnRnb3Q,579
|
|
6
8
|
uncertainty_engine_types/graph.py,sha256=ii2YT2jxoRB7UhcceI2k_ArKmlUXEwBCRBpsEUjL2Qg,265
|
|
7
9
|
uncertainty_engine_types/handle.py,sha256=buX_xEdBwT7vZRs5uCEPB6VCbSWIFbCE-NYIL4fZSjg,942
|
|
8
10
|
uncertainty_engine_types/job.py,sha256=eYDe-MW4s-kXGL1Ke1VxdwoduW66orJAa0L1XwGdYi0,347
|
|
9
|
-
uncertainty_engine_types/llm.py,sha256=
|
|
11
|
+
uncertainty_engine_types/llm.py,sha256=kuhTlkTIgE8oIYLofr7MOcz6S5qiN0w5FxfNcT05-E4,910
|
|
10
12
|
uncertainty_engine_types/message.py,sha256=KncFJQHL_ko8nfOuso_eh7i2gB0y4nXI6gBW9U8lAEY,971
|
|
11
13
|
uncertainty_engine_types/model.py,sha256=O9E_7DE9AKEc1o2VnhpUyl3Quh4sGdV43gqDJwk-y68,196
|
|
12
14
|
uncertainty_engine_types/node_info.py,sha256=2p87fCdX_CrdT2ZODtGJ-mR1Mvg46WhaE1GMddaEVak,800
|
|
@@ -15,7 +17,7 @@ uncertainty_engine_types/sql.py,sha256=SBzmgMEZ-sa-OBRoZbmKiOqddop4zJixgxx-JCus9
|
|
|
15
17
|
uncertainty_engine_types/token.py,sha256=4tQQkvl-zsYoVk8ZEx0cB2JiU0VDRJ6uUe76XBXEpBY,178
|
|
16
18
|
uncertainty_engine_types/utils.py,sha256=72QVig8Kb5uIR-e1nofm-3x9CouebdQJIruDbq-aIn0,271
|
|
17
19
|
uncertainty_engine_types/vector_store.py,sha256=9fYPJ04jWcy2DruyUSjiKQAgmqq-wgeAi5dBIrAOm30,392
|
|
18
|
-
uncertainty_engine_types/version.py,sha256=
|
|
19
|
-
uncertainty_engine_types-0.0.
|
|
20
|
-
uncertainty_engine_types-0.0.
|
|
21
|
-
uncertainty_engine_types-0.0.
|
|
20
|
+
uncertainty_engine_types/version.py,sha256=46Yjk3fz9o8aTN8E95McnzpJcjGzVJmHmQqUZ5mXzfc,22
|
|
21
|
+
uncertainty_engine_types-0.0.9.dist-info/METADATA,sha256=nAO5QC9gAFMHlvPhlPUR5jGij0OSIYic8VZ7R5eiITA,2815
|
|
22
|
+
uncertainty_engine_types-0.0.9.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
23
|
+
uncertainty_engine_types-0.0.9.dist-info/RECORD,,
|
|
File without changes
|