langfun 0.1.2.dev202409280804__py3-none-any.whl → 0.1.2.dev202410010804__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.
@@ -245,14 +245,7 @@ class VertexAI(lf.LanguageModel):
245
245
  (Exception, 'InternalServerError'),
246
246
  (Exception, 'ResourceExhausted'),
247
247
  (Exception, '_InactiveRpcError'),
248
- (
249
- Exception,
250
- (
251
- 'ValueError: Response candidate content has no parts (and thus'
252
- ' no text).'
253
- ),
254
- ),
255
- (Exception, 'ValueError: Cannot get the Candidate text.'),
248
+ (Exception, 'ValueError'),
256
249
  ]
257
250
 
258
251
  return self._parallel_execute_with_currency_control(
@@ -418,8 +411,11 @@ _VIDEO_TYPES = [
418
411
  'video/3gpp',
419
412
  ]
420
413
 
421
- _PDF = [
414
+ _DOCUMENT_TYPES = [
422
415
  'application/pdf',
416
+ 'text/plain',
417
+ 'text/csv',
418
+ 'text/html',
423
419
  ]
424
420
 
425
421
 
@@ -427,75 +423,97 @@ class VertexAIGeminiPro1_5_Latest(VertexAI): # pylint: disable=invalid-name
427
423
  """Vertex AI Gemini 1.5 Pro model."""
428
424
 
429
425
  model = 'gemini-1.5-pro-latest'
430
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
426
+ supported_modalities = (
427
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
428
+ )
431
429
 
432
430
 
433
431
  class VertexAIGeminiPro1_5(VertexAI): # pylint: disable=invalid-name
434
432
  """Vertex AI Gemini 1.5 Pro model."""
435
433
 
436
434
  model = 'gemini-1.5-pro'
437
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
435
+ supported_modalities = (
436
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
437
+ )
438
438
 
439
439
 
440
440
  class VertexAIGeminiPro1_5_002(VertexAI): # pylint: disable=invalid-name
441
441
  """Vertex AI Gemini 1.5 Pro model."""
442
442
 
443
443
  model = 'gemini-1.5-pro-002'
444
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
444
+ supported_modalities = (
445
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
446
+ )
445
447
 
446
448
 
447
449
  class VertexAIGeminiPro1_5_001(VertexAI): # pylint: disable=invalid-name
448
450
  """Vertex AI Gemini 1.5 Pro model."""
449
451
 
450
452
  model = 'gemini-1.5-pro-001'
451
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
453
+ supported_modalities = (
454
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
455
+ )
452
456
 
453
457
 
454
458
  class VertexAIGeminiPro1_5_0514(VertexAI): # pylint: disable=invalid-name
455
459
  """Vertex AI Gemini 1.5 Pro preview model."""
456
460
 
457
461
  model = 'gemini-1.5-pro-preview-0514'
458
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
462
+ supported_modalities = (
463
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
464
+ )
459
465
 
460
466
 
461
467
  class VertexAIGeminiPro1_5_0409(VertexAI): # pylint: disable=invalid-name
462
468
  """Vertex AI Gemini 1.5 Pro preview model."""
463
469
 
464
470
  model = 'gemini-1.5-pro-preview-0409'
465
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
471
+ supported_modalities = (
472
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
473
+ )
466
474
 
467
475
 
468
476
  class VertexAIGeminiFlash1_5_Latest(VertexAI): # pylint: disable=invalid-name
469
477
  """Vertex AI Gemini 1.5 Flash model."""
470
478
 
471
479
  model = 'gemini-1.5-flash-latest'
472
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
480
+ supported_modalities = (
481
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
482
+ )
473
483
 
474
484
 
475
485
  class VertexAIGeminiFlash1_5(VertexAI): # pylint: disable=invalid-name
476
486
  """Vertex AI Gemini 1.5 Flash model."""
477
487
  model = 'gemini-1.5-flash'
478
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
488
+ supported_modalities = (
489
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
490
+ )
479
491
 
480
492
 
481
493
  class VertexAIGeminiFlash1_5_002(VertexAI): # pylint: disable=invalid-name
482
494
  """Vertex AI Gemini 1.5 Flash model."""
483
495
 
484
496
  model = 'gemini-1.5-flash-002'
485
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
497
+ supported_modalities = (
498
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
499
+ )
486
500
 
487
501
 
488
502
  class VertexAIGeminiFlash1_5_001(VertexAI): # pylint: disable=invalid-name
489
503
  """Vertex AI Gemini 1.5 Flash model."""
490
504
  model = 'gemini-1.5-flash-001'
491
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
505
+ supported_modalities = (
506
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
507
+ )
492
508
 
493
509
 
494
510
  class VertexAIGeminiFlash1_5_0514(VertexAI): # pylint: disable=invalid-name
495
511
  """Vertex AI Gemini 1.5 Flash preview model."""
496
512
 
497
513
  model = 'gemini-1.5-flash-preview-0514'
498
- supported_modalities = _PDF + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
514
+ supported_modalities = (
515
+ _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
516
+ )
499
517
 
500
518
 
501
519
  class VertexAIGeminiPro1(VertexAI): # pylint: disable=invalid-name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langfun
3
- Version: 0.1.2.dev202409280804
3
+ Version: 0.1.2.dev202410010804
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -67,7 +67,7 @@ langfun/core/llms/openai.py,sha256=vnDrKuD-pli0AtDIDq_TmlltOk7z7_PQ-xpU4K1ARdU,1
67
67
  langfun/core/llms/openai_test.py,sha256=UcBFW_7RkkMEo47Tn5RuVRK_DryTN7bb9ITphlzthE8,17762
68
68
  langfun/core/llms/rest.py,sha256=laopuq-zD8V-3Y6eFDngftHEbE66VlUkCD2-rvvRaLU,3388
69
69
  langfun/core/llms/rest_test.py,sha256=NZ3Nf0XQVpT9kLP5cBVo_yBHLI7vWTYhWQxYEJVMGs4,3472
70
- langfun/core/llms/vertexai.py,sha256=3w3EhGt-mF1JJmHK8X5I0PAPqLSEDIj520OayZdr-nc,16876
70
+ langfun/core/llms/vertexai.py,sha256=Y3MrxYguUzIbr-IcxzUSGBjAL8FLX0K4TwbgI18OY5c,16977
71
71
  langfun/core/llms/vertexai_test.py,sha256=EPR-mB2hNUpvpf7E8m_k5bh04epdQTVUuYU6hPgZyu8,10321
72
72
  langfun/core/llms/cache/__init__.py,sha256=QAo3InUMDM_YpteNnVCSejI4zOsnjSMWKJKzkb3VY64,993
73
73
  langfun/core/llms/cache/base.py,sha256=rt3zwmyw0y9jsSGW-ZbV1vAfLxQ7_3AVk0l2EySlse4,3918
@@ -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=rBW2Qr8yi-aWYwoTwRR-n1peKyMX9QXPZXURjLgoiRs,2264
122
- langfun-0.1.2.dev202409280804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
123
- langfun-0.1.2.dev202409280804.dist-info/METADATA,sha256=_wBVve9ZKBMFFLBTmeY-LwjHbpJHKVaejKyZv9dGVsM,8890
124
- langfun-0.1.2.dev202409280804.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
125
- langfun-0.1.2.dev202409280804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
126
- langfun-0.1.2.dev202409280804.dist-info/RECORD,,
122
+ langfun-0.1.2.dev202410010804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
123
+ langfun-0.1.2.dev202410010804.dist-info/METADATA,sha256=eMVQPftNt81odrRYiba82BwjeI0ztGW5iJzZtQPR2J8,8890
124
+ langfun-0.1.2.dev202410010804.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
125
+ langfun-0.1.2.dev202410010804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
126
+ langfun-0.1.2.dev202410010804.dist-info/RECORD,,