langfun 0.0.2.dev20240429__py3-none-any.whl → 0.0.2.dev20240511__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/__init__.py +5 -0
- langfun/core/eval/__init__.py +14 -1
- langfun/core/eval/base.py +503 -112
- langfun/core/eval/base_test.py +185 -53
- langfun/core/eval/matching.py +22 -21
- langfun/core/eval/matching_test.py +23 -2
- langfun/core/eval/patching.py +130 -0
- langfun/core/eval/patching_test.py +170 -0
- langfun/core/eval/scoring.py +4 -4
- langfun/core/eval/scoring_test.py +19 -2
- langfun/core/langfunc.py +1 -17
- langfun/core/langfunc_test.py +4 -0
- langfun/core/language_model.py +6 -0
- langfun/core/llms/__init__.py +8 -0
- langfun/core/llms/fake.py +6 -6
- langfun/core/llms/google_genai.py +8 -0
- langfun/core/llms/openai.py +3 -2
- langfun/core/llms/openai_test.py +2 -1
- langfun/core/llms/vertexai.py +291 -0
- langfun/core/llms/vertexai_test.py +233 -0
- langfun/core/modalities/image.py +1 -3
- langfun/core/modalities/mime.py +6 -0
- langfun/core/modalities/video.py +1 -3
- langfun/core/structured/__init__.py +2 -0
- langfun/core/structured/mapping.py +5 -1
- langfun/core/structured/prompting.py +39 -11
- langfun/core/structured/prompting_test.py +43 -0
- langfun/core/structured/schema.py +34 -4
- langfun/core/structured/schema_test.py +32 -1
- langfun/core/structured/scoring.py +4 -1
- langfun/core/structured/scoring_test.py +6 -0
- langfun/core/template.py +22 -1
- {langfun-0.0.2.dev20240429.dist-info → langfun-0.0.2.dev20240511.dist-info}/METADATA +2 -2
- {langfun-0.0.2.dev20240429.dist-info → langfun-0.0.2.dev20240511.dist-info}/RECORD +37 -33
- {langfun-0.0.2.dev20240429.dist-info → langfun-0.0.2.dev20240511.dist-info}/LICENSE +0 -0
- {langfun-0.0.2.dev20240429.dist-info → langfun-0.0.2.dev20240511.dist-info}/WHEEL +0 -0
- {langfun-0.0.2.dev20240429.dist-info → langfun-0.0.2.dev20240511.dist-info}/top_level.txt +0 -0
@@ -16,6 +16,7 @@
|
|
16
16
|
from typing import Any, Callable, Type, Union
|
17
17
|
|
18
18
|
import langfun.core as lf
|
19
|
+
from langfun.core.llms import fake
|
19
20
|
from langfun.core.structured import mapping
|
20
21
|
from langfun.core.structured import schema as schema_lib
|
21
22
|
import pyglove as pg
|
@@ -113,6 +114,7 @@ def query(
|
|
113
114
|
autofix: int = 0,
|
114
115
|
autofix_lm: lf.LanguageModel | None = None,
|
115
116
|
protocol: schema_lib.SchemaProtocol = 'python',
|
117
|
+
include_methods: bool = False,
|
116
118
|
returns_message: bool = False,
|
117
119
|
skip_lm: bool = False,
|
118
120
|
**kwargs,
|
@@ -160,11 +162,11 @@ def query(
|
|
160
162
|
examples: An optional list of fewshot examples for helping parsing. If None,
|
161
163
|
the default one-shot example will be added.
|
162
164
|
cache_seed: Seed for computing cache key. The cache key is determined by a
|
163
|
-
tuple of (lm, prompt, cache seed). If None, cache will be disabled for
|
164
|
-
|
165
|
+
tuple of (lm, prompt, cache seed). If None, cache will be disabled for the
|
166
|
+
query even cache is configured by the LM.
|
165
167
|
response_postprocess: An optional callable object to process the raw LM
|
166
|
-
response before parsing it into the final output object. If None, the
|
167
|
-
|
168
|
+
response before parsing it into the final output object. If None, the raw
|
169
|
+
LM response will not be processed.
|
168
170
|
autofix: Number of attempts to auto fix the generated code. If 0, autofix is
|
169
171
|
disabled. Auto-fix is not supported for 'json' protocol.
|
170
172
|
autofix_lm: The language model to use for autofix. If not specified, the
|
@@ -172,6 +174,8 @@ def query(
|
|
172
174
|
will use `lm`.
|
173
175
|
protocol: The protocol for schema/value representation. Applicable values
|
174
176
|
are 'json' and 'python'. By default `python` will be used.
|
177
|
+
include_methods: If True, include method definitions in the output type
|
178
|
+
during prompting.
|
175
179
|
returns_message: If True, returns `lf.Message` as the output, instead of
|
176
180
|
returning the structured `message.result`.
|
177
181
|
skip_lm: If True, returns the rendered prompt as a UserMessage object.
|
@@ -211,13 +215,8 @@ def query(
|
|
211
215
|
# prompt rendering.
|
212
216
|
prompt_kwargs.pop('template_str', None)
|
213
217
|
|
214
|
-
if isinstance(prompt, str):
|
215
|
-
prompt = lf.Template(prompt, **prompt_kwargs)
|
216
|
-
elif isinstance(prompt, lf.Template):
|
217
|
-
prompt = prompt.rebind(**prompt_kwargs, raise_on_no_change=False)
|
218
|
-
|
219
|
-
if isinstance(prompt, lf.Template):
|
220
|
-
prompt = prompt.render(lm=lm)
|
218
|
+
if isinstance(prompt, (str, lf.Message, lf.Template)):
|
219
|
+
prompt = lf.Template.from_value(prompt, **prompt_kwargs).render(lm=lm)
|
221
220
|
else:
|
222
221
|
prompt = schema_lib.mark_missing(prompt)
|
223
222
|
|
@@ -226,6 +225,7 @@ def query(
|
|
226
225
|
schema=schema,
|
227
226
|
default=default,
|
228
227
|
examples=examples,
|
228
|
+
include_methods=include_methods,
|
229
229
|
response_postprocess=response_postprocess,
|
230
230
|
autofix=autofix if protocol == 'python' else 0,
|
231
231
|
**kwargs,
|
@@ -236,3 +236,31 @@ def query(
|
|
236
236
|
skip_lm=skip_lm,
|
237
237
|
)
|
238
238
|
return output if returns_message else output.result
|
239
|
+
|
240
|
+
|
241
|
+
def query_prompt(
|
242
|
+
prompt: Union[str, pg.Symbolic],
|
243
|
+
schema: Union[
|
244
|
+
schema_lib.Schema, Type[Any], list[Type[Any]], dict[str, Any], None
|
245
|
+
] = None,
|
246
|
+
**kwargs,
|
247
|
+
) -> lf.Message:
|
248
|
+
"""Returns the final prompt sent to LLM for `lf.query`."""
|
249
|
+
kwargs.pop('returns_message', None)
|
250
|
+
kwargs.pop('skip_lm', None)
|
251
|
+
return query(prompt, schema, skip_lm=True, returns_message=True, **kwargs)
|
252
|
+
|
253
|
+
|
254
|
+
def query_output(
|
255
|
+
response: Union[str, lf.Message],
|
256
|
+
schema: Union[
|
257
|
+
schema_lib.Schema, Type[Any], list[Type[Any]], dict[str, Any], None
|
258
|
+
],
|
259
|
+
**kwargs,
|
260
|
+
) -> Any:
|
261
|
+
"""Returns the final output of `lf.query` from a provided LLM response."""
|
262
|
+
kwargs.pop('prompt', None)
|
263
|
+
kwargs.pop('lm', None)
|
264
|
+
return query(
|
265
|
+
'Unused prompt', schema, lm=fake.StaticResponse(response), **kwargs
|
266
|
+
)
|
@@ -285,6 +285,49 @@ class QueryTest(unittest.TestCase):
|
|
285
285
|
with self.assertRaisesRegex(ValueError, 'Unknown protocol'):
|
286
286
|
prompting.query('what is 1 + 1', int, protocol='text')
|
287
287
|
|
288
|
+
def test_query_prompt(self):
|
289
|
+
self.assertEqual(
|
290
|
+
prompting.query_prompt('what is this?', int),
|
291
|
+
inspect.cleandoc("""
|
292
|
+
Please respond to the last INPUT_OBJECT with OUTPUT_OBJECT according to OUTPUT_TYPE.
|
293
|
+
|
294
|
+
INPUT_OBJECT:
|
295
|
+
1 + 1 =
|
296
|
+
|
297
|
+
OUTPUT_TYPE:
|
298
|
+
Answer
|
299
|
+
|
300
|
+
```python
|
301
|
+
class Answer:
|
302
|
+
final_answer: int
|
303
|
+
```
|
304
|
+
|
305
|
+
OUTPUT_OBJECT:
|
306
|
+
```python
|
307
|
+
Answer(
|
308
|
+
final_answer=2
|
309
|
+
)
|
310
|
+
```
|
311
|
+
|
312
|
+
INPUT_OBJECT:
|
313
|
+
what is this?
|
314
|
+
|
315
|
+
OUTPUT_TYPE:
|
316
|
+
int
|
317
|
+
|
318
|
+
OUTPUT_OBJECT:
|
319
|
+
"""),
|
320
|
+
)
|
321
|
+
|
322
|
+
def test_query_output(self):
|
323
|
+
self.assertEqual(
|
324
|
+
prompting.query_output(
|
325
|
+
lf.AIMessage('1'),
|
326
|
+
int,
|
327
|
+
),
|
328
|
+
1,
|
329
|
+
)
|
330
|
+
|
288
331
|
|
289
332
|
class QueryStructurePythonTest(unittest.TestCase):
|
290
333
|
|
@@ -301,6 +301,7 @@ class SchemaPythonRepr(SchemaRepr):
|
|
301
301
|
schema: Schema,
|
302
302
|
*,
|
303
303
|
include_result_definition: bool = True,
|
304
|
+
include_methods: bool = False,
|
304
305
|
markdown: bool = True,
|
305
306
|
**kwargs,
|
306
307
|
) -> str:
|
@@ -308,7 +309,7 @@ class SchemaPythonRepr(SchemaRepr):
|
|
308
309
|
if include_result_definition:
|
309
310
|
ret += self.result_definition(schema)
|
310
311
|
class_definition_str = self.class_definitions(
|
311
|
-
schema, markdown=markdown, **kwargs
|
312
|
+
schema, markdown=markdown, include_methods=include_methods, **kwargs
|
312
313
|
)
|
313
314
|
if class_definition_str:
|
314
315
|
ret += f'\n\n{class_definition_str}'
|
@@ -331,6 +332,7 @@ def class_definitions(
|
|
331
332
|
classes: Sequence[Type[Any]],
|
332
333
|
*,
|
333
334
|
include_pg_object_as_base: bool = False,
|
335
|
+
include_methods: bool = False,
|
334
336
|
strict: bool = False,
|
335
337
|
markdown: bool = False,
|
336
338
|
) -> str | None:
|
@@ -346,6 +348,7 @@ def class_definitions(
|
|
346
348
|
cls,
|
347
349
|
strict=strict,
|
348
350
|
include_pg_object_as_base=include_pg_object_as_base,
|
351
|
+
include_methods=include_methods,
|
349
352
|
)
|
350
353
|
)
|
351
354
|
ret = def_str.getvalue()
|
@@ -355,7 +358,10 @@ def class_definitions(
|
|
355
358
|
|
356
359
|
|
357
360
|
def class_definition(
|
358
|
-
cls,
|
361
|
+
cls,
|
362
|
+
strict: bool = False,
|
363
|
+
include_pg_object_as_base: bool = False,
|
364
|
+
include_methods: bool = False,
|
359
365
|
) -> str:
|
360
366
|
"""Returns the Python class definition."""
|
361
367
|
out = io.StringIO()
|
@@ -383,6 +389,7 @@ def class_definition(
|
|
383
389
|
out.write('\n')
|
384
390
|
out.write(' """\n')
|
385
391
|
|
392
|
+
empty_class = True
|
386
393
|
if schema.fields:
|
387
394
|
for key, field in schema.items():
|
388
395
|
if not isinstance(key, pg.typing.ConstStrKey):
|
@@ -401,11 +408,33 @@ def class_definition(
|
|
401
408
|
out.write('\n')
|
402
409
|
out.write(f' {field.key}: {annotation(field.value, strict=strict)}')
|
403
410
|
out.write('\n')
|
404
|
-
|
411
|
+
empty_class = False
|
412
|
+
|
413
|
+
if include_methods:
|
414
|
+
for method in _iter_newly_defined_methods(cls):
|
415
|
+
out.write('\n')
|
416
|
+
out.write(
|
417
|
+
textwrap.indent(
|
418
|
+
inspect.cleandoc('\n' + inspect.getsource(method)), ' ' * 2)
|
419
|
+
)
|
420
|
+
out.write('\n')
|
421
|
+
empty_class = False
|
422
|
+
|
423
|
+
if empty_class:
|
405
424
|
out.write(' pass\n')
|
406
425
|
return out.getvalue()
|
407
426
|
|
408
427
|
|
428
|
+
def _iter_newly_defined_methods(cls):
|
429
|
+
names = set(dir(cls))
|
430
|
+
for base in cls.__bases__:
|
431
|
+
names -= set(dir(base))
|
432
|
+
for name in names:
|
433
|
+
attr = getattr(cls, name)
|
434
|
+
if callable(attr):
|
435
|
+
yield attr
|
436
|
+
|
437
|
+
|
409
438
|
def annotation(
|
410
439
|
vs: pg.typing.ValueSpec,
|
411
440
|
annotate_optional: bool = True,
|
@@ -493,7 +522,8 @@ def annotation(
|
|
493
522
|
class SchemaJsonRepr(SchemaRepr):
|
494
523
|
"""JSON-representation for a schema."""
|
495
524
|
|
496
|
-
def repr(self, schema: Schema) -> str:
|
525
|
+
def repr(self, schema: Schema, **kwargs) -> str:
|
526
|
+
del kwargs
|
497
527
|
out = io.StringIO()
|
498
528
|
def _visit(node: Any) -> None:
|
499
529
|
if isinstance(node, str):
|
@@ -461,6 +461,23 @@ class SchemaPythonReprTest(unittest.TestCase):
|
|
461
461
|
|
462
462
|
self.assertEqual(schema_lib.class_definition(C), 'class C:\n x: str\n')
|
463
463
|
|
464
|
+
class D(pg.Object):
|
465
|
+
x: str
|
466
|
+
def __call__(self, y: int) -> int:
|
467
|
+
return len(self.x) + y
|
468
|
+
|
469
|
+
self.assertEqual(
|
470
|
+
schema_lib.class_definition(D, include_methods=True),
|
471
|
+
inspect.cleandoc(
|
472
|
+
"""
|
473
|
+
class D:
|
474
|
+
x: str
|
475
|
+
|
476
|
+
def __call__(self, y: int) -> int:
|
477
|
+
return len(self.x) + y
|
478
|
+
""") + '\n'
|
479
|
+
)
|
480
|
+
|
464
481
|
def test_repr(self):
|
465
482
|
class Foo(pg.Object):
|
466
483
|
x: int
|
@@ -477,13 +494,21 @@ class SchemaPythonReprTest(unittest.TestCase):
|
|
477
494
|
class A(pg.Object):
|
478
495
|
foo: Foo
|
479
496
|
|
497
|
+
def foo_value(self) -> int:
|
498
|
+
return self.foo.x
|
499
|
+
|
480
500
|
class B(A):
|
481
501
|
bar: Bar
|
482
502
|
foo2: Foo
|
483
503
|
|
504
|
+
def bar_value(self) -> str:
|
505
|
+
return self.bar.y
|
506
|
+
|
484
507
|
schema = schema_lib.Schema([B])
|
485
508
|
self.assertEqual(
|
486
|
-
schema_lib.SchemaPythonRepr().class_definitions(
|
509
|
+
schema_lib.SchemaPythonRepr().class_definitions(
|
510
|
+
schema, include_methods=True
|
511
|
+
),
|
487
512
|
inspect.cleandoc('''
|
488
513
|
class Foo:
|
489
514
|
x: int
|
@@ -491,6 +516,9 @@ class SchemaPythonReprTest(unittest.TestCase):
|
|
491
516
|
class A:
|
492
517
|
foo: Foo
|
493
518
|
|
519
|
+
def foo_value(self) -> int:
|
520
|
+
return self.foo.x
|
521
|
+
|
494
522
|
class Bar:
|
495
523
|
"""Class Bar."""
|
496
524
|
y: str
|
@@ -503,6 +531,9 @@ class SchemaPythonReprTest(unittest.TestCase):
|
|
503
531
|
foo: Foo
|
504
532
|
bar: Bar
|
505
533
|
foo2: Foo
|
534
|
+
|
535
|
+
def bar_value(self) -> str:
|
536
|
+
return self.bar.y
|
506
537
|
''') + '\n',
|
507
538
|
)
|
508
539
|
|
@@ -32,8 +32,9 @@ def score(
|
|
32
32
|
lm: lf.LanguageModel | None = None,
|
33
33
|
examples: list[mapping.MappingExample] | None = None,
|
34
34
|
protocol: schema_lib.SchemaProtocol = 'python',
|
35
|
+
return_scoring_results: bool = False,
|
35
36
|
**kwargs,
|
36
|
-
) -> list[float]:
|
37
|
+
) -> list[float] | list[lf.LMScoringResult]:
|
37
38
|
"""Scores the outputs based on the prompt."""
|
38
39
|
if not completions:
|
39
40
|
raise ValueError('`completions` must not be empty.')
|
@@ -72,4 +73,6 @@ def score(
|
|
72
73
|
for c in completions
|
73
74
|
],
|
74
75
|
)
|
76
|
+
if return_scoring_results:
|
77
|
+
return results
|
75
78
|
return [r.score for r in results]
|
@@ -35,6 +35,12 @@ class ScoringTest(unittest.TestCase):
|
|
35
35
|
def test_score(self):
|
36
36
|
self.assertEqual(scoring.score('hi', [1, 2], lm=fake.Echo()), [0.0, -1.0])
|
37
37
|
|
38
|
+
def test_score_returning_scoring_results(self):
|
39
|
+
self.assertEqual(scoring.score(
|
40
|
+
'hi', [1, 2], lm=fake.Echo(), return_scoring_results=True),
|
41
|
+
[lf.LMScoringResult(score=0.0, gradients=None),
|
42
|
+
lf.LMScoringResult(score=-1.0, gradients=None)])
|
43
|
+
|
38
44
|
def test_scope_with_lm_from_the_context(self):
|
39
45
|
with lf.context(lm=fake.Echo()):
|
40
46
|
self.assertEqual(scoring.score('hi', [1, 2]), [0.0, -1.0])
|
langfun/core/template.py
CHANGED
@@ -17,7 +17,7 @@ import contextlib
|
|
17
17
|
import dataclasses
|
18
18
|
import functools
|
19
19
|
import inspect
|
20
|
-
from typing import Annotated, Any, Callable, Iterator, Set, Tuple, Type
|
20
|
+
from typing import Annotated, Any, Callable, Iterator, Set, Tuple, Type, Union
|
21
21
|
|
22
22
|
import jinja2
|
23
23
|
from jinja2 import meta as jinja2_meta
|
@@ -495,6 +495,27 @@ class Template(
|
|
495
495
|
t.sym_setparent(self)
|
496
496
|
return t
|
497
497
|
|
498
|
+
@classmethod
|
499
|
+
def from_value(
|
500
|
+
cls,
|
501
|
+
value: Union[str, message_lib.Message, 'Template'],
|
502
|
+
**kwargs
|
503
|
+
) -> 'Template':
|
504
|
+
"""Create a template object from a string or template."""
|
505
|
+
if isinstance(value, cls):
|
506
|
+
return value.clone(override=kwargs) if kwargs else value # pylint: disable=no-value-for-parameter
|
507
|
+
if isinstance(value, str):
|
508
|
+
return cls(template_str=value, **kwargs)
|
509
|
+
if isinstance(value, message_lib.Message):
|
510
|
+
kwargs.update(value.metadata)
|
511
|
+
return cls(template_str=value.text, **kwargs)
|
512
|
+
if isinstance(value, Template):
|
513
|
+
lfun = cls(template_str=value.template_str, **kwargs)
|
514
|
+
# So lfun could acccess all attributes from value.
|
515
|
+
lfun.sym_setparent(value)
|
516
|
+
return lfun
|
517
|
+
return cls(template_str='{{input}}', input=value, **kwargs)
|
518
|
+
|
498
519
|
|
499
520
|
# Register converter from str to LangFunc, therefore we can always
|
500
521
|
# pass strs to attributes that accept LangFunc.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: langfun
|
3
|
-
Version: 0.0.2.
|
3
|
+
Version: 0.0.2.dev20240511
|
4
4
|
Summary: Langfun: Language as Functions.
|
5
5
|
Home-page: https://github.com/google/langfun
|
6
6
|
Author: Langfun Authors
|
@@ -21,7 +21,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries
|
22
22
|
Description-Content-Type: text/markdown
|
23
23
|
License-File: LICENSE
|
24
|
-
Requires-Dist:
|
24
|
+
Requires-Dist: google-cloud-aiplatform >=1.5.0
|
25
25
|
Requires-Dist: google-generativeai >=0.3.2
|
26
26
|
Requires-Dist: jinja2 >=3.1.2
|
27
27
|
Requires-Dist: openai ==0.27.2
|
@@ -1,4 +1,4 @@
|
|
1
|
-
langfun/__init__.py,sha256=
|
1
|
+
langfun/__init__.py,sha256=YAbi2FfTfKT41KJAx1tSNoiole_YRJmcEk3oOoqFqOs,2128
|
2
2
|
langfun/core/__init__.py,sha256=6QEuXOZ9BXxm6TjpaMXuLwUBTYO3pkFDqn9QVBXyyPQ,4248
|
3
3
|
langfun/core/component.py,sha256=oxesbC0BoE_TbtxwW5x-BAZWxZyyJbuPiX5S38RqCv0,9909
|
4
4
|
langfun/core/component_test.py,sha256=uR-_Sz_42Jxc5qzLIB-f5_pXmNwnC01Xlbv5NOQSeSU,8021
|
@@ -6,9 +6,9 @@ langfun/core/concurrent.py,sha256=TRc49pJ3HQro2kb5FtcWkHjhBm8UcgE8RJybU5cU3-0,24
|
|
6
6
|
langfun/core/concurrent_test.py,sha256=mwFMZhDUdppnDr7vDSTwcbMHwrdsIoKJwRYNtl4ZWL4,15185
|
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=RvIcRjIq0jWYRu1xim-FYe4HSrt97r3GMBO_PuagUmw,11060
|
10
|
+
langfun/core/langfunc_test.py,sha256=_mfARnakX3oji5HDigFSLMd6yQ2wma-2Mgbztwqn73g,8501
|
11
|
+
langfun/core/language_model.py,sha256=6wtY8RGbOymfo1PYzcYCfOlWuKQcSVFs5R1sFB4-QMQ,20202
|
12
12
|
langfun/core/language_model_test.py,sha256=T-itu7Li2smv2dkru0C0neCs2W4VJXlNTYahXU6jF54,19548
|
13
13
|
langfun/core/memory.py,sha256=f-asN1F7Vehgdn_fK84v73GrEUOxRtaW934keutTKjk,2416
|
14
14
|
langfun/core/message.py,sha256=QhvV9t5qaryPcruyxxcXi3gm9QDInkSldwTtK6sVJ3c,15734
|
@@ -21,7 +21,7 @@ langfun/core/sampling.py,sha256=vygWvgC8MFw0_AKNSmz-ywMXJYWf8cl0tI8QycvAmyI,5795
|
|
21
21
|
langfun/core/sampling_test.py,sha256=U7PANpMsl9E_pa4_Y4FzesSjcwg-u-LKHGCWSgv-8FY,3663
|
22
22
|
langfun/core/subscription.py,sha256=euawEuSZP-BHydaT-AQpfYFL0m5pWPGcW0upFhrojqc,10930
|
23
23
|
langfun/core/subscription_test.py,sha256=Y4ZdbZEwm83YNZBxHff0QR4QUa4rdaNXA3_jfIcArBo,8717
|
24
|
-
langfun/core/template.py,sha256=
|
24
|
+
langfun/core/template.py,sha256=UhNNGUDJ4StUhPBKzHmjym36khxHOGWGr9MDxBwgxQA,22284
|
25
25
|
langfun/core/template_test.py,sha256=Mbv0dFjboGCVvbDkHD-HacZnlCi8Ku2Hpf2UjdwGSNo,15464
|
26
26
|
langfun/core/text_formatting.py,sha256=ytjj7opnRJ6w-pkglL2CZUyfYDXLpNf65E42LBb31gc,5158
|
27
27
|
langfun/core/text_formatting_test.py,sha256=nyKC6tn2L4hPJiqQHgxcbQsJJi4A4Nbj8FiO8iT6B80,1514
|
@@ -39,26 +39,30 @@ langfun/core/coding/python/parsing.py,sha256=uyvI1c5OLZhMVK2Oltkl3oJxSLlG0wadlpQ
|
|
39
39
|
langfun/core/coding/python/parsing_test.py,sha256=9vAWF484kWIm6JZq8NFiMgKUDhXV-deRl1QMmNERfAA,7386
|
40
40
|
langfun/core/coding/python/permissions.py,sha256=1QWGHvzL8MM0Ok_auQ9tURqZHtdOfJaDpBzZ29GUE-c,2544
|
41
41
|
langfun/core/coding/python/permissions_test.py,sha256=w5EDb8QxpxgJyZkojyzVWQvDfg366zn99-g__6TbPQ0,2699
|
42
|
-
langfun/core/eval/__init__.py,sha256=
|
43
|
-
langfun/core/eval/base.py,sha256=
|
44
|
-
langfun/core/eval/base_test.py,sha256=
|
45
|
-
langfun/core/eval/matching.py,sha256=
|
46
|
-
langfun/core/eval/matching_test.py,sha256=
|
47
|
-
langfun/core/eval/
|
48
|
-
langfun/core/eval/
|
49
|
-
langfun/core/
|
42
|
+
langfun/core/eval/__init__.py,sha256=Evt-E4FEhZF2tXL6-byh_AyA7Cc_ZoGmvnN7vkAZedk,1898
|
43
|
+
langfun/core/eval/base.py,sha256=zcMPBKmcll5O08waEEnvmkEoXgcINhOat9rRJk8X8b4,74268
|
44
|
+
langfun/core/eval/base_test.py,sha256=cHOTIWVW4Dp8gKKIKcZrAcJ-w84j2GIozTzJoiAX7p4,26743
|
45
|
+
langfun/core/eval/matching.py,sha256=Y4vFoNTQEOwko6IA8l9OZ52-vt52e3VGmcTtvLA67wM,9782
|
46
|
+
langfun/core/eval/matching_test.py,sha256=f7iVyXH5KGJBWt4Wp14Bt9J3X59A6Ayfog9MbuFvPew,5532
|
47
|
+
langfun/core/eval/patching.py,sha256=R0s2eAd1m97exQt06dmUL0V_MBG0W2Hxg7fhNB7cXW0,3866
|
48
|
+
langfun/core/eval/patching_test.py,sha256=8kCd54Egjju22FMgtJuxEsrXkW8ifs-UUBHtrCG1L6w,4775
|
49
|
+
langfun/core/eval/scoring.py,sha256=1J7IATo-8FXUR0SBqk9icztHiM0lWkBFcWUo-vUURgQ,6376
|
50
|
+
langfun/core/eval/scoring_test.py,sha256=O8olHbrUEg60gMxwOkWzKBJZpZoUlmVnBANX5Se2SXM,4546
|
51
|
+
langfun/core/llms/__init__.py,sha256=C-NrcgFqf3_EP_dN8oADdckQ-rfPKZhsjeSf86kJpLk,3642
|
50
52
|
langfun/core/llms/anthropic.py,sha256=7W9YdPN3SlAFhAIQlihMkrpo7tTY_4NvD0KIlCrqcsk,8505
|
51
53
|
langfun/core/llms/anthropic_test.py,sha256=TMM30myyEhwF99Le4RvJEXOn8RYl0q1FRkt9Q9nl1jk,5540
|
52
|
-
langfun/core/llms/fake.py,sha256=
|
54
|
+
langfun/core/llms/fake.py,sha256=_smsN_CsYbeWrtjpegEPwdAPV9mwaIuH_4oZGeXQwQI,2896
|
53
55
|
langfun/core/llms/fake_test.py,sha256=ipKfdOcuqVcJ8lDXVpnBVb9HHG0hAVkFkMoHpWjC2cI,7212
|
54
|
-
langfun/core/llms/google_genai.py,sha256=
|
56
|
+
langfun/core/llms/google_genai.py,sha256=nDI_Adur_K458l6EWoiiAhzjfnjRSqfTiikdu7iLPyU,8808
|
55
57
|
langfun/core/llms/google_genai_test.py,sha256=_UcGTfl16-aDUlEWFC2W2F8y9jPUs53RBYA6MOCpGXw,7525
|
56
58
|
langfun/core/llms/groq.py,sha256=NaGItVL_pkOpqPpI4bPGU27xLFRoaeizZ49v2s-4ERs,7844
|
57
59
|
langfun/core/llms/groq_test.py,sha256=M6GtlrsOvDun_j-sR8cPh4W_moHWZNSTiThu3kuwbbc,5281
|
58
60
|
langfun/core/llms/llama_cpp.py,sha256=Y_KkMUf3Xfac49koMUtUslKl3h-HWp3-ntq7Jaa3bdo,2385
|
59
61
|
langfun/core/llms/llama_cpp_test.py,sha256=ZxC6defGd_HX9SFRU9U4cJiQnBKundbOrchbXuC1Z2M,1683
|
60
|
-
langfun/core/llms/openai.py,sha256=
|
61
|
-
langfun/core/llms/openai_test.py,sha256=
|
62
|
+
langfun/core/llms/openai.py,sha256=u2lqYcKFjFxLfWYD0KLT3YThqcoo66rWs3n0bcuSYBs,13286
|
63
|
+
langfun/core/llms/openai_test.py,sha256=asSA1sVy_7hnXioD_2HTxtSDpVTKBUO_EjZuyHpwbn0,14854
|
64
|
+
langfun/core/llms/vertexai.py,sha256=O2Lp-F4KJzvQSCjPV--sa6nMS9-GsLj2eiqA-1qGhWQ,9661
|
65
|
+
langfun/core/llms/vertexai_test.py,sha256=LBk4luL_N13ZejZebBzQ3tkfjxFhk7uBS4JjEpojJAo,7836
|
62
66
|
langfun/core/llms/cache/__init__.py,sha256=QAo3InUMDM_YpteNnVCSejI4zOsnjSMWKJKzkb3VY64,993
|
63
67
|
langfun/core/llms/cache/base.py,sha256=cFfYvOIUae842pncqCAsRvqXCk2AnAsRYVx0mcIoAeY,3338
|
64
68
|
langfun/core/llms/cache/in_memory.py,sha256=YfFyJEhLs73cUiB0ZfhMxYpdE8Iuxxw-dvMFwGHTSHw,4742
|
@@ -67,31 +71,31 @@ langfun/core/memories/__init__.py,sha256=HpghfZ-w1NQqzJXBx8Lz0daRhB2rcy2r9Xm491S
|
|
67
71
|
langfun/core/memories/conversation_history.py,sha256=c9amD8hCxGFiZuVAzkP0dOMWSp8L90uvwkOejjuBqO0,1835
|
68
72
|
langfun/core/memories/conversation_history_test.py,sha256=AaW8aNoFjxNusanwJDV0r3384Mg0eAweGmPx5DIkM0Y,2052
|
69
73
|
langfun/core/modalities/__init__.py,sha256=ldCbs1HHAHAJECNu19vppA0sWEidI40xBs4W1F_YOlo,1073
|
70
|
-
langfun/core/modalities/image.py,sha256=
|
74
|
+
langfun/core/modalities/image.py,sha256=MUqRCQYyP7Gcf3dmzjU9J9ZEpfI08gAli9ZDmk0bJEk,1254
|
71
75
|
langfun/core/modalities/image_test.py,sha256=YxDRvC49Bjwyyndd_P7y6XjyS7dOft0Zewwxk-7q4kE,2301
|
72
|
-
langfun/core/modalities/mime.py,sha256=
|
76
|
+
langfun/core/modalities/mime.py,sha256=RatBOPqYEneYMe-lfgRxJp5T3yvgV6vBMNY8lK2WU8k,2421
|
73
77
|
langfun/core/modalities/mime_test.py,sha256=cVHxRvJ1QXC1SVhBmWkJdWGpL9Xl0UNfTQq6j0OGGL4,1881
|
74
|
-
langfun/core/modalities/video.py,sha256=
|
78
|
+
langfun/core/modalities/video.py,sha256=bzJLeBDF6FIVHyrAvRqYcQq2pCLBqN-UIgX_f3lM3E0,1654
|
75
79
|
langfun/core/modalities/video_test.py,sha256=jYuI2m8S8zDCAVBPEUbbpP205dXAht90A2_PHWo4-r8,2039
|
76
|
-
langfun/core/structured/__init__.py,sha256=
|
80
|
+
langfun/core/structured/__init__.py,sha256=Qg1ocwsb60od8fJky3F3JAOhwjwT9WA7IX3C2j2s3zA,3707
|
77
81
|
langfun/core/structured/completion.py,sha256=skBxt6V_fv2TBUKnzFgnPMbVY8HSYn8sY04MLok2yvs,7299
|
78
82
|
langfun/core/structured/completion_test.py,sha256=MYxEzeScC3gFVujvrMMboBF5nh-QiVLwGgqAV3oaFUQ,19273
|
79
83
|
langfun/core/structured/description.py,sha256=SXW4MJvshFjbR-0gw6rE21o6WXq12UlRXawvDBXMZFA,5211
|
80
84
|
langfun/core/structured/description_test.py,sha256=UtZGjSFUaQ6130t1E5tcL7ODu0xIefkapb53TbnqsK8,7362
|
81
85
|
langfun/core/structured/function_generation.py,sha256=pFgS3vcRAWiuFBol2x5Eeip3XqoudONsOpeJpWyjT3s,7479
|
82
86
|
langfun/core/structured/function_generation_test.py,sha256=ZJI-aaGgWWszn92u7h5IZ9Pl70N2DgAGGJrIxPzsvwg,10065
|
83
|
-
langfun/core/structured/mapping.py,sha256=
|
87
|
+
langfun/core/structured/mapping.py,sha256=V2EI53KwhXxqcoH2ouhuei8aYWny0ml_FwMTiS7Zr9M,12253
|
84
88
|
langfun/core/structured/mapping_test.py,sha256=PiXklMeIa8L6KtMi3ju7J9Y39gZy0hIGz-Oeq4A_7XE,3835
|
85
89
|
langfun/core/structured/parsing.py,sha256=keoVqEfzAbdULh6GawWFsTQzU91MzJXYFZjXGXLaD8g,11492
|
86
90
|
langfun/core/structured/parsing_test.py,sha256=34wDrXaQ-EYhJLfDL8mX9K53oQMSzh5pVYdKjnESmK8,20895
|
87
|
-
langfun/core/structured/prompting.py,sha256=
|
88
|
-
langfun/core/structured/prompting_test.py,sha256=
|
89
|
-
langfun/core/structured/schema.py,sha256=
|
91
|
+
langfun/core/structured/prompting.py,sha256=cswl9c93edsYnXsZQmMzPpmqOuKnBzbgebTYBbSxwzo,8815
|
92
|
+
langfun/core/structured/prompting_test.py,sha256=rddf5qHN8Gm_JaNMmytwiVEBm-eZVJFLQO4GljUgR44,21700
|
93
|
+
langfun/core/structured/schema.py,sha256=Zy9y6Vq9DrFwcuP5o5VL_PvMCmzavF-nuDqyviBnaxk,25818
|
90
94
|
langfun/core/structured/schema_generation.py,sha256=U3nRQsqmMZg_qIVDh2fiY3K4JLfsAL1LcKzIFP1iXFg,5316
|
91
95
|
langfun/core/structured/schema_generation_test.py,sha256=RM9s71kMNg2jTePwInkiW9fK1ACN37eyPeF8OII-0zw,2950
|
92
|
-
langfun/core/structured/schema_test.py,sha256=
|
93
|
-
langfun/core/structured/scoring.py,sha256=
|
94
|
-
langfun/core/structured/scoring_test.py,sha256=
|
96
|
+
langfun/core/structured/schema_test.py,sha256=NgQK1zGSliZVx_Af6gDBTqQxXRHvmAvGARv4dUs8IbI,23078
|
97
|
+
langfun/core/structured/scoring.py,sha256=5DsMNrWKf98ZYCEkxA4-HvA62nMSNBs9DC5m8dYL7Cs,2442
|
98
|
+
langfun/core/structured/scoring_test.py,sha256=39_dw6p_FkoqeUccO67yIqos-MccAWezoozS21i8mi0,1732
|
95
99
|
langfun/core/templates/__init__.py,sha256=bO0eMsVJbi7sxEB2YlInKRQ2EVP-RyyKUwcD-8msuN4,927
|
96
100
|
langfun/core/templates/completion.py,sha256=mUqZHOEV3ag6-A08XghpeEltcrBvCDxXP004eDDfeag,1931
|
97
101
|
langfun/core/templates/completion_test.py,sha256=vGnjnM38UHyVDUyaUYtmp20s9KBGOdbPVsX-H-ET11E,1636
|
@@ -101,8 +105,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
101
105
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
102
106
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
103
107
|
langfun/core/templates/selfplay_test.py,sha256=DYVrkk7uNKCqJGEHH31HssU2BPuMItU1vJLzfcXIlYg,2156
|
104
|
-
langfun-0.0.2.
|
105
|
-
langfun-0.0.2.
|
106
|
-
langfun-0.0.2.
|
107
|
-
langfun-0.0.2.
|
108
|
-
langfun-0.0.2.
|
108
|
+
langfun-0.0.2.dev20240511.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
109
|
+
langfun-0.0.2.dev20240511.dist-info/METADATA,sha256=hewa_t_bln4aeirKRZHR1bUwBtvavOv7jNbNU2JUAZ8,3452
|
110
|
+
langfun-0.0.2.dev20240511.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
111
|
+
langfun-0.0.2.dev20240511.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
112
|
+
langfun-0.0.2.dev20240511.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|