langfun 0.1.2.dev202410250804__py3-none-any.whl → 0.1.2.dev202410270804__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/eval/base.py CHANGED
@@ -531,19 +531,14 @@ class Evaluable(lf.Component):
531
531
  self._render_message(self.dryrun_output, s)
532
532
 
533
533
  def _render_message(self, message: lf.Message, s: io.StringIO) -> None:
534
- for m in message.trace():
535
- if 'lm-input' in m.tags:
536
- color = 'green'
537
- elif 'lm-response' in m.tags:
538
- color = 'blue'
539
- else:
540
- continue
541
-
542
- s.write(
543
- f'<div style="color: {color}; border: 1px solid; margin-top: 10px">'
544
- )
545
- s.write(m._repr_html_()) # pylint: disable=protected-access
546
- s.write('</div>')
534
+ s.write(
535
+ message.to_html_str(
536
+ extra_flags=dict(
537
+ include_message_metadata=False,
538
+ source_tag=['lm-input', 'lm-response'],
539
+ )
540
+ )
541
+ )
547
542
 
548
543
  @classmethod
549
544
  def from_dir(
@@ -286,6 +286,8 @@ def call(
286
286
  )
287
287
  # Chain the source of the parsed output to the LM output.
288
288
  parsing_message.root.source = lm_output
289
+ parsing_message.tag('parsing-lm-output')
290
+ parsing_message.lm_input.tag('parsing-lm-input')
289
291
  return parsing_message if returns_message else parsing_message.result
290
292
 
291
293
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langfun
3
- Version: 0.1.2.dev202410250804
3
+ Version: 0.1.2.dev202410270804
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -44,7 +44,7 @@ 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=hCblGSBirslPtthi_iz98boyu46UaOBSQ99STyw7L28,75898
47
+ langfun/core/eval/base.py,sha256=7CPWykFZB4-1a8rMBrE4XNAtRQ9w_O1T3bKeg7ykkw4,75735
48
48
  langfun/core/eval/base_test.py,sha256=gAxamZKvHzT3wVr3xVtXLiwBBi5VFX1I29_QuKSR4Wg,26958
49
49
  langfun/core/eval/matching.py,sha256=UnjdM_ebPqXKJamY4lvL3AYxrMIz3LqkjRTnHJ5xsYc,9349
50
50
  langfun/core/eval/matching_test.py,sha256=QCoYEuf4b_1bkHqUCuRzKMbXHrV3AB2FCOBivo1stC4,5249
@@ -98,7 +98,7 @@ langfun/core/structured/function_generation.py,sha256=pFgS3vcRAWiuFBol2x5Eeip3Xq
98
98
  langfun/core/structured/function_generation_test.py,sha256=ZJI-aaGgWWszn92u7h5IZ9Pl70N2DgAGGJrIxPzsvwg,10065
99
99
  langfun/core/structured/mapping.py,sha256=pMSvxEPqA8h7LsCMKMGG5Fcm0hyaIOTHFcoddQpn4cs,13574
100
100
  langfun/core/structured/mapping_test.py,sha256=bHm2ZCXBITq_G8Lvw_olFHeUUc4s_lGXZm9v9JhoPB4,9630
101
- langfun/core/structured/parsing.py,sha256=zwzXh_E6yp6CzSY-0-tjqjVUiSO8wohNQedpjhDbnoE,11671
101
+ langfun/core/structured/parsing.py,sha256=D58wBWOC6r6DCJNychCDkiHPrsy1XJfBDCDDZtug00k,11765
102
102
  langfun/core/structured/parsing_test.py,sha256=i0i090FVgM8ngGqYjds0hjEm1v7q4gv18k-z1kaNr7E,21467
103
103
  langfun/core/structured/prompting.py,sha256=huwwh01AQQCwPBQESOMI_V1V5PZkVQ8C89Yjk67_4Uw,10677
104
104
  langfun/core/structured/prompting_test.py,sha256=pviyb8yTnxkWPAZodLIlQT8y2ScE6FfSHKWf1NUtV-Y,26718
@@ -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=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
122
- langfun-0.1.2.dev202410250804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
123
- langfun-0.1.2.dev202410250804.dist-info/METADATA,sha256=tYKkpmIIXhUO6f3i6uUr5FfkVYrme8O3WtbNCD6YkqY,8890
124
- langfun-0.1.2.dev202410250804.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
125
- langfun-0.1.2.dev202410250804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
126
- langfun-0.1.2.dev202410250804.dist-info/RECORD,,
122
+ langfun-0.1.2.dev202410270804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
123
+ langfun-0.1.2.dev202410270804.dist-info/METADATA,sha256=P6bilCfUTSSlbJKbHNVnbZcd-9U4Gc1qhlIdt04olfk,8890
124
+ langfun-0.1.2.dev202410270804.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
125
+ langfun-0.1.2.dev202410270804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
126
+ langfun-0.1.2.dev202410270804.dist-info/RECORD,,