langfun 0.1.1.dev20240826__py3-none-any.whl → 0.1.1.dev20240827__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.
- langfun/core/eval/base.py +1 -1
- langfun/core/eval/base_test.py +1 -1
- langfun/core/langfunc.py +3 -0
- langfun/core/langfunc_test.py +6 -3
- langfun/core/language_model.py +10 -0
- langfun/core/llms/cache/base.py +21 -2
- langfun/core/llms/cache/in_memory.py +7 -0
- langfun/core/llms/cache/in_memory_test.py +45 -0
- langfun/core/message.py +10 -0
- langfun/core/message_test.py +14 -0
- langfun/core/modality.py +12 -0
- langfun/core/modality_test.py +1 -0
- langfun/core/structured/mapping.py +6 -0
- langfun/core/structured/prompting_test.py +12 -8
- {langfun-0.1.1.dev20240826.dist-info → langfun-0.1.1.dev20240827.dist-info}/METADATA +1 -1
- {langfun-0.1.1.dev20240826.dist-info → langfun-0.1.1.dev20240827.dist-info}/RECORD +19 -19
- {langfun-0.1.1.dev20240826.dist-info → langfun-0.1.1.dev20240827.dist-info}/LICENSE +0 -0
- {langfun-0.1.1.dev20240826.dist-info → langfun-0.1.1.dev20240827.dist-info}/WHEEL +0 -0
- {langfun-0.1.1.dev20240826.dist-info → langfun-0.1.1.dev20240827.dist-info}/top_level.txt +0 -0
langfun/core/eval/base.py
CHANGED
@@ -1261,7 +1261,7 @@ class Evaluation(Evaluable):
|
|
1261
1261
|
|
1262
1262
|
def finalize(self) -> pg.Dict:
|
1263
1263
|
"""Finalizes the evaluation result."""
|
1264
|
-
if self.cache:
|
1264
|
+
if self.cache is not None:
|
1265
1265
|
cache_stats = dict(
|
1266
1266
|
use_cache=True,
|
1267
1267
|
num_queries=self.cache.stats.num_queries,
|
langfun/core/eval/base_test.py
CHANGED
@@ -564,7 +564,7 @@ class SuiteTest(unittest.TestCase):
|
|
564
564
|
schema_fn='answer_schema()',
|
565
565
|
),
|
566
566
|
cache_stats=dict(
|
567
|
-
use_cache=True, num_queries=4, num_hits=
|
567
|
+
use_cache=True, num_queries=4, num_hits=0, num_updates=4
|
568
568
|
),
|
569
569
|
metrics=dict(
|
570
570
|
total=2,
|
langfun/core/langfunc.py
CHANGED
@@ -269,6 +269,9 @@ class LangFunc(
|
|
269
269
|
# Send rendered text to LM.
|
270
270
|
lm_output = self.lm(lm_input, cache_seed=cache_seed)
|
271
271
|
|
272
|
+
# Attach cache seed.
|
273
|
+
lm_input.metadata.cache_seed = cache_seed
|
274
|
+
|
272
275
|
# Transform the output message.
|
273
276
|
lm_output = self.transform_output(lm_output)
|
274
277
|
lm_output.tag(message_lib.Message.TAG_LM_OUTPUT)
|
langfun/core/langfunc_test.py
CHANGED
@@ -94,11 +94,13 @@ class LangFuncCallTest(unittest.TestCase):
|
|
94
94
|
)
|
95
95
|
)
|
96
96
|
self.assertEqual(r.tags, ['lm-response', 'lm-output'])
|
97
|
-
self.assertEqual(
|
97
|
+
self.assertEqual(
|
98
|
+
r.source,
|
99
|
+
message.UserMessage('Hello', metadata=dict(cache_seed=0))
|
100
|
+
)
|
98
101
|
self.assertEqual(r.source.tags, ['rendered', 'lm-input'])
|
99
102
|
|
100
103
|
self.assertEqual(str(l), 'Hello')
|
101
|
-
print(repr(l))
|
102
104
|
self.assertEqual(
|
103
105
|
repr(l),
|
104
106
|
"LangFunc(template_str='Hello', clean=True,"
|
@@ -114,7 +116,7 @@ class LangFuncCallTest(unittest.TestCase):
|
|
114
116
|
self.assertEqual(l, 'Hello')
|
115
117
|
self.assertEqual(l.natural_language_format(), 'Hello')
|
116
118
|
self.assertEqual(l.render(), 'Hello')
|
117
|
-
r = l()
|
119
|
+
r = l(cache_seed=1)
|
118
120
|
self.assertEqual(
|
119
121
|
r,
|
120
122
|
message.AIMessage(
|
@@ -123,6 +125,7 @@ class LangFuncCallTest(unittest.TestCase):
|
|
123
125
|
)
|
124
126
|
)
|
125
127
|
self.assertEqual(r.tags, ['lm-response', 'lm-output'])
|
128
|
+
self.assertEqual(r.source.metadata.cache_seed, 1)
|
126
129
|
|
127
130
|
self.assertEqual(str(l), 'Hello')
|
128
131
|
|
langfun/core/language_model.py
CHANGED
@@ -234,6 +234,7 @@ class LMCache(pg.Object):
|
|
234
234
|
num_hit_expires: int = 0
|
235
235
|
num_misses: int = 0
|
236
236
|
num_updates: int = 0
|
237
|
+
num_deletes: int = 0
|
237
238
|
|
238
239
|
@abc.abstractmethod
|
239
240
|
def get(
|
@@ -251,6 +252,15 @@ class LMCache(pg.Object):
|
|
251
252
|
) -> None:
|
252
253
|
"""Puts the result of a prompt generated by a language model in cache."""
|
253
254
|
|
255
|
+
@abc.abstractmethod
|
256
|
+
def delete(
|
257
|
+
self,
|
258
|
+
lm: 'LanguageModel',
|
259
|
+
prompt: message_lib.Message,
|
260
|
+
seed: int,
|
261
|
+
) -> bool:
|
262
|
+
"""Deletes the result of a prompt generated by a language model in cache."""
|
263
|
+
|
254
264
|
@property
|
255
265
|
@abc.abstractmethod
|
256
266
|
def stats(self) -> Stats:
|
langfun/core/llms/cache/base.py
CHANGED
@@ -60,13 +60,16 @@ class LMCacheBase(lf.LMCache):
|
|
60
60
|
self, lm: lf.LanguageModel, prompt: lf.Message, seed: int
|
61
61
|
) -> lf.LMSamplingResult | None:
|
62
62
|
"""Gets the cached result of a prompt generated by a language model."""
|
63
|
-
|
63
|
+
key = self._key(lm, prompt, seed)
|
64
|
+
entry = self._get(lm.model_id, key)
|
64
65
|
self._stats.num_queries += 1
|
65
66
|
if entry is None:
|
66
67
|
self._stats.num_misses += 1
|
67
68
|
return None
|
68
69
|
if entry.expire is not None and entry.expire < datetime.datetime.now():
|
69
70
|
self._stats.num_hit_expires += 1
|
71
|
+
self._stats.num_deletes += 1
|
72
|
+
assert self._delete(lm.model_id, key)
|
70
73
|
return None
|
71
74
|
self._stats.num_hits += 1
|
72
75
|
return entry.result
|
@@ -86,6 +89,18 @@ class LMCacheBase(lf.LMCache):
|
|
86
89
|
self._put(lm.model_id, self._key(lm, prompt, seed), entry)
|
87
90
|
self._stats.num_updates += 1
|
88
91
|
|
92
|
+
def delete(
|
93
|
+
self,
|
94
|
+
lm: lf.LanguageModel,
|
95
|
+
prompt: lf.Message,
|
96
|
+
seed: int,
|
97
|
+
) -> bool:
|
98
|
+
"""Deletes the result of a prompt generated by a language model in cache."""
|
99
|
+
deleted = self._delete(lm.model_id, self._key(lm, prompt, seed))
|
100
|
+
if deleted:
|
101
|
+
self._stats.num_deletes += 1
|
102
|
+
return deleted
|
103
|
+
|
89
104
|
@abc.abstractmethod
|
90
105
|
def _get(self, model_id: str, key: str) -> LMCacheEntry | None:
|
91
106
|
"""Returns a LM cache entry associated with the key."""
|
@@ -94,6 +109,10 @@ class LMCacheBase(lf.LMCache):
|
|
94
109
|
def _put(self, model_id: str, key: str, entry: LMCacheEntry) -> None:
|
95
110
|
"""Puts a LM cache entry associated with the key."""
|
96
111
|
|
112
|
+
@abc.abstractmethod
|
113
|
+
def _delete(self, model_id: str, key: str) -> bool:
|
114
|
+
"""Deletes a LM cache entry associated with the key."""
|
115
|
+
|
97
116
|
def _sym_clone(self, deep: bool, memo: Any = None) -> 'LMCacheBase':
|
98
117
|
v = super()._sym_clone(deep, memo)
|
99
118
|
v._stats = self._stats # pylint: disable=protected-access
|
@@ -102,4 +121,4 @@ class LMCacheBase(lf.LMCache):
|
|
102
121
|
|
103
122
|
def default_key(lm: lf.LanguageModel, prompt: lf.Message, seed: int) -> Any:
|
104
123
|
"""Default key for LM cache."""
|
105
|
-
return (prompt.
|
124
|
+
return (prompt.text_with_modality_hash, lm.sampling_options.cache_key(), seed)
|
@@ -99,6 +99,13 @@ class InMemory(base.LMCacheBase):
|
|
99
99
|
"""Puts a LM cache entry associated with the key."""
|
100
100
|
self._cache[model_id][key] = entry
|
101
101
|
|
102
|
+
def _delete(self, model_id: str, key: str) -> bool:
|
103
|
+
"""Deletes a LM cache entry associated with the key."""
|
104
|
+
model_cache = self._cache.get(model_id, None)
|
105
|
+
if model_cache is None:
|
106
|
+
return False
|
107
|
+
return model_cache.pop(key, None) is not None
|
108
|
+
|
102
109
|
def reset(self, model_id: str | None = None) -> None:
|
103
110
|
"""Resets the cache."""
|
104
111
|
if model_id is not None:
|
@@ -148,6 +148,50 @@ class InMemoryLMCacheTest(unittest.TestCase):
|
|
148
148
|
self.assertIs(copy.deepcopy(cache)._cache, cache._cache)
|
149
149
|
self.assertIs(copy.deepcopy(cache)._stats, cache._stats)
|
150
150
|
|
151
|
+
self.assertFalse(
|
152
|
+
cache.delete(fake.StaticResponse('hi'), lf.UserMessage('c'), seed=0)
|
153
|
+
)
|
154
|
+
self.assertFalse(cache.delete(lm, lf.UserMessage('c'), seed=1))
|
155
|
+
self.assertFalse(cache.delete(lm, lf.UserMessage('d'), seed=0))
|
156
|
+
self.assertTrue(cache.delete(lm, lf.UserMessage('c'), seed=0))
|
157
|
+
self.assertEqual(
|
158
|
+
list(cache.keys('StaticSequence')),
|
159
|
+
[
|
160
|
+
('a', (None, None, 1, 40, None, None), 0),
|
161
|
+
('a', (None, None, 1, 40, None, None), 1),
|
162
|
+
('b', (None, None, 1, 40, None, None), 0),
|
163
|
+
],
|
164
|
+
)
|
165
|
+
self.assertEqual(cache.stats.num_deletes, 1)
|
166
|
+
|
167
|
+
def test_cache_with_modalities(self):
|
168
|
+
|
169
|
+
class CustomModality(lf.Modality):
|
170
|
+
content: str
|
171
|
+
|
172
|
+
def to_bytes(self):
|
173
|
+
return self.content.encode()
|
174
|
+
|
175
|
+
cache = in_memory.InMemory()
|
176
|
+
lm = fake.StaticSequence(['1', '2', '3', '4', '5', '6'], cache=cache)
|
177
|
+
lm(lf.UserMessage('hi <<[[image]]>>', image=CustomModality('foo')))
|
178
|
+
lm(lf.UserMessage('hi <<[[image]]>>', image=CustomModality('bar')))
|
179
|
+
self.assertEqual(
|
180
|
+
list(cache.keys()),
|
181
|
+
[
|
182
|
+
(
|
183
|
+
'hi <<[[image]]>><image>acbd18db</image>',
|
184
|
+
(None, None, 1, 40, None, None),
|
185
|
+
0,
|
186
|
+
),
|
187
|
+
(
|
188
|
+
'hi <<[[image]]>><image>37b51d19</image>',
|
189
|
+
(None, None, 1, 40, None, None),
|
190
|
+
0,
|
191
|
+
),
|
192
|
+
],
|
193
|
+
)
|
194
|
+
|
151
195
|
def test_ttl(self):
|
152
196
|
cache = in_memory.InMemory(ttl=1)
|
153
197
|
lm = fake.StaticSequence(['1', '2', '3'], cache=cache)
|
@@ -160,6 +204,7 @@ class InMemoryLMCacheTest(unittest.TestCase):
|
|
160
204
|
self.assertEqual(cache.stats.num_hits, 1)
|
161
205
|
self.assertEqual(cache.stats.num_hit_expires, 1)
|
162
206
|
self.assertEqual(cache.stats.num_misses, 1)
|
207
|
+
self.assertEqual(cache.stats.num_deletes, 1)
|
163
208
|
|
164
209
|
def test_different_sampling_options(self):
|
165
210
|
cache = in_memory.InMemory()
|
langfun/core/message.py
CHANGED
@@ -278,6 +278,16 @@ class Message(natural_language.NaturalLanguageFormattable, pg.Object):
|
|
278
278
|
# API for supporting modalities.
|
279
279
|
#
|
280
280
|
|
281
|
+
@property
|
282
|
+
def text_with_modality_hash(self) -> str:
|
283
|
+
"""Returns text with modality object placeheld by their 8-byte MD5 hash."""
|
284
|
+
parts = [self.text]
|
285
|
+
for name, modality_obj in self.referred_modalities().items():
|
286
|
+
parts.append(
|
287
|
+
f'<{name}>{modality_obj.hash}</{name}>'
|
288
|
+
)
|
289
|
+
return ''.join(parts)
|
290
|
+
|
281
291
|
def get_modality(
|
282
292
|
self, var_name: str, default: Any = None, from_message_chain: bool = True
|
283
293
|
) -> modality.Modality | None:
|
langfun/core/message_test.py
CHANGED
@@ -282,6 +282,20 @@ class MessageTest(unittest.TestCase):
|
|
282
282
|
},
|
283
283
|
)
|
284
284
|
|
285
|
+
def test_text_with_modality_hash(self):
|
286
|
+
m = message.UserMessage(
|
287
|
+
'hi, this is a <<[[img1]]>> and <<[[x.img2]]>>',
|
288
|
+
img1=CustomModality('foo'),
|
289
|
+
x=dict(img2=CustomModality('bar')),
|
290
|
+
)
|
291
|
+
self.assertEqual(
|
292
|
+
m.text_with_modality_hash,
|
293
|
+
(
|
294
|
+
'hi, this is a <<[[img1]]>> and <<[[x.img2]]>>'
|
295
|
+
'<img1>acbd18db</img1><x.img2>37b51d19</x.img2>'
|
296
|
+
)
|
297
|
+
)
|
298
|
+
|
285
299
|
def test_chunking(self):
|
286
300
|
m = message.UserMessage(
|
287
301
|
inspect.cleandoc("""
|
langfun/core/modality.py
CHANGED
@@ -14,6 +14,8 @@
|
|
14
14
|
"""Interface for modality (e.g. Image, Video, etc.)."""
|
15
15
|
|
16
16
|
import abc
|
17
|
+
import functools
|
18
|
+
import hashlib
|
17
19
|
from typing import Any, ContextManager
|
18
20
|
from langfun.core import component
|
19
21
|
import pyglove as pg
|
@@ -35,6 +37,11 @@ class Modality(component.Component):
|
|
35
37
|
REF_START = '<<[['
|
36
38
|
REF_END = ']]>>'
|
37
39
|
|
40
|
+
def _on_bound(self):
|
41
|
+
super()._on_bound()
|
42
|
+
# Invalidate cached hash if modality member is changed.
|
43
|
+
self.__dict__.pop('hash', None)
|
44
|
+
|
38
45
|
def format(self, *args, **kwargs) -> str:
|
39
46
|
if self.referred_name is None or not pg.object_utils.thread_local_get(
|
40
47
|
_TLS_MODALITY_AS_REF, False
|
@@ -46,6 +53,11 @@ class Modality(component.Component):
|
|
46
53
|
def to_bytes(self) -> bytes:
|
47
54
|
"""Returns content in bytes."""
|
48
55
|
|
56
|
+
@functools.cached_property
|
57
|
+
def hash(self) -> str:
|
58
|
+
"""Returns a 8-byte MD5 hash as the identifier for this modality object."""
|
59
|
+
return hashlib.md5(self.to_bytes()).hexdigest()[:8]
|
60
|
+
|
49
61
|
@classmethod
|
50
62
|
def text_marker(cls, var_name: str) -> str:
|
51
63
|
"""Returns a marker in the text for this object."""
|
langfun/core/modality_test.py
CHANGED
@@ -32,6 +32,7 @@ class ModalityTest(unittest.TestCase):
|
|
32
32
|
v = CustomModality('a')
|
33
33
|
self.assertIsNone(v.referred_name)
|
34
34
|
self.assertEqual(str(v), "CustomModality(\n content = 'a'\n)")
|
35
|
+
self.assertEqual(v.hash, '0cc175b9')
|
35
36
|
|
36
37
|
_ = pg.Dict(metadata=pg.Dict(x=pg.Dict(metadata=pg.Dict(y=v))))
|
37
38
|
self.assertEqual(v.referred_name, 'x.metadata.y')
|
@@ -352,6 +352,12 @@ class Mapping(lf.LangFunc):
|
|
352
352
|
lm_output = self.postprocess_response(lm_output)
|
353
353
|
lm_output.result = self.postprocess_result(self.parse_result(lm_output))
|
354
354
|
except Exception as e: # pylint: disable=broad-exception-caught
|
355
|
+
if (self.lm.cache is not None
|
356
|
+
and lm_output.lm_input.cache_seed is not None):
|
357
|
+
success = self.lm.cache.delete(
|
358
|
+
self.lm, lm_output.lm_input, lm_output.lm_input.cache_seed
|
359
|
+
)
|
360
|
+
assert success
|
355
361
|
if self.default == lf.RAISE_IF_HAS_ERROR:
|
356
362
|
raise MappingError(lm_output, e) from e
|
357
363
|
lm_output.result = self.default
|
@@ -19,6 +19,7 @@ import unittest
|
|
19
19
|
import langfun.core as lf
|
20
20
|
from langfun.core import modalities
|
21
21
|
from langfun.core.llms import fake
|
22
|
+
from langfun.core.llms.cache import in_memory
|
22
23
|
from langfun.core.structured import mapping
|
23
24
|
from langfun.core.structured import prompting
|
24
25
|
import pyglove as pg
|
@@ -799,15 +800,18 @@ class QueryStructureJsonTest(unittest.TestCase):
|
|
799
800
|
self.assertIsNone(r.result[0].hotel)
|
800
801
|
|
801
802
|
def test_bad_transform(self):
|
802
|
-
with
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
with self.assertRaisesRegex(
|
807
|
-
mapping.MappingError,
|
808
|
-
'No JSON dict in the output',
|
803
|
+
with in_memory.lm_cache() as cache:
|
804
|
+
with lf.context(
|
805
|
+
lm=fake.StaticSequence(['3']),
|
806
|
+
override_attrs=True,
|
809
807
|
):
|
810
|
-
|
808
|
+
with self.assertRaisesRegex(
|
809
|
+
mapping.MappingError,
|
810
|
+
'No JSON dict in the output',
|
811
|
+
):
|
812
|
+
prompting.query('Compute 1 + 2', int, protocol='json', cache_seed=1)
|
813
|
+
# Make sure bad mapping does not impact cache.
|
814
|
+
self.assertEqual(len(cache), 0)
|
811
815
|
|
812
816
|
def test_query(self):
|
813
817
|
lm = fake.StaticSequence(['{"result": 1}'])
|
@@ -6,17 +6,17 @@ langfun/core/concurrent.py,sha256=TRc49pJ3HQro2kb5FtcWkHjhBm8UcgE8RJybU5cU3-0,24
|
|
6
6
|
langfun/core/concurrent_test.py,sha256=9HWnS4ja5Ji1ALfJs2zIt7w4w0oNm9dOZM7bgzoX5ag,15176
|
7
7
|
langfun/core/console.py,sha256=bk5rNPNm9rMGW5YT2HixxU04p2umnoabn5SDz6Dqe88,2317
|
8
8
|
langfun/core/console_test.py,sha256=5SYJdxpJGLgdSSQqqMPoA1X6jpsLD8rgcyk-EgI65oE,1077
|
9
|
-
langfun/core/langfunc.py,sha256=
|
10
|
-
langfun/core/langfunc_test.py,sha256=
|
11
|
-
langfun/core/language_model.py,sha256=
|
9
|
+
langfun/core/langfunc.py,sha256=G50YgoVZ0y1GFw2ev41MlOqr6qa8YakbvNC0h_E0PiA,11140
|
10
|
+
langfun/core/langfunc_test.py,sha256=ZLlj6ysNIWUlm0jcq6PbNUwdJ2XstW5QQT0L2s5GlGY,8753
|
11
|
+
langfun/core/language_model.py,sha256=o1MPDdiZ7eRUhcCjxLMT6IYYXge6nM7elvCWQ-NANaU,26286
|
12
12
|
langfun/core/language_model_test.py,sha256=ebJ1vnaxKSKvlwi6v07yHjn91xMiDw2bQ9DBnyVorYw,23303
|
13
13
|
langfun/core/logging.py,sha256=oDSeqGIQogZJ6xuPTcr9mkmLC2YnLP67UHtTdWbbiVY,4250
|
14
14
|
langfun/core/logging_test.py,sha256=poSsNGKi6G9LWOcWnTY0BQjj0BtaQknH-NK6FcQrVT4,2152
|
15
15
|
langfun/core/memory.py,sha256=f-asN1F7Vehgdn_fK84v73GrEUOxRtaW934keutTKjk,2416
|
16
|
-
langfun/core/message.py,sha256=
|
17
|
-
langfun/core/message_test.py,sha256=
|
18
|
-
langfun/core/modality.py,sha256=
|
19
|
-
langfun/core/modality_test.py,sha256=
|
16
|
+
langfun/core/message.py,sha256=7UOxNMA1Le0ZGkleryqwXcWojZ-l_hku5Sc58BsIOGw,18586
|
17
|
+
langfun/core/message_test.py,sha256=2o4WvE-WL67OsVY-O5g__67OIJ73vvg6MuojSc2uVRs,12504
|
18
|
+
langfun/core/modality.py,sha256=g9wGx347oVofAJlMu_CpzTMIyTT9DJW8NfO4E-d-oNM,3879
|
19
|
+
langfun/core/modality_test.py,sha256=7SwhixFME2Q1sIXRgJx97EZFiIyC31A9NVr6_nDtFv4,2441
|
20
20
|
langfun/core/natural_language.py,sha256=3ynSnaYQnjE60LIPK5fyMgdIjubnPYZwzGq4rWPeloE,1177
|
21
21
|
langfun/core/natural_language_test.py,sha256=LHGU_1ytbkGuSZQFIFP7vP3dBlcY4-A12fT6dbjUA0E,1424
|
22
22
|
langfun/core/repr_utils.py,sha256=Y6ccoQUMpRxDv_jUy2QtnP9cdz3QBjJtTIgxGIU-kfM,5537
|
@@ -44,8 +44,8 @@ langfun/core/coding/python/parsing_test.py,sha256=9vAWF484kWIm6JZq8NFiMgKUDhXV-d
|
|
44
44
|
langfun/core/coding/python/permissions.py,sha256=1QWGHvzL8MM0Ok_auQ9tURqZHtdOfJaDpBzZ29GUE-c,2544
|
45
45
|
langfun/core/coding/python/permissions_test.py,sha256=w5EDb8QxpxgJyZkojyzVWQvDfg366zn99-g__6TbPQ0,2699
|
46
46
|
langfun/core/eval/__init__.py,sha256=Ogdr9OtTywhhLPHi3AZzOD2mXX2oyaHWflrSTMm96uA,1899
|
47
|
-
langfun/core/eval/base.py,sha256=
|
48
|
-
langfun/core/eval/base_test.py,sha256=
|
47
|
+
langfun/core/eval/base.py,sha256=yuKIJzelGyhWrNaAS9ziioSwwhn2LgoK4Z6eZahRLtU,74758
|
48
|
+
langfun/core/eval/base_test.py,sha256=VEraWaRybSxOCOcZrZouNkiroDEPR6uyFBJoAz-1pQg,26930
|
49
49
|
langfun/core/eval/matching.py,sha256=9GX8HfO9jKxgNLAivgy5K88Xhoh6Z7Pptq65pe7vht8,9762
|
50
50
|
langfun/core/eval/matching_test.py,sha256=f7iVyXH5KGJBWt4Wp14Bt9J3X59A6Ayfog9MbuFvPew,5532
|
51
51
|
langfun/core/eval/patching.py,sha256=R0s2eAd1m97exQt06dmUL0V_MBG0W2Hxg7fhNB7cXW0,3866
|
@@ -70,9 +70,9 @@ langfun/core/llms/rest_test.py,sha256=NZ3Nf0XQVpT9kLP5cBVo_yBHLI7vWTYhWQxYEJVMGs
|
|
70
70
|
langfun/core/llms/vertexai.py,sha256=tXAnP357XhcsETTnk6M-hH4xyFi7tk6fsaf3tjzsY6E,14501
|
71
71
|
langfun/core/llms/vertexai_test.py,sha256=EPR-mB2hNUpvpf7E8m_k5bh04epdQTVUuYU6hPgZyu8,10321
|
72
72
|
langfun/core/llms/cache/__init__.py,sha256=QAo3InUMDM_YpteNnVCSejI4zOsnjSMWKJKzkb3VY64,993
|
73
|
-
langfun/core/llms/cache/base.py,sha256=
|
74
|
-
langfun/core/llms/cache/in_memory.py,sha256=
|
75
|
-
langfun/core/llms/cache/in_memory_test.py,sha256=
|
73
|
+
langfun/core/llms/cache/base.py,sha256=rt3zwmyw0y9jsSGW-ZbV1vAfLxQ7_3AVk0l2EySlse4,3918
|
74
|
+
langfun/core/llms/cache/in_memory.py,sha256=l6b-iU9OTfTRo9Zmg4VrQIuArs4cCJDOpXiEpvNocjo,5004
|
75
|
+
langfun/core/llms/cache/in_memory_test.py,sha256=ic6Z_crpuYdkUVPBbB9DomOddRxQdf57a2L_Sv5nHtM,10217
|
76
76
|
langfun/core/memories/__init__.py,sha256=HpghfZ-w1NQqzJXBx8Lz0daRhB2rcy2r9Xm491SBhC4,773
|
77
77
|
langfun/core/memories/conversation_history.py,sha256=c9amD8hCxGFiZuVAzkP0dOMWSp8L90uvwkOejjuBqO0,1835
|
78
78
|
langfun/core/memories/conversation_history_test.py,sha256=AaW8aNoFjxNusanwJDV0r3384Mg0eAweGmPx5DIkM0Y,2052
|
@@ -96,12 +96,12 @@ langfun/core/structured/description.py,sha256=SXW4MJvshFjbR-0gw6rE21o6WXq12UlRXa
|
|
96
96
|
langfun/core/structured/description_test.py,sha256=UtZGjSFUaQ6130t1E5tcL7ODu0xIefkapb53TbnqsK8,7362
|
97
97
|
langfun/core/structured/function_generation.py,sha256=pFgS3vcRAWiuFBol2x5Eeip3XqoudONsOpeJpWyjT3s,7479
|
98
98
|
langfun/core/structured/function_generation_test.py,sha256=ZJI-aaGgWWszn92u7h5IZ9Pl70N2DgAGGJrIxPzsvwg,10065
|
99
|
-
langfun/core/structured/mapping.py,sha256=
|
99
|
+
langfun/core/structured/mapping.py,sha256=dKOCvIA_kCQ88KoCnP5k0iOe9xRt8WLC2kbT6qPqrd8,12016
|
100
100
|
langfun/core/structured/mapping_test.py,sha256=zQoVx3kAD5oSm_OJAQA6q41NXLLyn8qs6CIVJgAoP_w,4489
|
101
101
|
langfun/core/structured/parsing.py,sha256=keoVqEfzAbdULh6GawWFsTQzU91MzJXYFZjXGXLaD8g,11492
|
102
102
|
langfun/core/structured/parsing_test.py,sha256=34wDrXaQ-EYhJLfDL8mX9K53oQMSzh5pVYdKjnESmK8,20895
|
103
103
|
langfun/core/structured/prompting.py,sha256=_U6Z65AwXvVvfaQFCY9GawB_QV9S3u7P7BOU2URABmw,8873
|
104
|
-
langfun/core/structured/prompting_test.py,sha256=
|
104
|
+
langfun/core/structured/prompting_test.py,sha256=SyyBMmw-gwnrnr1MrwkjZiQaMq85kc9MHoYwzCITa10,23266
|
105
105
|
langfun/core/structured/schema.py,sha256=oiT4P4Q9pG-QOnFzxETN2EQZqNln8nG4zAJHxcmeX9U,27729
|
106
106
|
langfun/core/structured/schema_generation.py,sha256=U3nRQsqmMZg_qIVDh2fiY3K4JLfsAL1LcKzIFP1iXFg,5316
|
107
107
|
langfun/core/structured/schema_generation_test.py,sha256=RM9s71kMNg2jTePwInkiW9fK1ACN37eyPeF8OII-0zw,2950
|
@@ -119,8 +119,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
119
119
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
120
120
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
121
121
|
langfun/core/templates/selfplay_test.py,sha256=rBW2Qr8yi-aWYwoTwRR-n1peKyMX9QXPZXURjLgoiRs,2264
|
122
|
-
langfun-0.1.1.
|
123
|
-
langfun-0.1.1.
|
124
|
-
langfun-0.1.1.
|
125
|
-
langfun-0.1.1.
|
126
|
-
langfun-0.1.1.
|
122
|
+
langfun-0.1.1.dev20240827.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
123
|
+
langfun-0.1.1.dev20240827.dist-info/METADATA,sha256=O4CZgKKxbwRK492QWVfyTGmU1RnRBLyWs12Uo9F8ldM,5234
|
124
|
+
langfun-0.1.1.dev20240827.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
125
|
+
langfun-0.1.1.dev20240827.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
126
|
+
langfun-0.1.1.dev20240827.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|