langfun 0.1.2.dev202501030804__tar.gz → 0.1.2.dev202501040804__tar.gz

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.
Files changed (158) hide show
  1. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/PKG-INFO +1 -1
  2. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/experiment.py +23 -18
  3. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/experiment_test.py +21 -4
  4. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/reporting.py +17 -7
  5. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/reporting_test.py +1 -1
  6. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/__init__.py +2 -0
  7. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/google_genai.py +11 -0
  8. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/vertexai.py +13 -1
  9. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun.egg-info/PKG-INFO +1 -1
  10. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/LICENSE +0 -0
  11. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/README.md +0 -0
  12. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/__init__.py +0 -0
  13. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/__init__.py +0 -0
  14. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/agentic/__init__.py +0 -0
  15. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/agentic/action.py +0 -0
  16. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/agentic/action_eval.py +0 -0
  17. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/agentic/action_eval_test.py +0 -0
  18. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/agentic/action_test.py +0 -0
  19. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/__init__.py +0 -0
  20. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/__init__.py +0 -0
  21. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/correction.py +0 -0
  22. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/correction_test.py +0 -0
  23. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/errors.py +0 -0
  24. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/errors_test.py +0 -0
  25. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/execution.py +0 -0
  26. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/execution_test.py +0 -0
  27. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/generation.py +0 -0
  28. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/generation_test.py +0 -0
  29. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/parsing.py +0 -0
  30. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/parsing_test.py +0 -0
  31. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/permissions.py +0 -0
  32. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/coding/python/permissions_test.py +0 -0
  33. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/component.py +0 -0
  34. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/component_test.py +0 -0
  35. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/concurrent.py +0 -0
  36. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/concurrent_test.py +0 -0
  37. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/console.py +0 -0
  38. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/console_test.py +0 -0
  39. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/__init__.py +0 -0
  40. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/base.py +0 -0
  41. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/base_test.py +0 -0
  42. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/matching.py +0 -0
  43. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/matching_test.py +0 -0
  44. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/patching.py +0 -0
  45. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/patching_test.py +0 -0
  46. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/scoring.py +0 -0
  47. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/scoring_test.py +0 -0
  48. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/__init__.py +0 -0
  49. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/checkpointing.py +0 -0
  50. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/checkpointing_test.py +0 -0
  51. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/eval_test_helper.py +0 -0
  52. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/evaluation.py +0 -0
  53. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/evaluation_test.py +0 -0
  54. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/example.py +0 -0
  55. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/example_test.py +0 -0
  56. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/metric_values.py +0 -0
  57. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/metric_values_test.py +0 -0
  58. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/metrics.py +0 -0
  59. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/metrics_test.py +0 -0
  60. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/progress.py +0 -0
  61. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/progress_test.py +0 -0
  62. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/progress_tracking.py +0 -0
  63. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/progress_tracking_test.py +0 -0
  64. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/runners.py +0 -0
  65. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/eval/v2/runners_test.py +0 -0
  66. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/langfunc.py +0 -0
  67. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/langfunc_test.py +0 -0
  68. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/language_model.py +0 -0
  69. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/language_model_test.py +0 -0
  70. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/anthropic.py +0 -0
  71. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/anthropic_test.py +0 -0
  72. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/cache/__init__.py +0 -0
  73. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/cache/base.py +0 -0
  74. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/cache/in_memory.py +0 -0
  75. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/cache/in_memory_test.py +0 -0
  76. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/compositional.py +0 -0
  77. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/compositional_test.py +0 -0
  78. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/fake.py +0 -0
  79. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/fake_test.py +0 -0
  80. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/google_genai_test.py +0 -0
  81. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/groq.py +0 -0
  82. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/groq_test.py +0 -0
  83. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/llama_cpp.py +0 -0
  84. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/llama_cpp_test.py +0 -0
  85. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/openai.py +0 -0
  86. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/openai_test.py +0 -0
  87. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/rest.py +0 -0
  88. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/rest_test.py +0 -0
  89. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/llms/vertexai_test.py +0 -0
  90. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/logging.py +0 -0
  91. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/logging_test.py +0 -0
  92. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/memories/__init__.py +0 -0
  93. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/memories/conversation_history.py +0 -0
  94. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/memories/conversation_history_test.py +0 -0
  95. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/memory.py +0 -0
  96. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/message.py +0 -0
  97. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/message_test.py +0 -0
  98. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/__init__.py +0 -0
  99. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/audio.py +0 -0
  100. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/audio_test.py +0 -0
  101. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/image.py +0 -0
  102. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/image_test.py +0 -0
  103. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/mime.py +0 -0
  104. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/mime_test.py +0 -0
  105. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/ms_office.py +0 -0
  106. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/ms_office_test.py +0 -0
  107. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/pdf.py +0 -0
  108. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/pdf_test.py +0 -0
  109. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/video.py +0 -0
  110. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modalities/video_test.py +0 -0
  111. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modality.py +0 -0
  112. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/modality_test.py +0 -0
  113. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/natural_language.py +0 -0
  114. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/natural_language_test.py +0 -0
  115. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/sampling.py +0 -0
  116. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/sampling_test.py +0 -0
  117. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/__init__.py +0 -0
  118. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/completion.py +0 -0
  119. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/completion_test.py +0 -0
  120. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/description.py +0 -0
  121. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/description_test.py +0 -0
  122. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/function_generation.py +0 -0
  123. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/function_generation_test.py +0 -0
  124. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/mapping.py +0 -0
  125. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/mapping_test.py +0 -0
  126. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/parsing.py +0 -0
  127. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/parsing_test.py +0 -0
  128. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/querying.py +0 -0
  129. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/querying_test.py +0 -0
  130. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/schema.py +0 -0
  131. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/schema_generation.py +0 -0
  132. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/schema_generation_test.py +0 -0
  133. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/schema_test.py +0 -0
  134. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/scoring.py +0 -0
  135. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/scoring_test.py +0 -0
  136. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/tokenization.py +0 -0
  137. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/structured/tokenization_test.py +0 -0
  138. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/subscription.py +0 -0
  139. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/subscription_test.py +0 -0
  140. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/template.py +0 -0
  141. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/template_test.py +0 -0
  142. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/__init__.py +0 -0
  143. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/completion.py +0 -0
  144. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/completion_test.py +0 -0
  145. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/conversation.py +0 -0
  146. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/conversation_test.py +0 -0
  147. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/demonstration.py +0 -0
  148. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/demonstration_test.py +0 -0
  149. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/selfplay.py +0 -0
  150. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/templates/selfplay_test.py +0 -0
  151. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/text_formatting.py +0 -0
  152. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun/core/text_formatting_test.py +0 -0
  153. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun.egg-info/SOURCES.txt +0 -0
  154. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun.egg-info/dependency_links.txt +0 -0
  155. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun.egg-info/requires.txt +0 -0
  156. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/langfun.egg-info/top_level.txt +0 -0
  157. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/setup.cfg +0 -0
  158. {langfun-0.1.2.dev202501030804 → langfun-0.1.2.dev202501040804}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langfun
3
- Version: 0.1.2.dev202501030804
3
+ Version: 0.1.2.dev202501040804
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -381,7 +381,7 @@ class Experiment(lf.Component, pg.views.HtmlTreeView.Extension):
381
381
  example_ids: list[int] | None = None,
382
382
  raise_if_has_error: bool = False,
383
383
  reprocess: bool | list[int] = False,
384
- regenerate_example_html: bool | list[int] = False,
384
+ generate_example_html: Literal['new', 'all', 'no'] | list[int] = 'new',
385
385
  process_timeout: int | None = None,
386
386
  use_cache: Literal['global', 'per_dataset', 'no'] = 'per_dataset',
387
387
  note: str | None = None,
@@ -435,11 +435,13 @@ class Experiment(lf.Component, pg.views.HtmlTreeView.Extension):
435
435
  meaning that existing checkpoints will be ignored. If a list of
436
436
  example IDs, it indicates that only the specified examples will be
437
437
  reprocessed.
438
- regenerate_example_html: A boolean or a list of example IDs. If boolean,
439
- it indicates that whether all the examples to be evaluated will have
440
- their HTML files regenerated. If a list of example IDs, it indicates
441
- that only the specified examples will have their HTML files
442
- regenerated.
438
+ generate_example_html: Among 'new', 'all', 'no' or a list of example IDs.
439
+ If 'new', generate HTML files for all newly processed examples, and
440
+ keep/copy existing HTML files for unchanged examples.
441
+ If 'all', generate HTML files for all examples.
442
+ If 'no', do not generate HTML files for any examples.
443
+ If a list of example IDs, generate HTML files for the specified
444
+ examples.
443
445
  process_timeout: The timeout in seconds for each process. If None, it
444
446
  will use the default timeout for the runner.
445
447
  use_cache: Whether to use LLM cache for the experiment.
@@ -467,7 +469,7 @@ class Experiment(lf.Component, pg.views.HtmlTreeView.Extension):
467
469
  example_ids=example_ids,
468
470
  raise_if_has_error=raise_if_has_error,
469
471
  reprocess=reprocess,
470
- regenerate_example_html=regenerate_example_html,
472
+ generate_example_html=generate_example_html,
471
473
  use_cache=use_cache,
472
474
  process_timeout=process_timeout,
473
475
  note=note,
@@ -837,14 +839,17 @@ class Run(pg.Object, pg.views.html.HtmlTreeView.Extension):
837
839
  )
838
840
  ] = False
839
841
 
840
- regenerate_example_html: Annotated[
841
- bool | list[int],
842
+ generate_example_html: Annotated[
843
+ Literal['new', 'all', 'no'] | list[int],
842
844
  (
843
- 'If True, it will regenerate the HTML files for previously processed '
844
- 'examples. If a list of integers, the HTML files for the examples of '
845
- 'the given IDs will be regenerated'
845
+ 'If "new", generate HTML files for all newly processed examples, '
846
+ 'and keep/copy existing HTML files for unchanged examples. '
847
+ 'If "all", generate HTML files for all examples. '
848
+ 'If "no", do not generate HTML files for any examples. '
849
+ 'If a list of example IDs, generate HTML files for the specified '
850
+ 'examples.'
846
851
  )
847
- ] = False
852
+ ] = 'new'
848
853
 
849
854
  filter: Annotated[
850
855
  Callable[[Experiment], bool] | None,
@@ -917,17 +922,17 @@ class Run(pg.Object, pg.views.html.HtmlTreeView.Extension):
917
922
  def examples_to_load(self, experiment: Experiment) -> set[int]:
918
923
  """Returns the example IDs to load from checkpoint files.."""
919
924
  load_ids = self.examples_to_evaluate(experiment)
920
- if isinstance(self.regenerate_example_html, list):
921
- load_ids |= set(self.regenerate_example_html)
925
+ if isinstance(self.generate_example_html, list):
926
+ load_ids |= set(self.generate_example_html)
922
927
  load_ids -= self.examples_to_reprocess(experiment)
923
928
  return load_ids
924
929
 
925
930
  def examples_to_load_metadata(self, experiment: Experiment) -> set[int]:
926
931
  """Returns the example IDs to load the metadata."""
927
932
  load_metadata_ids = set()
928
- if isinstance(self.regenerate_example_html, list):
929
- load_metadata_ids = set(self.regenerate_example_html)
930
- elif self.regenerate_example_html:
933
+ if isinstance(self.generate_example_html, list):
934
+ load_metadata_ids = set(self.generate_example_html)
935
+ elif self.generate_example_html == 'all':
931
936
  load_metadata_ids = self.examples_to_evaluate(experiment)
932
937
  load_metadata_ids -= self.examples_to_reprocess(experiment)
933
938
  return load_metadata_ids
@@ -337,7 +337,7 @@ class RunTest(unittest.TestCase):
337
337
  self.assertEqual(run.examples_to_load(exp), set([3, 5]))
338
338
  self.assertEqual(run.examples_to_load_metadata(exp), set())
339
339
 
340
- def test_examples_with_regenerate_example_html_all(self):
340
+ def test_examples_with_generate_example_html_all(self):
341
341
  run = Run(
342
342
  '/root',
343
343
  RunId.from_id('20241102_0'),
@@ -346,7 +346,7 @@ class RunTest(unittest.TestCase):
346
346
  ])),
347
347
  example_ids=[1, 3, 5],
348
348
  reprocess=[1],
349
- regenerate_example_html=True,
349
+ generate_example_html='all',
350
350
  )
351
351
  exp = run.experiment.leaf_nodes[0]
352
352
  self.assertEqual(run.examples_to_evaluate(exp), set([1, 3, 5]))
@@ -354,7 +354,7 @@ class RunTest(unittest.TestCase):
354
354
  self.assertEqual(run.examples_to_load(exp), set([3, 5]))
355
355
  self.assertEqual(run.examples_to_load_metadata(exp), set([3, 5]))
356
356
 
357
- def test_examples_with_regenerate_example_html_some(self):
357
+ def test_examples_with_generate_example_html_new(self):
358
358
  run = Run(
359
359
  '/root',
360
360
  RunId.from_id('20241102_0'),
@@ -363,7 +363,24 @@ class RunTest(unittest.TestCase):
363
363
  ])),
364
364
  example_ids=[1, 3, 5],
365
365
  reprocess=[1],
366
- regenerate_example_html=[1, 2, 3],
366
+ generate_example_html='new',
367
+ )
368
+ exp = run.experiment.leaf_nodes[0]
369
+ self.assertEqual(run.examples_to_evaluate(exp), set([1, 3, 5]))
370
+ self.assertEqual(run.examples_to_reprocess(exp), set([1]))
371
+ self.assertEqual(run.examples_to_load(exp), set([3, 5]))
372
+ self.assertEqual(run.examples_to_load_metadata(exp), set())
373
+
374
+ def test_examples_with_generate_example_html_some(self):
375
+ run = Run(
376
+ '/root',
377
+ RunId.from_id('20241102_0'),
378
+ pg.Ref(Suite([
379
+ MyEvaluation(replica_id=0, inputs=sample_inputs(10)),
380
+ ])),
381
+ example_ids=[1, 3, 5],
382
+ reprocess=[1],
383
+ generate_example_html=[1, 2, 3],
367
384
  )
368
385
  exp = run.experiment.leaf_nodes[0]
369
386
  self.assertEqual(run.examples_to_evaluate(exp), set([1, 3, 5]))
@@ -195,6 +195,7 @@ class HtmlReporter(experiment_lib.Plugin):
195
195
  self, runner: Runner, experiment: Experiment, example: Example
196
196
  ) -> None:
197
197
  """Saves the example in HTML format."""
198
+ current_run = runner.current_run
198
199
  def _generate():
199
200
  try:
200
201
  with pg.timeit() as t:
@@ -222,14 +223,19 @@ class HtmlReporter(experiment_lib.Plugin):
222
223
  raise e
223
224
 
224
225
  def _copy():
225
- src_file = runner.current_run.input_path_for(
226
- experiment, f'{example.id}.html'
227
- )
228
- dest_file = runner.current_run.output_path_for(
229
- experiment, f'{example.id}.html'
230
- )
226
+ src_file = current_run.input_path_for(experiment, f'{example.id}.html')
227
+ dest_file = current_run.output_path_for(experiment, f'{example.id}.html')
228
+
231
229
  if src_file == dest_file:
232
230
  return
231
+
232
+ if not pg.io.path_exists(src_file):
233
+ experiment.warning(
234
+ f'Skip copying \'{example.id}.html\' as '
235
+ f'{src_file!r} does not exist.'
236
+ )
237
+ return
238
+
233
239
  try:
234
240
  with pg.timeit() as t, pg.io.open(src_file, 'r') as src:
235
241
  content = src.read()
@@ -244,7 +250,11 @@ class HtmlReporter(experiment_lib.Plugin):
244
250
  )
245
251
  raise e
246
252
 
247
- if example.newly_processed or runner.current_run.regenerate_example_html:
253
+ generate_example_html = current_run.generate_example_html
254
+ if (generate_example_html == 'all'
255
+ or (generate_example_html == 'new' and example.newly_processed)
256
+ or (isinstance(generate_example_html, list)
257
+ and example.id in generate_example_html)):
248
258
  op = _generate
249
259
  else:
250
260
  op = _copy
@@ -148,7 +148,7 @@ class ReportingTest(unittest.TestCase):
148
148
  )
149
149
  found_error_log = False
150
150
  for log_entry in experiment._log_entries:
151
- if log_entry.message.startswith('Failed to copy'):
151
+ if log_entry.message.startswith('Skip copying'):
152
152
  found_error_log = True
153
153
  break
154
154
  self.assertTrue(found_error_log)
@@ -32,6 +32,7 @@ from langfun.core.llms.rest import REST
32
32
 
33
33
  # Gemini models.
34
34
  from langfun.core.llms.google_genai import GenAI
35
+ from langfun.core.llms.google_genai import GeminiFlash2_0ThinkingExp
35
36
  from langfun.core.llms.google_genai import GeminiFlash2_0Exp
36
37
  from langfun.core.llms.google_genai import GeminiExp_20241114
37
38
  from langfun.core.llms.google_genai import GeminiExp_20241206
@@ -126,6 +127,7 @@ from langfun.core.llms.groq import GroqWhisper_Large_v3Turbo
126
127
  from langfun.core.llms.vertexai import VertexAI
127
128
  from langfun.core.llms.vertexai import VertexAIGemini2_0
128
129
  from langfun.core.llms.vertexai import VertexAIGeminiFlash2_0Exp
130
+ from langfun.core.llms.vertexai import VertexAIGeminiFlash2_0ThinkingExp
129
131
  from langfun.core.llms.vertexai import VertexAIGemini1_5
130
132
  from langfun.core.llms.vertexai import VertexAIGeminiPro1_5
131
133
  from langfun.core.llms.vertexai import VertexAIGeminiPro1_5_001
@@ -48,6 +48,7 @@ class GenAI(lf.LanguageModel):
48
48
 
49
49
  model: Annotated[
50
50
  Literal[
51
+ 'gemini-2.0-flash-thinking-exp-1219',
51
52
  'gemini-2.0-flash-exp',
52
53
  'gemini-exp-1206',
53
54
  'gemini-exp-1114',
@@ -307,6 +308,16 @@ _GOOGLE_GENAI_MODEL_HUB = _ModelHub()
307
308
  #
308
309
  # Public Gemini models.
309
310
  #
311
+ class GeminiFlash2_0ThinkingExp(GenAI): # pylint: disable=invalid-name
312
+ """Gemini 2.0 Flash Thinking Experimental model."""
313
+
314
+ model = 'gemini-2.0-flash-thinking-exp-1219'
315
+ supported_modalities = (
316
+ vertexai.DOCUMENT_TYPES
317
+ + vertexai.IMAGE_TYPES
318
+ + vertexai.AUDIO_TYPES
319
+ + vertexai.VIDEO_TYPES
320
+ )
310
321
 
311
322
 
312
323
  class GeminiFlash2_0Exp(GenAI): # pylint: disable=invalid-name
@@ -110,7 +110,13 @@ SUPPORTED_MODELS_AND_SETTINGS = {
110
110
  ),
111
111
  # TODO(sharatsharat): Update costs when published
112
112
  'gemini-2.0-flash-exp': pg.Dict(
113
- rpm=20,
113
+ rpm=10,
114
+ cost_per_1k_input_chars=0.000,
115
+ cost_per_1k_output_chars=0.000,
116
+ ),
117
+ # TODO(yifenglu): Update costs when published
118
+ 'gemini-2.0-flash-thinking-exp-1219': pg.Dict(
119
+ rpm=10,
114
120
  cost_per_1k_input_chars=0.000,
115
121
  cost_per_1k_output_chars=0.000,
116
122
  ),
@@ -415,6 +421,12 @@ class VertexAIGeminiFlash2_0Exp(VertexAIGemini2_0): # pylint: disable=invalid-n
415
421
  model = 'gemini-2.0-flash-exp'
416
422
 
417
423
 
424
+ class VertexAIGeminiFlash2_0ThinkingExp(VertexAIGemini2_0): # pylint: disable=invalid-name
425
+ """Vertex AI Gemini 2.0 Flash model."""
426
+
427
+ model = 'gemini-2.0-flash-thinking-exp-1219'
428
+
429
+
418
430
  class VertexAIGemini1_5(VertexAI): # pylint: disable=invalid-name
419
431
  """Vertex AI Gemini 1.5 model."""
420
432
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langfun
3
- Version: 0.1.2.dev202501030804
3
+ Version: 0.1.2.dev202501040804
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors