langfun 0.1.2.dev202503100804__py3-none-any.whl → 0.1.2.dev202503120804__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/structured/querying.py +8 -1
- langfun/core/structured/querying_test.py +2 -0
- {langfun-0.1.2.dev202503100804.dist-info → langfun-0.1.2.dev202503120804.dist-info}/METADATA +1 -1
- {langfun-0.1.2.dev202503100804.dist-info → langfun-0.1.2.dev202503120804.dist-info}/RECORD +7 -7
- {langfun-0.1.2.dev202503100804.dist-info → langfun-0.1.2.dev202503120804.dist-info}/LICENSE +0 -0
- {langfun-0.1.2.dev202503100804.dist-info → langfun-0.1.2.dev202503120804.dist-info}/WHEEL +0 -0
- {langfun-0.1.2.dev202503100804.dist-info → langfun-0.1.2.dev202503120804.dist-info}/top_level.txt +0 -0
@@ -391,6 +391,13 @@ def query(
|
|
391
391
|
if pg.MISSING_VALUE != prompt and not skip_lm:
|
392
392
|
trackers = lf.context_value('__query_trackers__', [])
|
393
393
|
if trackers:
|
394
|
+
# To minimize payload for serialization, we remove the result and usage
|
395
|
+
# fields from the metadata. They will be computed on the fly when the
|
396
|
+
# invocation is rendered.
|
397
|
+
metadata = dict(output_message.metadata)
|
398
|
+
metadata.pop('result', None)
|
399
|
+
metadata.pop('usage', None)
|
400
|
+
|
394
401
|
invocation = QueryInvocation(
|
395
402
|
input=pg.Ref(query_input),
|
396
403
|
schema=(
|
@@ -399,7 +406,7 @@ def query(
|
|
399
406
|
),
|
400
407
|
lm=pg.Ref(lm),
|
401
408
|
examples=pg.Ref(examples) if examples else [],
|
402
|
-
lm_response=lf.AIMessage(output_message.text),
|
409
|
+
lm_response=lf.AIMessage(output_message.text, metadata=metadata),
|
403
410
|
usage_summary=usage_summary,
|
404
411
|
start_time=start_time,
|
405
412
|
end_time=end_time,
|
@@ -1069,6 +1069,8 @@ class QueryInvocationTest(unittest.TestCase):
|
|
1069
1069
|
querying.query('foo', Activity, lm=lm)
|
1070
1070
|
|
1071
1071
|
self.assertIn('schema', queries[0].to_html_str())
|
1072
|
+
self.assertEqual(queries[0].lm_response.score, 1.0)
|
1073
|
+
self.assertFalse(queries[0].lm_response.is_cached)
|
1072
1074
|
|
1073
1075
|
|
1074
1076
|
class TrackQueriesTest(unittest.TestCase):
|
@@ -131,8 +131,8 @@ langfun/core/structured/mapping.py,sha256=of-EeBq0RgmkiUaSk2rVEDVCzgn_wXU8tRke7N
|
|
131
131
|
langfun/core/structured/mapping_test.py,sha256=OntYvfDitAf0tAnzQty3YS90vyEn6FY1Mi93r_ViEk8,9594
|
132
132
|
langfun/core/structured/parsing.py,sha256=MGvI7ypXlwfzr5XB8_TFU9Ei0_5reYqkWkv64eAy0EA,12015
|
133
133
|
langfun/core/structured/parsing_test.py,sha256=kNPrhpdPY3iWhUld0TFYU-Zgn44wC0d6YuQ9XdVbQ8o,22346
|
134
|
-
langfun/core/structured/querying.py,sha256=
|
135
|
-
langfun/core/structured/querying_test.py,sha256=
|
134
|
+
langfun/core/structured/querying.py,sha256=Uvg64HOCzi5J-Uk3TNpkCgtKe6I02mThwjGbnRY6M7U,23420
|
135
|
+
langfun/core/structured/querying_test.py,sha256=H6LUgxaPOHqf37DCQ_PKpXUqgMc4aN211S34xpE-KcQ,32491
|
136
136
|
langfun/core/structured/schema.py,sha256=_iqhHEGDQsHk0AsybWnK44sOspTWkKJjci781PWD7x0,27988
|
137
137
|
langfun/core/structured/schema_generation.py,sha256=3AcuKvv3VOtKY5zMVqODrxfOuDxzoZtGeBxHlOWDOWw,5308
|
138
138
|
langfun/core/structured/schema_generation_test.py,sha256=RM9s71kMNg2jTePwInkiW9fK1ACN37eyPeF8OII-0zw,2950
|
@@ -150,8 +150,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
150
150
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
151
151
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
152
152
|
langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
|
153
|
-
langfun-0.1.2.
|
154
|
-
langfun-0.1.2.
|
155
|
-
langfun-0.1.2.
|
156
|
-
langfun-0.1.2.
|
157
|
-
langfun-0.1.2.
|
153
|
+
langfun-0.1.2.dev202503120804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
154
|
+
langfun-0.1.2.dev202503120804.dist-info/METADATA,sha256=D_zNAloQ7RttJGmcK0gXgD3eg6DFmY3OlPdqmhS60X0,8172
|
155
|
+
langfun-0.1.2.dev202503120804.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
156
|
+
langfun-0.1.2.dev202503120804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
157
|
+
langfun-0.1.2.dev202503120804.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{langfun-0.1.2.dev202503100804.dist-info → langfun-0.1.2.dev202503120804.dist-info}/top_level.txt
RENAMED
File without changes
|