uncertainty-engine-types 0.0.9__py3-none-any.whl → 0.0.11__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 +8 -2
- uncertainty_engine_types/{conversation.py → chat_history.py} +1 -1
- uncertainty_engine_types/embeddings.py +6 -4
- uncertainty_engine_types/id.py +5 -0
- uncertainty_engine_types/job.py +2 -2
- uncertainty_engine_types/llm.py +4 -4
- uncertainty_engine_types/message.py +3 -23
- uncertainty_engine_types/model_config.py +11 -0
- uncertainty_engine_types/prompt.py +5 -0
- uncertainty_engine_types/version.py +1 -1
- {uncertainty_engine_types-0.0.9.dist-info → uncertainty_engine_types-0.0.11.dist-info}/METADATA +1 -1
- {uncertainty_engine_types-0.0.9.dist-info → uncertainty_engine_types-0.0.11.dist-info}/RECORD +13 -10
- {uncertainty_engine_types-0.0.9.dist-info → uncertainty_engine_types-0.0.11.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from . import utils
|
|
2
|
+
from .chat_history import ChatHistory
|
|
2
3
|
from .context import Context
|
|
3
|
-
from .conversation import Conversation
|
|
4
4
|
from .dataset import CSVDataset
|
|
5
5
|
from .embeddings import TextEmbeddingsConfig, TextEmbeddingsProvider
|
|
6
6
|
from .execution_error import ExecutionError
|
|
@@ -19,11 +19,14 @@ from .file import (
|
|
|
19
19
|
)
|
|
20
20
|
from .graph import Graph, NodeElement, NodeId, SourceHandle, TargetHandle
|
|
21
21
|
from .handle import Handle
|
|
22
|
+
from .id import ResourceID
|
|
22
23
|
from .job import JobInfo, JobStatus
|
|
23
24
|
from .llm import LLMConfig, LLMProvider
|
|
24
25
|
from .message import Message
|
|
25
26
|
from .model import MachineLearningModel
|
|
27
|
+
from .model_config import ModelConfig
|
|
26
28
|
from .node_info import NodeInfo, NodeInputInfo, NodeOutputInfo
|
|
29
|
+
from .prompt import Prompt
|
|
27
30
|
from .sensor_designer import SensorDesigner
|
|
28
31
|
from .sql import SQLConfig, SQLKind
|
|
29
32
|
from .token import Token
|
|
@@ -32,8 +35,8 @@ from .version import __version__
|
|
|
32
35
|
|
|
33
36
|
__all__ = [
|
|
34
37
|
"__version__",
|
|
38
|
+
"ChatHistory",
|
|
35
39
|
"Context",
|
|
36
|
-
"Conversation",
|
|
37
40
|
"CSVDataset",
|
|
38
41
|
"Document",
|
|
39
42
|
"ExecutionError",
|
|
@@ -50,12 +53,15 @@ __all__ = [
|
|
|
50
53
|
"MachineLearningModel",
|
|
51
54
|
"Mesh",
|
|
52
55
|
"Message",
|
|
56
|
+
"ModelConfig",
|
|
53
57
|
"NodeElement",
|
|
54
58
|
"NodeId",
|
|
55
59
|
"NodeInfo",
|
|
56
60
|
"NodeInputInfo",
|
|
57
61
|
"NodeOutputInfo",
|
|
58
62
|
"PDF",
|
|
63
|
+
"Prompt",
|
|
64
|
+
"ResourceID",
|
|
59
65
|
"S3Storage",
|
|
60
66
|
"SensorDesigner",
|
|
61
67
|
"SourceHandle",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from enum import
|
|
1
|
+
from enum import Enum
|
|
2
2
|
from typing import Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, model_validator
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class TextEmbeddingsProvider(
|
|
7
|
+
class TextEmbeddingsProvider(Enum):
|
|
8
8
|
OPENAI = "openai"
|
|
9
9
|
OLLAMA = "ollama"
|
|
10
10
|
|
|
@@ -23,9 +23,11 @@ class TextEmbeddingsConfig(BaseModel):
|
|
|
23
23
|
@classmethod
|
|
24
24
|
def check_provider(cls, values):
|
|
25
25
|
provider = values.get("provider")
|
|
26
|
-
if provider == TextEmbeddingsProvider.OLLAMA and not values.get(
|
|
26
|
+
if provider == TextEmbeddingsProvider.OLLAMA.value and not values.get(
|
|
27
|
+
"ollama_url"
|
|
28
|
+
):
|
|
27
29
|
raise ValueError("ollama_url must be provided for 'ollama' provider.")
|
|
28
|
-
if provider == TextEmbeddingsProvider.OPENAI and not values.get(
|
|
30
|
+
if provider == TextEmbeddingsProvider.OPENAI.value and not values.get(
|
|
29
31
|
"openai_api_key"
|
|
30
32
|
):
|
|
31
33
|
raise ValueError("openai_api_key must be provided for 'openai' provider.")
|
uncertainty_engine_types/job.py
CHANGED
uncertainty_engine_types/llm.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from enum import
|
|
1
|
+
from enum import Enum
|
|
2
2
|
from typing import Optional
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, model_validator
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class LLMProvider(
|
|
7
|
+
class LLMProvider(Enum):
|
|
8
8
|
OPENAI = "openai"
|
|
9
9
|
OLLAMA = "ollama"
|
|
10
10
|
|
|
@@ -24,8 +24,8 @@ class LLMConfig(BaseModel):
|
|
|
24
24
|
@classmethod
|
|
25
25
|
def check_provider(cls, values):
|
|
26
26
|
provider = values.get("provider")
|
|
27
|
-
if provider == LLMProvider.OLLAMA and not values.get("ollama_url"):
|
|
27
|
+
if provider == LLMProvider.OLLAMA.value and not values.get("ollama_url"):
|
|
28
28
|
raise ValueError("ollama_url must be provided for 'ollama' provider.")
|
|
29
|
-
if provider == LLMProvider.OPENAI and not values.get("openai_api_key"):
|
|
29
|
+
if provider == LLMProvider.OPENAI.value and not values.get("openai_api_key"):
|
|
30
30
|
raise ValueError("openai_api_key must be provided for 'openai' provider.")
|
|
31
31
|
return values
|
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Literal
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Value = Union[str, float, int]
|
|
8
|
-
StructuredOutput = Dict[str, Union[Value, Sequence[Value], Dict[str, Value]]]
|
|
4
|
+
from pydantic import BaseModel
|
|
9
5
|
|
|
10
6
|
|
|
11
7
|
class Message(BaseModel):
|
|
12
8
|
role: Literal["instruction", "user", "engine"]
|
|
13
|
-
content:
|
|
9
|
+
content: str
|
|
14
10
|
timestamp: datetime
|
|
15
|
-
|
|
16
|
-
@model_validator(mode="before")
|
|
17
|
-
@classmethod
|
|
18
|
-
def validate(cls, values: Dict) -> Dict:
|
|
19
|
-
role = values.get("role")
|
|
20
|
-
content = values.get("content")
|
|
21
|
-
|
|
22
|
-
if role in ["instruction", "user"]:
|
|
23
|
-
if not isinstance(content, str):
|
|
24
|
-
raise ValueError(f"Content must be a string when role is {role}")
|
|
25
|
-
elif role == "engine":
|
|
26
|
-
if not isinstance(content, StructuredOutput):
|
|
27
|
-
raise ValueError(
|
|
28
|
-
"Content must be a structured output when role is engine"
|
|
29
|
-
)
|
|
30
|
-
return values
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Literal, Optional
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ModelConfig(BaseModel):
|
|
7
|
+
train_test_ratio: float = 1.0
|
|
8
|
+
input_variance: Optional[float] = None
|
|
9
|
+
output_variance: Optional[float] = None
|
|
10
|
+
model_type: Literal["SingleTaskGPTorch"] = "SingleTaskGPTorch"
|
|
11
|
+
seed: Optional[int] = None
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.11"
|
{uncertainty_engine_types-0.0.9.dist-info → uncertainty_engine_types-0.0.11.dist-info}/RECORD
RENAMED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
uncertainty_engine_types/__init__.py,sha256=
|
|
1
|
+
uncertainty_engine_types/__init__.py,sha256=_C9BE7MJkVmE1Ky2AVhSrcAro-QPf7dsNsbQTUcxZJc,1797
|
|
2
|
+
uncertainty_engine_types/chat_history.py,sha256=OY1fZXP7_AtPKEmgjxh60PlbEGtQWJWafZMgs2Ec0BU,121
|
|
2
3
|
uncertainty_engine_types/context.py,sha256=k9rlArn-L2x1P5vWy5khfuqJW5tJOqr3NlhubZCbyG4,209
|
|
3
|
-
uncertainty_engine_types/conversation.py,sha256=uDHTr4uPzjkcflhyFAanfiQ1KbEIs4C9jogrwzOEt_s,122
|
|
4
4
|
uncertainty_engine_types/dataset.py,sha256=sDpQu5X3KxJ1lNkZOwhppJ2SY0Cv19cbcYfGpp_hyUQ,75
|
|
5
|
-
uncertainty_engine_types/embeddings.py,sha256=
|
|
5
|
+
uncertainty_engine_types/embeddings.py,sha256=sNDWjpuqmzOefKyQX--9EpdeTEyI4kQeSH4IELVUT7g,982
|
|
6
6
|
uncertainty_engine_types/execution_error.py,sha256=tvIBuZPM8UhFUERHCEqoW8blAYYuBq1ZqidO0i_BCGs,105
|
|
7
7
|
uncertainty_engine_types/file.py,sha256=J202bhOIVnvvvAG54sXyYF8fwjZGTUP3097ARnRnb3Q,579
|
|
8
8
|
uncertainty_engine_types/graph.py,sha256=ii2YT2jxoRB7UhcceI2k_ArKmlUXEwBCRBpsEUjL2Qg,265
|
|
9
9
|
uncertainty_engine_types/handle.py,sha256=buX_xEdBwT7vZRs5uCEPB6VCbSWIFbCE-NYIL4fZSjg,942
|
|
10
|
-
uncertainty_engine_types/
|
|
11
|
-
uncertainty_engine_types/
|
|
12
|
-
uncertainty_engine_types/
|
|
10
|
+
uncertainty_engine_types/id.py,sha256=Wpco2lLEsx6sdfdRJcPGl8GQlVa13dflWApaRt6dTYI,74
|
|
11
|
+
uncertainty_engine_types/job.py,sha256=C3dS2NWL3-Nw2jb5x5VqGNMPWuYcKhIc219K4cNpBMw,341
|
|
12
|
+
uncertainty_engine_types/llm.py,sha256=Ae7dw1R5RKLJHFjNwBzynLd-ddikKP0NsvHvoMdmnLM,916
|
|
13
|
+
uncertainty_engine_types/message.py,sha256=5IY-S6Ipt6oYmnVSkRVv3QLSH-lKQvpxp_qF5YGSbok,209
|
|
13
14
|
uncertainty_engine_types/model.py,sha256=O9E_7DE9AKEc1o2VnhpUyl3Quh4sGdV43gqDJwk-y68,196
|
|
15
|
+
uncertainty_engine_types/model_config.py,sha256=Ghii7gk3zRhydGQJJJlzYRmMFW2cHBfwGj9FPNHEhCQ,320
|
|
14
16
|
uncertainty_engine_types/node_info.py,sha256=2p87fCdX_CrdT2ZODtGJ-mR1Mvg46WhaE1GMddaEVak,800
|
|
17
|
+
uncertainty_engine_types/prompt.py,sha256=l__qXytAapKg1Hoaj3RSVYN3rhy638nuUZIS-se0eMc,74
|
|
15
18
|
uncertainty_engine_types/sensor_designer.py,sha256=hr3ek4_dRjRK0-78uaT6h8-bGUCm7Mfs6mxJSWxE64c,80
|
|
16
19
|
uncertainty_engine_types/sql.py,sha256=SBzmgMEZ-sa-OBRoZbmKiOqddop4zJixgxx-JCus9fY,298
|
|
17
20
|
uncertainty_engine_types/token.py,sha256=4tQQkvl-zsYoVk8ZEx0cB2JiU0VDRJ6uUe76XBXEpBY,178
|
|
18
21
|
uncertainty_engine_types/utils.py,sha256=72QVig8Kb5uIR-e1nofm-3x9CouebdQJIruDbq-aIn0,271
|
|
19
22
|
uncertainty_engine_types/vector_store.py,sha256=9fYPJ04jWcy2DruyUSjiKQAgmqq-wgeAi5dBIrAOm30,392
|
|
20
|
-
uncertainty_engine_types/version.py,sha256=
|
|
21
|
-
uncertainty_engine_types-0.0.
|
|
22
|
-
uncertainty_engine_types-0.0.
|
|
23
|
-
uncertainty_engine_types-0.0.
|
|
23
|
+
uncertainty_engine_types/version.py,sha256=OaIl7v-6zEWEY90Jlh6yoBjO3zWX1oX7RsvqrK3o1TU,23
|
|
24
|
+
uncertainty_engine_types-0.0.11.dist-info/METADATA,sha256=6VC6b9iAOQDiRv0NO9FP2RGl59TbWMnSiY5zob1TDic,2816
|
|
25
|
+
uncertainty_engine_types-0.0.11.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
26
|
+
uncertainty_engine_types-0.0.11.dist-info/RECORD,,
|
{uncertainty_engine_types-0.0.9.dist-info → uncertainty_engine_types-0.0.11.dist-info}/WHEEL
RENAMED
|
File without changes
|