langfun 0.1.2.dev202503070804__py3-none-any.whl → 0.1.2.dev202503080803__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.
@@ -65,9 +65,7 @@ SUPPORTED_MODELS = [
65
65
  alias_for='claude-3-5-sonnet-20241022',
66
66
  provider='Anthropic',
67
67
  in_service=True,
68
- description=(
69
- 'Claude 3.5 Sonnet model (latest).'
70
- ),
68
+ description='Claude 3.5 Sonnet model (latest).',
71
69
  input_modalities=(
72
70
  AnthropicModelInfo.INPUT_IMAGE_TYPES
73
71
  + AnthropicModelInfo.INPUT_DOC_TYPES
@@ -118,9 +116,7 @@ SUPPORTED_MODELS = [
118
116
  model_id='claude-3-5-sonnet-20241022',
119
117
  provider='Anthropic',
120
118
  in_service=True,
121
- description=(
122
- 'Claude 3.5 Sonnet model (10/22/2024).'
123
- ),
119
+ description='Claude 3.5 Sonnet model (10/22/2024).',
124
120
  release_date=datetime.datetime(2024, 10, 22),
125
121
  input_modalities=(
126
122
  AnthropicModelInfo.INPUT_IMAGE_TYPES
@@ -147,9 +143,7 @@ SUPPORTED_MODELS = [
147
143
  alias_for='claude-3-5-sonnet-20241022',
148
144
  provider='VertexAI',
149
145
  in_service=True,
150
- description=(
151
- 'Claude 3.5 Sonnet model served on VertexAI (10/22/2024).'
152
- ),
146
+ description='Claude 3.5 Sonnet model served on VertexAI (10/22/2024).',
153
147
  release_date=datetime.datetime(2024, 10, 22),
154
148
  input_modalities=(
155
149
  AnthropicModelInfo.INPUT_IMAGE_TYPES
@@ -183,7 +177,7 @@ SUPPORTED_MODELS = [
183
177
  ),
184
178
  context_length=lf.ModelInfo.ContextLength(
185
179
  max_input_tokens=200_000,
186
- max_output_tokens=128_000,
180
+ max_output_tokens=8_192,
187
181
  ),
188
182
  pricing=lf.ModelInfo.Pricing(
189
183
  cost_per_1m_cached_input_tokens=0.3,
@@ -202,9 +196,7 @@ SUPPORTED_MODELS = [
202
196
  alias_for='claude-3-5-haiku-20241022',
203
197
  provider='Anthropic',
204
198
  in_service=True,
205
- description=(
206
- 'Claude 3.5 Haiku v2 model (10/22/2024).'
207
- ),
199
+ description='Claude 3.5 Haiku v2 model (10/22/2024).',
208
200
  input_modalities=lf.ModelInfo.TEXT_INPUT_ONLY,
209
201
  context_length=lf.ModelInfo.ContextLength(
210
202
  max_input_tokens=200_000,
@@ -226,9 +218,7 @@ SUPPORTED_MODELS = [
226
218
  model_id='claude-3-5-haiku-20241022',
227
219
  provider='Anthropic',
228
220
  in_service=True,
229
- description=(
230
- 'Claude 3.5 Haiku v2 model (10/22/2024).'
231
- ),
221
+ description='Claude 3.5 Haiku v2 model (10/22/2024).',
232
222
  release_date=datetime.datetime(2024, 10, 22),
233
223
  input_modalities=lf.ModelInfo.TEXT_INPUT_ONLY,
234
224
  context_length=lf.ModelInfo.ContextLength(
@@ -252,9 +242,7 @@ SUPPORTED_MODELS = [
252
242
  alias_for='claude-3-5-haiku-20241022',
253
243
  provider='VertexAI',
254
244
  in_service=True,
255
- description=(
256
- 'Claude 3.5 Haiku model served on VertexAI (10/22/2024).'
257
- ),
245
+ description='Claude 3.5 Haiku model served on VertexAI (10/22/2024).',
258
246
  release_date=datetime.datetime(2024, 10, 22),
259
247
  input_modalities=lf.ModelInfo.TEXT_INPUT_ONLY,
260
248
  context_length=lf.ModelInfo.ContextLength(
@@ -279,9 +267,7 @@ SUPPORTED_MODELS = [
279
267
  alias_for='claude-3-opus-20240229',
280
268
  provider='Anthropic',
281
269
  in_service=True,
282
- description=(
283
- 'Claude 3 Opus model (latest).'
284
- ),
270
+ description='Claude 3 Opus model (latest).',
285
271
  input_modalities=AnthropicModelInfo.INPUT_IMAGE_TYPES,
286
272
  context_length=lf.ModelInfo.ContextLength(
287
273
  max_input_tokens=200_000,
@@ -303,9 +289,7 @@ SUPPORTED_MODELS = [
303
289
  model_id='claude-3-opus-20240229',
304
290
  provider='Anthropic',
305
291
  in_service=True,
306
- description=(
307
- 'Claude 3 Opus model (02/29/2024).'
308
- ),
292
+ description='Claude 3 Opus model (02/29/2024).',
309
293
  release_date=datetime.datetime(2024, 2, 29),
310
294
  input_modalities=AnthropicModelInfo.INPUT_IMAGE_TYPES,
311
295
  context_length=lf.ModelInfo.ContextLength(
@@ -329,9 +313,7 @@ SUPPORTED_MODELS = [
329
313
  alias_for='claude-3-opus-20240229',
330
314
  provider='VertexAI',
331
315
  in_service=True,
332
- description=(
333
- 'Claude 3 Opus model served on VertexAI (02/29/2024).'
334
- ),
316
+ description='Claude 3 Opus model served on VertexAI (02/29/2024).',
335
317
  release_date=datetime.datetime(2024, 2, 29),
336
318
  input_modalities=AnthropicModelInfo.INPUT_IMAGE_TYPES,
337
319
  context_length=lf.ModelInfo.ContextLength(
@@ -355,9 +337,7 @@ SUPPORTED_MODELS = [
355
337
  model_id='claude-3-sonnet-20240229',
356
338
  provider='Anthropic',
357
339
  in_service=True,
358
- description=(
359
- 'Claude 3 Sonnet model (02/29/2024).'
360
- ),
340
+ description='Claude 3 Sonnet model (02/29/2024).',
361
341
  release_date=datetime.datetime(2024, 2, 29),
362
342
  input_modalities=AnthropicModelInfo.INPUT_IMAGE_TYPES,
363
343
  context_length=lf.ModelInfo.ContextLength(
@@ -381,9 +361,7 @@ SUPPORTED_MODELS = [
381
361
  alias_for='claude-3-sonnet-20240229',
382
362
  provider='VertexAI',
383
363
  in_service=True,
384
- description=(
385
- 'Claude 3 Sonnet model served on VertexAI (02/29/2024).'
386
- ),
364
+ description='Claude 3 Sonnet model served on VertexAI (02/29/2024).',
387
365
  release_date=datetime.datetime(2024, 2, 29),
388
366
  input_modalities=AnthropicModelInfo.INPUT_IMAGE_TYPES,
389
367
  context_length=lf.ModelInfo.ContextLength(
@@ -407,9 +385,7 @@ SUPPORTED_MODELS = [
407
385
  model_id='claude-3-haiku-20240307',
408
386
  provider='Anthropic',
409
387
  in_service=True,
410
- description=(
411
- 'Claude 3 Haiku model (03/07/2024).'
412
- ),
388
+ description='Claude 3 Haiku model (03/07/2024).',
413
389
  release_date=datetime.datetime(2024, 3, 7),
414
390
  input_modalities=AnthropicModelInfo.INPUT_IMAGE_TYPES,
415
391
  context_length=lf.ModelInfo.ContextLength(
@@ -433,9 +409,7 @@ SUPPORTED_MODELS = [
433
409
  alias_for='claude-3-haiku-20240307',
434
410
  provider='Anthropic',
435
411
  in_service=True,
436
- description=(
437
- 'Claude 3 Haiku model served on VertexAI (03/07/2024).'
438
- ),
412
+ description='Claude 3 Haiku model served on VertexAI (03/07/2024).',
439
413
  release_date=datetime.datetime(2024, 3, 7),
440
414
  input_modalities=AnthropicModelInfo.INPUT_IMAGE_TYPES,
441
415
  context_length=lf.ModelInfo.ContextLength(
@@ -562,6 +536,11 @@ class Anthropic(rest.REST):
562
536
  # Minimum budget is 1,024 tokens.
563
537
  'budget_tokens': options.max_thinking_tokens,
564
538
  }
539
+ # max_tokens, which is thinking tokens + response tokens, must be greater
540
+ # than the thinking tokens.
541
+ if args['max_tokens'] < options.max_thinking_tokens:
542
+ args['max_tokens'] += options.max_thinking_tokens
543
+
565
544
  # Thinking isn’t compatible with temperature, top_p, or top_k.
566
545
  # https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#important-considerations-when-using-extended-thinking
567
546
  args.pop('temperature', None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: langfun
3
- Version: 0.1.2.dev202503070804
3
+ Version: 0.1.2.dev202503080803
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -74,7 +74,7 @@ langfun/core/eval/v2/reporting_test.py,sha256=UmYSAQvD3AIXsSyWQ-WD2uLtEISYpmBeoK
74
74
  langfun/core/eval/v2/runners.py,sha256=DKEmSlGXjOXKWFdBhTpLy7tMsBHZHd1Brl3hWIngsSQ,15931
75
75
  langfun/core/eval/v2/runners_test.py,sha256=A37fKK2MvAVTiShsg_laluJzJ9AuAQn52k7HPbfD0Ks,11666
76
76
  langfun/core/llms/__init__.py,sha256=F2nqEv9Cc-1QALrlPnIEp-TZiSVTi6U8WWb1YwDt1w0,8038
77
- langfun/core/llms/anthropic.py,sha256=7kY1-QFpzh2Oye8H1Mtko7QJWrnrhnhe1Wj16nOZXvk,23473
77
+ langfun/core/llms/anthropic.py,sha256=d6ncYfPbK1YjofebKdOgGu0un_AXdsKBgt0SFGwE70s,23391
78
78
  langfun/core/llms/anthropic_test.py,sha256=SSK7OTx3gMYE1NMAi_PqQqeNsCkZAcVJvl_OCEOhyzk,7145
79
79
  langfun/core/llms/azure_openai.py,sha256=-KkSLaR54MlsIqz_XIwv0TnsBnvNTAxnjA2Q2O2u5KM,2733
80
80
  langfun/core/llms/azure_openai_test.py,sha256=lkMZkQdJBV97fTM4C4z8qNfvr6spgiN5G4hvVUIVr0M,1735
@@ -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.dev202503070804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
154
- langfun-0.1.2.dev202503070804.dist-info/METADATA,sha256=oOrC1dV72s8AUVxeTUlGGk6wOxKLB6GCk9o5udxGtgU,8172
155
- langfun-0.1.2.dev202503070804.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
156
- langfun-0.1.2.dev202503070804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
157
- langfun-0.1.2.dev202503070804.dist-info/RECORD,,
153
+ langfun-0.1.2.dev202503080803.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
154
+ langfun-0.1.2.dev202503080803.dist-info/METADATA,sha256=g9mF2vYwbY5kS1no-Ci_br1VJ3u_liXjp5I42hlePJ4,8172
155
+ langfun-0.1.2.dev202503080803.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
156
+ langfun-0.1.2.dev202503080803.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
157
+ langfun-0.1.2.dev202503080803.dist-info/RECORD,,