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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.55"
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
- cost: Optional[float] = None
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
- cost: Optional[float] = None
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()