edsl 0.1.55__py3-none-any.whl → 0.1.56__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.
- edsl/__version__.py +1 -1
- edsl/base/data_transfer_models.py +15 -4
- edsl/dataset/dataset_operations_mixin.py +216 -180
- edsl/inference_services/services/google_service.py +5 -2
- edsl/interviews/request_token_estimator.py +8 -0
- edsl/invigilators/invigilators.py +26 -13
- edsl/jobs/jobs_pricing_estimation.py +154 -113
- edsl/language_models/language_model.py +24 -6
- edsl/language_models/price_manager.py +171 -36
- edsl/results/result.py +52 -30
- edsl/scenarios/file_store.py +60 -30
- {edsl-0.1.55.dist-info → edsl-0.1.56.dist-info}/METADATA +1 -1
- {edsl-0.1.55.dist-info → edsl-0.1.56.dist-info}/RECORD +16 -16
- {edsl-0.1.55.dist-info → edsl-0.1.56.dist-info}/LICENSE +0 -0
- {edsl-0.1.55.dist-info → edsl-0.1.56.dist-info}/WHEEL +0 -0
- {edsl-0.1.55.dist-info → edsl-0.1.56.dist-info}/entry_points.txt +0 -0
edsl/__version__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.1.
|
1
|
+
__version__ = "0.1.56"
|
@@ -1,10 +1,11 @@
|
|
1
1
|
from collections import UserDict
|
2
|
-
from typing import NamedTuple, Dict, Optional, Any
|
2
|
+
from typing import NamedTuple, Dict, Optional, Any, Union
|
3
3
|
from dataclasses import dataclass, fields
|
4
4
|
|
5
5
|
|
6
6
|
class ModelInputs(NamedTuple):
|
7
7
|
"This is what was send by the agent to the model"
|
8
|
+
|
8
9
|
user_prompt: str
|
9
10
|
system_prompt: str
|
10
11
|
encoded_image: Optional[str] = None
|
@@ -12,6 +13,7 @@ class ModelInputs(NamedTuple):
|
|
12
13
|
|
13
14
|
class EDSLOutput(NamedTuple):
|
14
15
|
"This is the edsl dictionary that is returned by the model"
|
16
|
+
|
15
17
|
answer: Any
|
16
18
|
generated_tokens: str
|
17
19
|
comment: Optional[str] = None
|
@@ -19,11 +21,16 @@ class EDSLOutput(NamedTuple):
|
|
19
21
|
|
20
22
|
class ModelResponse(NamedTuple):
|
21
23
|
"This is the metadata that is returned by the model and includes info about the cache"
|
24
|
+
|
22
25
|
response: dict
|
23
26
|
cache_used: bool
|
24
27
|
cache_key: str
|
25
28
|
cached_response: Optional[Dict[str, Any]] = None
|
26
|
-
|
29
|
+
input_tokens: Optional[int] = None
|
30
|
+
output_tokens: Optional[int] = None
|
31
|
+
input_price_per_million_tokens: Optional[float] = None
|
32
|
+
output_price_per_million_tokens: Optional[float] = None
|
33
|
+
total_cost: Optional[Union[float, str]] = None
|
27
34
|
|
28
35
|
|
29
36
|
class AgentResponseDict(NamedTuple):
|
@@ -44,7 +51,11 @@ class EDSLResultObjectInput(NamedTuple):
|
|
44
51
|
comment: str
|
45
52
|
validated: bool = False
|
46
53
|
exception_occurred: Exception = None
|
47
|
-
|
54
|
+
input_tokens: Optional[int] = None
|
55
|
+
output_tokens: Optional[int] = None
|
56
|
+
input_price_per_million_tokens: Optional[float] = None
|
57
|
+
output_price_per_million_tokens: Optional[float] = None
|
58
|
+
total_cost: Optional[Union[float, str]] = None
|
48
59
|
|
49
60
|
|
50
61
|
@dataclass
|
@@ -111,4 +122,4 @@ class Answers(UserDict):
|
|
111
122
|
if __name__ == "__main__":
|
112
123
|
import doctest
|
113
124
|
|
114
|
-
doctest.testmod()
|
125
|
+
doctest.testmod()
|