langfun 0.1.2.dev202503180804__py3-none-any.whl → 0.1.2.dev202503190804__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.
@@ -640,7 +640,10 @@ class Gemini(rest.REST):
640
640
  ]
641
641
  usage = json['usageMetadata']
642
642
  input_tokens = usage['promptTokenCount']
643
- output_tokens = usage['candidatesTokenCount']
643
+ # NOTE(daiyip): We saw cases that `candidatesTokenCount` is not present.
644
+ # Therefore, we use 0 as the default value.
645
+ output_tokens = usage.get('candidatesTokenCount', 0)
646
+
644
647
  return lf.LMSamplingResult(
645
648
  [lf.LMSample(message) for message in messages],
646
649
  usage=lf.LMSamplingUsage(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: langfun
3
- Version: 0.1.2.dev202503180804
3
+ Version: 0.1.2.dev202503190804
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -84,7 +84,7 @@ langfun/core/llms/deepseek.py,sha256=jvTxdXPr-vH6HNakn_Ootx1heDg8Fen2FUkUW36bpCs
84
84
  langfun/core/llms/deepseek_test.py,sha256=DvROWPlDuow5E1lfoSkhyGt_ELA19JoQoDsTnRgDtTg,1847
85
85
  langfun/core/llms/fake.py,sha256=xmgCkk9y0I4x0IT32SZ9_OT27aLadXH8PRiYNo5VTd4,3265
86
86
  langfun/core/llms/fake_test.py,sha256=2h13qkwEz_JR0mtUDPxdAhQo7MueXaFSwsD2DIRDW9g,7653
87
- langfun/core/llms/gemini.py,sha256=EJwZZYXrh1ykXsIeq9w_VNdJyCfBnBz3x7_jEx6WvQw,22962
87
+ langfun/core/llms/gemini.py,sha256=msTaDZcPBwZUMIHBXZUshexUJayIr3I7g-7z_uqtpqA,23095
88
88
  langfun/core/llms/gemini_test.py,sha256=ZzQmgB5bxJdtD2nVOz0WQ1zjNCea_jM5Yuqs8kchnGw,6621
89
89
  langfun/core/llms/google_genai.py,sha256=mzUdWAShRzz2k_foUo0eIdNOyHs_xjEtbewqYyuD0k0,4768
90
90
  langfun/core/llms/google_genai_test.py,sha256=NKNtpebArQ9ZR7Qsnhd2prFIpMjleojy6o6VMXkJ1zY,1502
@@ -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.dev202503180804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
152
- langfun-0.1.2.dev202503180804.dist-info/METADATA,sha256=HKzrRzhox38YaSbBcb5HTmUbC58iUGdDJFAlTjzal6k,7670
153
- langfun-0.1.2.dev202503180804.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
154
- langfun-0.1.2.dev202503180804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
155
- langfun-0.1.2.dev202503180804.dist-info/RECORD,,
151
+ langfun-0.1.2.dev202503190804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
152
+ langfun-0.1.2.dev202503190804.dist-info/METADATA,sha256=TuxWfA0ais-zZDUyETYdlj44fWJ27D8A5FjRK63MjBk,7670
153
+ langfun-0.1.2.dev202503190804.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
154
+ langfun-0.1.2.dev202503190804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
155
+ langfun-0.1.2.dev202503190804.dist-info/RECORD,,