langfun 0.1.2.dev202502090804__py3-none-any.whl → 0.1.2.dev202502110804__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/llms/gemini.py +6 -6
- langfun/core/structured/querying.py +1 -1
- langfun/core/structured/querying_test.py +8 -1
- {langfun-0.1.2.dev202502090804.dist-info → langfun-0.1.2.dev202502110804.dist-info}/METADATA +1 -1
- {langfun-0.1.2.dev202502090804.dist-info → langfun-0.1.2.dev202502110804.dist-info}/RECORD +8 -8
- {langfun-0.1.2.dev202502090804.dist-info → langfun-0.1.2.dev202502110804.dist-info}/LICENSE +0 -0
- {langfun-0.1.2.dev202502090804.dist-info → langfun-0.1.2.dev202502110804.dist-info}/WHEEL +0 -0
- {langfun-0.1.2.dev202502090804.dist-info → langfun-0.1.2.dev202502110804.dist-info}/top_level.txt +0 -0
langfun/core/llms/gemini.py
CHANGED
@@ -94,12 +94,12 @@ SUPPORTED_MODELS_AND_SETTINGS = {
|
|
94
94
|
tpm_free=40_000_000,
|
95
95
|
rpm_paid=0,
|
96
96
|
tpm_paid=0,
|
97
|
-
cost_per_1m_input_tokens_up_to_128k=0,
|
98
|
-
cost_per_1m_output_tokens_up_to_128k=0,
|
99
|
-
cost_per_1m_cached_tokens_up_to_128k=0,
|
100
|
-
cost_per_1m_input_tokens_longer_than_128k=0,
|
101
|
-
cost_per_1m_output_tokens_longer_than_128k=0,
|
102
|
-
cost_per_1m_cached_tokens_longer_than_128k=0,
|
97
|
+
cost_per_1m_input_tokens_up_to_128k=0.1,
|
98
|
+
cost_per_1m_output_tokens_up_to_128k=0.4,
|
99
|
+
cost_per_1m_cached_tokens_up_to_128k=0.025,
|
100
|
+
cost_per_1m_input_tokens_longer_than_128k=0.1,
|
101
|
+
cost_per_1m_output_tokens_longer_than_128k=0.4,
|
102
|
+
cost_per_1m_cached_tokens_longer_than_128k=0.025,
|
103
103
|
),
|
104
104
|
'gemini-2.0-flash': pg.Dict(
|
105
105
|
latest_update='2025-02-05',
|
@@ -579,7 +579,7 @@ class QueryInvocation(pg.Object, pg.views.HtmlTreeView.Extension):
|
|
579
579
|
|
580
580
|
@functools.cached_property
|
581
581
|
def lm_request(self) -> lf.Message:
|
582
|
-
return query_prompt(self.input, self.schema)
|
582
|
+
return query_prompt(self.input, self.schema, examples=self.examples or None)
|
583
583
|
|
584
584
|
@functools.cached_property
|
585
585
|
def output(self) -> Any:
|
@@ -1081,9 +1081,12 @@ class TrackQueriesTest(unittest.TestCase):
|
|
1081
1081
|
with querying.track_queries() as queries:
|
1082
1082
|
querying.query('foo', lm=lm)
|
1083
1083
|
with querying.track_queries() as child_queries:
|
1084
|
-
querying.query('give me an activity', Activity, lm=lm
|
1084
|
+
querying.query('give me an activity', Activity, lm=lm, examples=[
|
1085
|
+
mapping.MappingExample(input='2 + 2', schema=int, output=4)
|
1086
|
+
])
|
1085
1087
|
|
1086
1088
|
self.assertEqual(len(queries), 2)
|
1089
|
+
self.assertEqual(queries[0].lm_response, 'bar')
|
1087
1090
|
self.assertTrue(pg.eq(queries[0].input, lf.Template('foo')))
|
1088
1091
|
self.assertIsNone(queries[0].schema)
|
1089
1092
|
self.assertEqual(queries[0].output, 'bar')
|
@@ -1091,7 +1094,11 @@ class TrackQueriesTest(unittest.TestCase):
|
|
1091
1094
|
|
1092
1095
|
self.assertTrue(pg.eq(queries[1].input, lf.Template('give me an activity')))
|
1093
1096
|
self.assertEqual(queries[1].schema.spec.cls, Activity)
|
1097
|
+
self.assertIn('2 + 2', queries[1].lm_request.text)
|
1094
1098
|
self.assertTrue(pg.eq(queries[1].output, Activity(description='hi')))
|
1099
|
+
self.assertTrue(pg.eq(queries[1].examples, [
|
1100
|
+
mapping.MappingExample(input='2 + 2', schema=int, output=4)
|
1101
|
+
]))
|
1095
1102
|
self.assertIs(queries[1].lm, lm)
|
1096
1103
|
self.assertGreater(queries[0].elapse, 0)
|
1097
1104
|
self.assertGreater(queries[0].usage_summary.total.total_tokens, 0)
|
@@ -82,7 +82,7 @@ langfun/core/llms/deepseek.py,sha256=9EbuNrngd5BwpsvsEfkW2XQdq3K23S3-jlI8RbMNZF4
|
|
82
82
|
langfun/core/llms/deepseek_test.py,sha256=dS72i52bwMpCN4dJDvpJI59AnNChpwxS5eYYFrhGh90,1843
|
83
83
|
langfun/core/llms/fake.py,sha256=gCHBYBLvBCsC78HI1hpoqXCS-p1FMTgY1P1qh_sGBPk,3070
|
84
84
|
langfun/core/llms/fake_test.py,sha256=2h13qkwEz_JR0mtUDPxdAhQo7MueXaFSwsD2DIRDW9g,7653
|
85
|
-
langfun/core/llms/gemini.py,sha256=
|
85
|
+
langfun/core/llms/gemini.py,sha256=7qxdj9tDsG68dstkXAcvnqAMYv0tYkLW8bVLjxLNYqk,19752
|
86
86
|
langfun/core/llms/gemini_test.py,sha256=2ERhYWCJwnfDTQbCaZHFuB1TdWJFrOBS7yyCBInIdQk,6129
|
87
87
|
langfun/core/llms/google_genai.py,sha256=WbVZAIDhh7mKy15LZMXOEniQ8Obd-hjiy2KviUCfmXQ,4261
|
88
88
|
langfun/core/llms/google_genai_test.py,sha256=JZf_cbQ4GGGpwiQCLjFJn7V4jxBBqgZhIx91AzbGKVo,1250
|
@@ -129,8 +129,8 @@ langfun/core/structured/mapping.py,sha256=of-EeBq0RgmkiUaSk2rVEDVCzgn_wXU8tRke7N
|
|
129
129
|
langfun/core/structured/mapping_test.py,sha256=OntYvfDitAf0tAnzQty3YS90vyEn6FY1Mi93r_ViEk8,9594
|
130
130
|
langfun/core/structured/parsing.py,sha256=MGvI7ypXlwfzr5XB8_TFU9Ei0_5reYqkWkv64eAy0EA,12015
|
131
131
|
langfun/core/structured/parsing_test.py,sha256=kNPrhpdPY3iWhUld0TFYU-Zgn44wC0d6YuQ9XdVbQ8o,22346
|
132
|
-
langfun/core/structured/querying.py,sha256=
|
133
|
-
langfun/core/structured/querying_test.py,sha256=
|
132
|
+
langfun/core/structured/querying.py,sha256=RgYsiiOu-a-mE87iDVJBrbkrfnCPXvoc6auIA8OrupQ,23098
|
133
|
+
langfun/core/structured/querying_test.py,sha256=1l0032afpSC_ewBNOp17bKK11fHlxlE9A2eJumsz_CE,32380
|
134
134
|
langfun/core/structured/schema.py,sha256=_iqhHEGDQsHk0AsybWnK44sOspTWkKJjci781PWD7x0,27988
|
135
135
|
langfun/core/structured/schema_generation.py,sha256=3AcuKvv3VOtKY5zMVqODrxfOuDxzoZtGeBxHlOWDOWw,5308
|
136
136
|
langfun/core/structured/schema_generation_test.py,sha256=RM9s71kMNg2jTePwInkiW9fK1ACN37eyPeF8OII-0zw,2950
|
@@ -148,8 +148,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
148
148
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
149
149
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
150
150
|
langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
|
151
|
-
langfun-0.1.2.
|
152
|
-
langfun-0.1.2.
|
153
|
-
langfun-0.1.2.
|
154
|
-
langfun-0.1.2.
|
155
|
-
langfun-0.1.2.
|
151
|
+
langfun-0.1.2.dev202502110804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
152
|
+
langfun-0.1.2.dev202502110804.dist-info/METADATA,sha256=vNl3CaNv4v8tHGItFTnZlRgk0hM9cmZBxmO0A8RRdIg,8172
|
153
|
+
langfun-0.1.2.dev202502110804.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
154
|
+
langfun-0.1.2.dev202502110804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
155
|
+
langfun-0.1.2.dev202502110804.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{langfun-0.1.2.dev202502090804.dist-info → langfun-0.1.2.dev202502110804.dist-info}/top_level.txt
RENAMED
File without changes
|