langfun 0.0.2.dev20240608__py3-none-any.whl → 0.0.2.dev20240613__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.
Potentially problematic release.
This version of langfun might be problematic. Click here for more details.
- langfun/core/__init__.py +3 -0
- langfun/core/modalities/mime.py +16 -14
- langfun/core/modalities/mime_test.py +8 -0
- langfun/core/repr_utils.py +83 -0
- langfun/core/repr_utils_test.py +58 -0
- langfun/core/structured/completion.py +27 -2
- langfun/core/structured/mapping.py +7 -34
- langfun/core/structured/prompting_test.py +53 -13
- langfun/core/structured/schema.py +2 -0
- langfun/core/structured/schema_test.py +5 -0
- {langfun-0.0.2.dev20240608.dist-info → langfun-0.0.2.dev20240613.dist-info}/METADATA +1 -1
- {langfun-0.0.2.dev20240608.dist-info → langfun-0.0.2.dev20240613.dist-info}/RECORD +15 -13
- {langfun-0.0.2.dev20240608.dist-info → langfun-0.0.2.dev20240613.dist-info}/LICENSE +0 -0
- {langfun-0.0.2.dev20240608.dist-info → langfun-0.0.2.dev20240613.dist-info}/WHEEL +0 -0
- {langfun-0.0.2.dev20240608.dist-info → langfun-0.0.2.dev20240613.dist-info}/top_level.txt +0 -0
langfun/core/__init__.py
CHANGED
@@ -121,6 +121,9 @@ from langfun.core.memory import Memory
|
|
121
121
|
# Utility for console output.
|
122
122
|
from langfun.core import console
|
123
123
|
|
124
|
+
# Helpers for implementing _repr_xxx_ methods.
|
125
|
+
from langfun.core import repr_utils
|
126
|
+
|
124
127
|
# Utility for event logging.
|
125
128
|
from langfun.core import logging
|
126
129
|
|
langfun/core/modalities/mime.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2024 The Langfun Authors
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -53,19 +53,21 @@ class Mime(lf.Modality):
|
|
53
53
|
|
54
54
|
@functools.cached_property
|
55
55
|
def is_text(self) -> bool:
|
56
|
-
return self.mime_type.startswith(
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
56
|
+
return self.mime_type.startswith((
|
57
|
+
'text/',
|
58
|
+
'application/javascript',
|
59
|
+
'application/json',
|
60
|
+
'application/ld+json',
|
61
|
+
'application/plain',
|
62
|
+
'application/rtf',
|
63
|
+
'application/xhtml+xml',
|
64
|
+
'application/xml',
|
65
|
+
'application/x-javascript',
|
66
|
+
'application/x-python-code',
|
67
|
+
'application/x-tex',
|
68
|
+
'application/x-typescript',
|
69
|
+
'application/x-yaml',
|
70
|
+
))
|
69
71
|
|
70
72
|
@property
|
71
73
|
def is_binary(self) -> bool:
|
@@ -32,6 +32,14 @@ def mock_readfile(*args, **kwargs):
|
|
32
32
|
|
33
33
|
class CustomMimeTest(unittest.TestCase):
|
34
34
|
|
35
|
+
def test_is_text(self):
|
36
|
+
self.assertTrue(mime.Custom('text/plain', b'foo').is_text)
|
37
|
+
self.assertTrue(mime.Custom('text/xml', b'foo').is_text)
|
38
|
+
self.assertTrue(mime.Custom('application/json', b'foo').is_text)
|
39
|
+
self.assertTrue(mime.Custom('application/x-python-code', b'foo').is_text)
|
40
|
+
self.assertFalse(mime.Custom('application/pdf', b'foo').is_text)
|
41
|
+
self.assertFalse(mime.Custom('application/octet-stream', b'foo').is_text)
|
42
|
+
|
35
43
|
def test_from_byes(self):
|
36
44
|
content = mime.Mime.from_bytes(b'hello')
|
37
45
|
self.assertIs(content.__class__, mime.Mime)
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# Copyright 2024 The Langfun Authors
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
"""Helpers for implementing _repr_xxx_ methods."""
|
15
|
+
|
16
|
+
import collections
|
17
|
+
import contextlib
|
18
|
+
import io
|
19
|
+
from typing import Iterator
|
20
|
+
|
21
|
+
from langfun.core import component
|
22
|
+
|
23
|
+
|
24
|
+
@contextlib.contextmanager
|
25
|
+
def share_parts() -> Iterator[dict[str, int]]:
|
26
|
+
"""Context manager for defining the context (scope) of shared content.
|
27
|
+
|
28
|
+
Under the context manager, call to `lf.write_shared` with the same content
|
29
|
+
will be written only once. This is useful for writing shared content such as
|
30
|
+
shared style and script sections in the HTML.
|
31
|
+
|
32
|
+
Example:
|
33
|
+
```
|
34
|
+
class Foo(pg.Object):
|
35
|
+
def _repr_html_(self) -> str:
|
36
|
+
s = io.StringIO()
|
37
|
+
lf.repr_utils.write_shared_part(s, '<style>..</style>')
|
38
|
+
lf.repr_utils.write_shared_part(s, '<script>..</script>')
|
39
|
+
return s.getvalue()
|
40
|
+
|
41
|
+
with lf.repr_utils.share_parts() as share_parts:
|
42
|
+
# The <style> and <script> section will be written only once.
|
43
|
+
lf.console.display(Foo())
|
44
|
+
lf.console.display(Foo())
|
45
|
+
|
46
|
+
# Assert that the shared content is attempted to be written twice.
|
47
|
+
assert share_parts['<style>..</style>'] == 2
|
48
|
+
```
|
49
|
+
|
50
|
+
Yields:
|
51
|
+
A dictionary mapping the shared content to the number of times it is
|
52
|
+
attempted to be written.
|
53
|
+
"""
|
54
|
+
context = component.context_value(
|
55
|
+
'__shared_parts__', collections.defaultdict(int)
|
56
|
+
)
|
57
|
+
with component.context(__shared_parts__=context):
|
58
|
+
try:
|
59
|
+
yield context
|
60
|
+
finally:
|
61
|
+
pass
|
62
|
+
|
63
|
+
|
64
|
+
def write_maybe_shared(s: io.StringIO, content: str) -> bool:
|
65
|
+
"""Writes a maybe shared part to an string stream.
|
66
|
+
|
67
|
+
Args:
|
68
|
+
s: The string stream to write to.
|
69
|
+
content: A maybe shared content to write.
|
70
|
+
|
71
|
+
Returns:
|
72
|
+
True if the content is written to the string. False if the content is
|
73
|
+
already written under the same share context.
|
74
|
+
"""
|
75
|
+
context = component.context_value('__shared_parts__', None)
|
76
|
+
if context is None:
|
77
|
+
s.write(content)
|
78
|
+
return True
|
79
|
+
written = content in context
|
80
|
+
if not written:
|
81
|
+
s.write(content)
|
82
|
+
context[content] += 1
|
83
|
+
return not written
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Copyright 2024 The Langfun Authors
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
"""Tests for langfun.core.repr_utils."""
|
15
|
+
|
16
|
+
import io
|
17
|
+
import unittest
|
18
|
+
|
19
|
+
from langfun.core import repr_utils
|
20
|
+
|
21
|
+
|
22
|
+
class SharingContentTest(unittest.TestCase):
|
23
|
+
|
24
|
+
def test_sharing(self):
|
25
|
+
s = io.StringIO()
|
26
|
+
|
27
|
+
self.assertTrue(repr_utils.write_maybe_shared(s, '<hr>'))
|
28
|
+
self.assertTrue(repr_utils.write_maybe_shared(s, '<hr>'))
|
29
|
+
|
30
|
+
with repr_utils.share_parts() as ctx1:
|
31
|
+
self.assertTrue(repr_utils.write_maybe_shared(s, '<style></style>'))
|
32
|
+
self.assertFalse(repr_utils.write_maybe_shared(s, '<style></style>'))
|
33
|
+
|
34
|
+
with repr_utils.share_parts() as ctx2:
|
35
|
+
self.assertIs(ctx2, ctx1)
|
36
|
+
self.assertFalse(repr_utils.write_maybe_shared(s, '<style></style>'))
|
37
|
+
self.assertTrue(repr_utils.write_maybe_shared(s, '<style>a</style>'))
|
38
|
+
self.assertFalse(repr_utils.write_maybe_shared(s, '<style>a</style>'))
|
39
|
+
self.assertTrue(repr_utils.write_maybe_shared(s, '<style>b</style>'))
|
40
|
+
|
41
|
+
with repr_utils.share_parts() as ctx3:
|
42
|
+
self.assertIs(ctx3, ctx1)
|
43
|
+
self.assertFalse(repr_utils.write_maybe_shared(s, '<style></style>'))
|
44
|
+
self.assertFalse(repr_utils.write_maybe_shared(s, '<style>a</style>'))
|
45
|
+
self.assertFalse(repr_utils.write_maybe_shared(s, '<style>a</style>'))
|
46
|
+
self.assertFalse(repr_utils.write_maybe_shared(s, '<style>b</style>'))
|
47
|
+
|
48
|
+
self.assertEqual(
|
49
|
+
s.getvalue(),
|
50
|
+
'<hr><hr><style></style><style>a</style><style>b</style>'
|
51
|
+
)
|
52
|
+
self.assertEqual(ctx1['<style></style>'], 4)
|
53
|
+
self.assertEqual(ctx1['<style>b</style>'], 2)
|
54
|
+
self.assertEqual(ctx1['<style>a</style>'], 4)
|
55
|
+
|
56
|
+
|
57
|
+
if __name__ == '__main__':
|
58
|
+
unittest.main()
|
@@ -30,7 +30,7 @@ class CompleteStructure(mapping.Mapping):
|
|
30
30
|
|
31
31
|
mapping_template = lf.Template("""
|
32
32
|
{{ input_title }}:
|
33
|
-
{{ example.input_repr() | indent(2, True) }}
|
33
|
+
{{ example.input_repr(use_modality_ref=True) | indent(2, True) }}
|
34
34
|
|
35
35
|
{%- if missing_type_dependencies(example.input) %}
|
36
36
|
|
@@ -45,13 +45,16 @@ class CompleteStructure(mapping.Mapping):
|
|
45
45
|
|
46
46
|
{{ output_title }}:
|
47
47
|
{%- if example.has_output %}
|
48
|
-
{{ example.output_repr() | indent(2, True) }}
|
48
|
+
{{ example.output_repr(use_modality_ref=True) | indent(2, True) }}
|
49
49
|
{% endif -%}
|
50
50
|
""")
|
51
51
|
|
52
52
|
input_title = 'INPUT_OBJECT'
|
53
53
|
output_title = 'OUTPUT_OBJECT'
|
54
54
|
schema_title = 'CLASS_DEFINITIONS'
|
55
|
+
modality_refs_title: Annotated[
|
56
|
+
str, 'The section title for modality refs.'
|
57
|
+
] = 'MODALITY_REFERENCES'
|
55
58
|
|
56
59
|
preamble = lf.LangFunc(
|
57
60
|
"""
|
@@ -148,6 +151,28 @@ class CompleteStructure(mapping.Mapping):
|
|
148
151
|
pg.traverse(self.input, _visit)
|
149
152
|
return context
|
150
153
|
|
154
|
+
#
|
155
|
+
# Helper methods for handling modalities.
|
156
|
+
#
|
157
|
+
|
158
|
+
def has_modality_refs(self, value: Any) -> bool:
|
159
|
+
"""Returns true if the value has modalities."""
|
160
|
+
return not isinstance(value, lf.Modality) and pg.contains(
|
161
|
+
value, type=lf.Modality
|
162
|
+
)
|
163
|
+
|
164
|
+
def modalities(self, value: Any) -> dict[str, lf.Modality]:
|
165
|
+
return lf.Modality.from_value(value)
|
166
|
+
|
167
|
+
def modality_refs_repr(self, value: Any) -> str:
|
168
|
+
with lf.modality.format_modality_as_ref(True):
|
169
|
+
return pg.format(
|
170
|
+
self.modalities(value),
|
171
|
+
compact=False,
|
172
|
+
verbose=False,
|
173
|
+
python_format=True,
|
174
|
+
)
|
175
|
+
|
151
176
|
|
152
177
|
def complete(
|
153
178
|
input_value: pg.Symbolic,
|
@@ -107,7 +107,11 @@ class MappingExample(lf.NaturalLanguageFormattable, lf.Component):
|
|
107
107
|
|
108
108
|
@classmethod
|
109
109
|
def value_repr(
|
110
|
-
cls,
|
110
|
+
cls,
|
111
|
+
value: Any,
|
112
|
+
protocol: schema_lib.SchemaProtocol = 'python',
|
113
|
+
use_modality_ref: bool = False,
|
114
|
+
**kwargs
|
111
115
|
) -> str:
|
112
116
|
if isinstance(value, str):
|
113
117
|
return value
|
@@ -116,7 +120,7 @@ class MappingExample(lf.NaturalLanguageFormattable, lf.Component):
|
|
116
120
|
return str(value)
|
117
121
|
|
118
122
|
# Placehold modalities if they are present.
|
119
|
-
if pg.contains(value, type=lf.Modality):
|
123
|
+
if use_modality_ref and pg.contains(value, type=lf.Modality):
|
120
124
|
value = lf.ModalityRef.placehold(value)
|
121
125
|
return schema_lib.value_repr(protocol).repr(value, **kwargs)
|
122
126
|
|
@@ -243,13 +247,7 @@ class Mapping(lf.LangFunc):
|
|
243
247
|
{{ input_title }}:
|
244
248
|
{{ example.input_repr(protocol, compact=False) | indent(2, True) }}
|
245
249
|
|
246
|
-
{% if
|
247
|
-
{{ modality_refs_title }}:
|
248
|
-
{{ modality_refs_repr(example.input) | indent(2, True) }}
|
249
|
-
|
250
|
-
{% endif -%}
|
251
|
-
|
252
|
-
{%- if example.schema -%}
|
250
|
+
{% if example.schema -%}
|
253
251
|
{{ schema_title }}:
|
254
252
|
{{ example.schema_repr(protocol) | indent(2, True) }}
|
255
253
|
|
@@ -270,10 +268,6 @@ class Mapping(lf.LangFunc):
|
|
270
268
|
|
271
269
|
schema_title: Annotated[str, 'The section title for schema.'] = 'SCHEMA'
|
272
270
|
|
273
|
-
modality_refs_title: Annotated[
|
274
|
-
str, 'The section title for modality refs.'
|
275
|
-
] = 'MODALITY_REFERENCES'
|
276
|
-
|
277
271
|
protocol: Annotated[
|
278
272
|
schema_lib.SchemaProtocol,
|
279
273
|
'The protocol for representing the schema and value.',
|
@@ -378,24 +372,3 @@ class Mapping(lf.LangFunc):
|
|
378
372
|
"""Gets additional symbol definitions besides schema as globals."""
|
379
373
|
return {'ModalityRef': lf.modality.ModalityRef}
|
380
374
|
|
381
|
-
#
|
382
|
-
# Helper methods for handling modalities.
|
383
|
-
#
|
384
|
-
|
385
|
-
def has_modality_refs(self, value: Any) -> bool:
|
386
|
-
"""Returns true if the value has modalities."""
|
387
|
-
return not isinstance(value, lf.Modality) and pg.contains(
|
388
|
-
value, type=lf.Modality
|
389
|
-
)
|
390
|
-
|
391
|
-
def modalities(self, value: Any) -> dict[str, lf.Modality]:
|
392
|
-
return lf.Modality.from_value(value)
|
393
|
-
|
394
|
-
def modality_refs_repr(self, value: Any) -> str:
|
395
|
-
with lf.modality.format_modality_as_ref(True):
|
396
|
-
return pg.format(
|
397
|
-
self.modalities(value),
|
398
|
-
compact=False,
|
399
|
-
verbose=False,
|
400
|
-
python_format=True,
|
401
|
-
)
|
@@ -41,13 +41,17 @@ class QueryTest(unittest.TestCase):
|
|
41
41
|
self,
|
42
42
|
prompt,
|
43
43
|
schema,
|
44
|
+
examples: list[mapping.MappingExample] | None = None,
|
44
45
|
*,
|
45
46
|
expected_snippet: str,
|
46
47
|
exact_match: bool = False,
|
47
48
|
expected_modalities: int = 0,
|
48
49
|
**kwargs,
|
49
50
|
):
|
50
|
-
m = prompting.query(
|
51
|
+
m = prompting.query(
|
52
|
+
prompt, schema=schema, examples=examples,
|
53
|
+
**kwargs, returns_message=True
|
54
|
+
)
|
51
55
|
self.assertIsNotNone(m.lm_input)
|
52
56
|
if exact_match:
|
53
57
|
self.assertEqual(expected_snippet, m.lm_input.text)
|
@@ -265,24 +269,60 @@ class QueryTest(unittest.TestCase):
|
|
265
269
|
INPUT_OBJECT:
|
266
270
|
```python
|
267
271
|
[
|
268
|
-
|
269
|
-
|
270
|
-
),
|
271
|
-
ModalityRef(
|
272
|
-
name='input[1]'
|
273
|
-
)
|
272
|
+
<<[[input[0]]]>>,
|
273
|
+
<<[[input[1]]]>>
|
274
274
|
]
|
275
275
|
```
|
276
|
-
|
277
|
-
MODALITY_REFERENCES:
|
278
|
-
{
|
279
|
-
'input[0]': <<[[input[0]]]>>,
|
280
|
-
'input[1]': <<[[input[1]]]>>
|
281
|
-
}
|
282
276
|
"""),
|
283
277
|
expected_modalities=2,
|
284
278
|
)
|
285
279
|
|
280
|
+
def test_structure_with_modality_and_examples_to_structure_render(self):
|
281
|
+
lm = fake.StaticResponse('["cat", "mouse"]')
|
282
|
+
self.assert_render(
|
283
|
+
[
|
284
|
+
modalities.Image.from_bytes(b'cat_image'),
|
285
|
+
modalities.Image.from_bytes(b'mouse_image'),
|
286
|
+
],
|
287
|
+
list[str],
|
288
|
+
examples=[
|
289
|
+
mapping.MappingExample(
|
290
|
+
input=[modalities.Image.from_bytes(b'dog_image')],
|
291
|
+
schema=list[str],
|
292
|
+
output=['dog'],
|
293
|
+
),
|
294
|
+
],
|
295
|
+
lm=lm,
|
296
|
+
expected_snippet=inspect.cleandoc("""
|
297
|
+
INPUT_OBJECT:
|
298
|
+
```python
|
299
|
+
[
|
300
|
+
<<[[examples[0].input[0]]]>>
|
301
|
+
]
|
302
|
+
```
|
303
|
+
|
304
|
+
OUTPUT_TYPE:
|
305
|
+
list[str]
|
306
|
+
|
307
|
+
OUTPUT_OBJECT:
|
308
|
+
```python
|
309
|
+
[
|
310
|
+
'dog'
|
311
|
+
]
|
312
|
+
```
|
313
|
+
|
314
|
+
|
315
|
+
INPUT_OBJECT:
|
316
|
+
```python
|
317
|
+
[
|
318
|
+
<<[[input[0]]]>>,
|
319
|
+
<<[[input[1]]]>>
|
320
|
+
]
|
321
|
+
```
|
322
|
+
"""),
|
323
|
+
expected_modalities=3,
|
324
|
+
)
|
325
|
+
|
286
326
|
def test_bad_protocol(self):
|
287
327
|
with self.assertRaisesRegex(ValueError, 'Unknown protocol'):
|
288
328
|
prompting.query('what is 1 + 1', int, protocol='text')
|
@@ -656,6 +656,8 @@ class ValuePythonRepr(ValueRepr):
|
|
656
656
|
return object_code
|
657
657
|
else:
|
658
658
|
object_code = SchemaPythonRepr().result_definition(cls_schema)
|
659
|
+
elif isinstance(value, lf.Template):
|
660
|
+
return str(value)
|
659
661
|
else:
|
660
662
|
object_code = pg.format(
|
661
663
|
value, compact=compact, verbose=verbose, python_format=True
|
@@ -18,6 +18,7 @@ import inspect
|
|
18
18
|
import typing
|
19
19
|
import unittest
|
20
20
|
|
21
|
+
import langfun.core as lf
|
21
22
|
from langfun.core.llms import fake
|
22
23
|
from langfun.core.structured import schema as schema_lib
|
23
24
|
import pyglove as pg
|
@@ -694,6 +695,10 @@ class ValuePythonReprTest(unittest.TestCase):
|
|
694
695
|
schema_lib.ValuePythonRepr().repr(1, schema_lib.Schema(int)),
|
695
696
|
'```python\n1\n```'
|
696
697
|
)
|
698
|
+
self.assertEqual(
|
699
|
+
schema_lib.ValuePythonRepr().repr(lf.Template('hi, {{a}}', a='foo')),
|
700
|
+
'hi, foo'
|
701
|
+
)
|
697
702
|
self.assertEqual(
|
698
703
|
schema_lib.ValuePythonRepr().repr(
|
699
704
|
A([Foo(1), Foo(2)], 'bar'), schema_lib.Schema(A), markdown=False,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
langfun/__init__.py,sha256=P62MnqA6-f0h8iYfQ3MT6Yg7a4qRnQeb4GrIn6dcSnY,2274
|
2
|
-
langfun/core/__init__.py,sha256=
|
2
|
+
langfun/core/__init__.py,sha256=Mdp1a2YnXdSmfTfbUwuAnEWYbjA3rXXGtbxl5fljZyg,4812
|
3
3
|
langfun/core/component.py,sha256=Icyoj9ICoJoK2r2PHbrFXbxnseOr9QZZOvKWklLWNo8,10276
|
4
4
|
langfun/core/component_test.py,sha256=q15Xn51cVTu2RKxZ9U5VQgT3bm6RQ4638bKhWBtvW5o,8220
|
5
5
|
langfun/core/concurrent.py,sha256=TRc49pJ3HQro2kb5FtcWkHjhBm8UcgE8RJybU5cU3-0,24537
|
@@ -19,6 +19,8 @@ langfun/core/modality.py,sha256=Tla4t86DUYHpbZ2G7dy1r19fTj_Ga5XOvlYp6lbWa-Q,3512
|
|
19
19
|
langfun/core/modality_test.py,sha256=HyZ5xONKQ0Fw18SzoWAq-Ob9njOXIIjBo1hNtw-rudw,2400
|
20
20
|
langfun/core/natural_language.py,sha256=3ynSnaYQnjE60LIPK5fyMgdIjubnPYZwzGq4rWPeloE,1177
|
21
21
|
langfun/core/natural_language_test.py,sha256=LHGU_1ytbkGuSZQFIFP7vP3dBlcY4-A12fT6dbjUA0E,1424
|
22
|
+
langfun/core/repr_utils.py,sha256=HrN7FoGUvpTlv5aL_XISouwZN84z9LmrB6_2jEn1ukc,2590
|
23
|
+
langfun/core/repr_utils_test.py,sha256=-XId1A72Vbzo289dYuxC6TegNXuZhI28WbNrm1ghiwc,2206
|
22
24
|
langfun/core/sampling.py,sha256=vygWvgC8MFw0_AKNSmz-ywMXJYWf8cl0tI8QycvAmyI,5795
|
23
25
|
langfun/core/sampling_test.py,sha256=U7PANpMsl9E_pa4_Y4FzesSjcwg-u-LKHGCWSgv-8FY,3663
|
24
26
|
langfun/core/subscription.py,sha256=euawEuSZP-BHydaT-AQpfYFL0m5pWPGcW0upFhrojqc,10930
|
@@ -79,8 +81,8 @@ langfun/core/modalities/audio.py,sha256=Qxo7bYjLKQ1gVJVomr9RqR2SvxY826QgXhTzzk43
|
|
79
81
|
langfun/core/modalities/audio_test.py,sha256=gWCB9h3FyrdGqro3ajBXqkw0lU0W1sBjOOq6wZbl7Fg,2027
|
80
82
|
langfun/core/modalities/image.py,sha256=qi7B9uYLxBoKvMzApdOQNpVcp_dKaRwLzeshg2nvo9k,926
|
81
83
|
langfun/core/modalities/image_test.py,sha256=qU7G4ucUihIQ9ZB453FsUfcOipUYx5TnnuoMB1GIMfE,3034
|
82
|
-
langfun/core/modalities/mime.py,sha256=
|
83
|
-
langfun/core/modalities/mime_test.py,sha256=
|
84
|
+
langfun/core/modalities/mime.py,sha256=7oYvwYZHb3uhjiL2rF6kvQWsWufY0UXl72wfDXC59ys,5918
|
85
|
+
langfun/core/modalities/mime_test.py,sha256=kmRiPP-3Py02NnKPu0oPexSIJ-MXaaE2UYY82ga0TV8,2913
|
84
86
|
langfun/core/modalities/ms_office.py,sha256=jOidMSdWCaV9RILpGz8VJkpTSpHJNoirD53jzQvcytM,3388
|
85
87
|
langfun/core/modalities/ms_office_test.py,sha256=d_NZ0QU23NydenYZgNj6YxgO5ZYzjg-HCbglsVJGp04,87866
|
86
88
|
langfun/core/modalities/pdf.py,sha256=mfaeCbUA4JslFVTARiJh8hW7imvL4tLVw9gUhO5bAZA,727
|
@@ -88,22 +90,22 @@ langfun/core/modalities/pdf_test.py,sha256=KE40zJD3Whe6ty2OULkp1J8jwLmB4ZjGXlGek
|
|
88
90
|
langfun/core/modalities/video.py,sha256=sKcXxbx9S1ERjH8yEzkbtySpcRJD40QiPIQiIBy-U5I,955
|
89
91
|
langfun/core/modalities/video_test.py,sha256=GbsoefSeO7y8kCYhTtp4s9E3ah_eYrb6Z-MXpS01RFc,2046
|
90
92
|
langfun/core/structured/__init__.py,sha256=yp60yeDSVlyT0ElmLwbpBHnQtk_JX5udnjG1UGcsXKA,3776
|
91
|
-
langfun/core/structured/completion.py,sha256=
|
93
|
+
langfun/core/structured/completion.py,sha256=cS2PjG7sqzDu5x0xoTk8RmNcoeX55iVwH38NTefkMHg,8108
|
92
94
|
langfun/core/structured/completion_test.py,sha256=2mUzDMKGF_WGfTtsnfmfMDx97dkJ-98y8leen__qWLA,19281
|
93
95
|
langfun/core/structured/description.py,sha256=SXW4MJvshFjbR-0gw6rE21o6WXq12UlRXawvDBXMZFA,5211
|
94
96
|
langfun/core/structured/description_test.py,sha256=UtZGjSFUaQ6130t1E5tcL7ODu0xIefkapb53TbnqsK8,7362
|
95
97
|
langfun/core/structured/function_generation.py,sha256=pFgS3vcRAWiuFBol2x5Eeip3XqoudONsOpeJpWyjT3s,7479
|
96
98
|
langfun/core/structured/function_generation_test.py,sha256=ZJI-aaGgWWszn92u7h5IZ9Pl70N2DgAGGJrIxPzsvwg,10065
|
97
|
-
langfun/core/structured/mapping.py,sha256=
|
99
|
+
langfun/core/structured/mapping.py,sha256=QKbSnvOgut-sx2mZPjHJcdlDLxR8b3ZC16ZLWociwog,11298
|
98
100
|
langfun/core/structured/mapping_test.py,sha256=PiXklMeIa8L6KtMi3ju7J9Y39gZy0hIGz-Oeq4A_7XE,3835
|
99
101
|
langfun/core/structured/parsing.py,sha256=keoVqEfzAbdULh6GawWFsTQzU91MzJXYFZjXGXLaD8g,11492
|
100
102
|
langfun/core/structured/parsing_test.py,sha256=34wDrXaQ-EYhJLfDL8mX9K53oQMSzh5pVYdKjnESmK8,20895
|
101
103
|
langfun/core/structured/prompting.py,sha256=vjmJn7GMFkqkrEB6qRrYvjB78WVx_OhsIyMN8PTb-7o,8641
|
102
|
-
langfun/core/structured/prompting_test.py,sha256=
|
103
|
-
langfun/core/structured/schema.py,sha256=
|
104
|
+
langfun/core/structured/prompting_test.py,sha256=W1FmbOfMXhBV8uZ3WN1fBxKLtdYngvR9l1JYo46HqJQ,22723
|
105
|
+
langfun/core/structured/schema.py,sha256=oiT4P4Q9pG-QOnFzxETN2EQZqNln8nG4zAJHxcmeX9U,27729
|
104
106
|
langfun/core/structured/schema_generation.py,sha256=U3nRQsqmMZg_qIVDh2fiY3K4JLfsAL1LcKzIFP1iXFg,5316
|
105
107
|
langfun/core/structured/schema_generation_test.py,sha256=RM9s71kMNg2jTePwInkiW9fK1ACN37eyPeF8OII-0zw,2950
|
106
|
-
langfun/core/structured/schema_test.py,sha256=
|
108
|
+
langfun/core/structured/schema_test.py,sha256=RjYhwTgktQgyqAjzLvo967nTiIK9KWgP-aNGg4e7ihE,25258
|
107
109
|
langfun/core/structured/scoring.py,sha256=QyT1S8FkLtKICfUbh4AXoKK3YJ_rgejyk6TI2OtOa68,2751
|
108
110
|
langfun/core/structured/scoring_test.py,sha256=39_dw6p_FkoqeUccO67yIqos-MccAWezoozS21i8mi0,1732
|
109
111
|
langfun/core/templates/__init__.py,sha256=bO0eMsVJbi7sxEB2YlInKRQ2EVP-RyyKUwcD-8msuN4,927
|
@@ -115,8 +117,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
115
117
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
116
118
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
117
119
|
langfun/core/templates/selfplay_test.py,sha256=rBW2Qr8yi-aWYwoTwRR-n1peKyMX9QXPZXURjLgoiRs,2264
|
118
|
-
langfun-0.0.2.
|
119
|
-
langfun-0.0.2.
|
120
|
-
langfun-0.0.2.
|
121
|
-
langfun-0.0.2.
|
122
|
-
langfun-0.0.2.
|
120
|
+
langfun-0.0.2.dev20240613.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
121
|
+
langfun-0.0.2.dev20240613.dist-info/METADATA,sha256=h3fWeJU8ejsvol_8wbw4DoS_D8L7ARomUo2hweGPF2A,3550
|
122
|
+
langfun-0.0.2.dev20240613.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
123
|
+
langfun-0.0.2.dev20240613.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
124
|
+
langfun-0.0.2.dev20240613.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|