langfun 0.1.2.dev202503140804__tar.gz → 0.1.2.dev202503160803__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 (162) hide show
  1. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/PKG-INFO +1 -12
  2. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/gemini.py +10 -1
  3. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/__init__.py +0 -3
  4. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun.egg-info/PKG-INFO +1 -12
  5. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun.egg-info/SOURCES.txt +0 -2
  6. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun.egg-info/requires.txt +0 -13
  7. langfun-0.1.2.dev202503140804/langfun/core/modalities/ms_office.py +0 -117
  8. langfun-0.1.2.dev202503140804/langfun/core/modalities/ms_office_test.py +0 -389
  9. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/LICENSE +0 -0
  10. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/README.md +0 -0
  11. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/__init__.py +0 -0
  12. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/__init__.py +0 -0
  13. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/agentic/__init__.py +0 -0
  14. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/agentic/action.py +0 -0
  15. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/agentic/action_eval.py +0 -0
  16. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/agentic/action_eval_test.py +0 -0
  17. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/agentic/action_test.py +0 -0
  18. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/__init__.py +0 -0
  19. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/__init__.py +0 -0
  20. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/correction.py +0 -0
  21. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/correction_test.py +0 -0
  22. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/execution.py +0 -0
  23. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/execution_test.py +0 -0
  24. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/generation.py +0 -0
  25. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/generation_test.py +0 -0
  26. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/parsing.py +0 -0
  27. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/parsing_test.py +0 -0
  28. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/sandboxing.py +0 -0
  29. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/coding/python/sandboxing_test.py +0 -0
  30. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/component.py +0 -0
  31. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/component_test.py +0 -0
  32. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/concurrent.py +0 -0
  33. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/concurrent_test.py +0 -0
  34. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/console.py +0 -0
  35. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/console_test.py +0 -0
  36. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/__init__.py +0 -0
  37. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/base.py +0 -0
  38. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/base_test.py +0 -0
  39. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/matching.py +0 -0
  40. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/matching_test.py +0 -0
  41. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/patching.py +0 -0
  42. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/patching_test.py +0 -0
  43. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/scoring.py +0 -0
  44. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/scoring_test.py +0 -0
  45. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/__init__.py +0 -0
  46. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/checkpointing.py +0 -0
  47. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/checkpointing_test.py +0 -0
  48. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/eval_test_helper.py +0 -0
  49. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/evaluation.py +0 -0
  50. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/evaluation_test.py +0 -0
  51. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/example.py +0 -0
  52. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/example_test.py +0 -0
  53. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/experiment.py +0 -0
  54. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/experiment_test.py +0 -0
  55. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/metric_values.py +0 -0
  56. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/metric_values_test.py +0 -0
  57. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/metrics.py +0 -0
  58. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/metrics_test.py +0 -0
  59. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/progress.py +0 -0
  60. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/progress_test.py +0 -0
  61. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/progress_tracking.py +0 -0
  62. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/progress_tracking_test.py +0 -0
  63. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/reporting.py +0 -0
  64. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/reporting_test.py +0 -0
  65. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/runners.py +0 -0
  66. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/eval/v2/runners_test.py +0 -0
  67. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/langfunc.py +0 -0
  68. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/langfunc_test.py +0 -0
  69. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/language_model.py +0 -0
  70. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/language_model_test.py +0 -0
  71. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/__init__.py +0 -0
  72. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/anthropic.py +0 -0
  73. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/anthropic_test.py +0 -0
  74. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/azure_openai.py +0 -0
  75. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/azure_openai_test.py +0 -0
  76. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/cache/__init__.py +0 -0
  77. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/cache/base.py +0 -0
  78. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/cache/in_memory.py +0 -0
  79. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/cache/in_memory_test.py +0 -0
  80. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/compositional.py +0 -0
  81. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/compositional_test.py +0 -0
  82. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/deepseek.py +0 -0
  83. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/deepseek_test.py +0 -0
  84. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/fake.py +0 -0
  85. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/fake_test.py +0 -0
  86. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/gemini_test.py +0 -0
  87. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/google_genai.py +0 -0
  88. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/google_genai_test.py +0 -0
  89. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/groq.py +0 -0
  90. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/groq_test.py +0 -0
  91. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/llama_cpp.py +0 -0
  92. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/llama_cpp_test.py +0 -0
  93. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/openai.py +0 -0
  94. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/openai_compatible.py +0 -0
  95. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/openai_compatible_test.py +0 -0
  96. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/openai_test.py +0 -0
  97. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/rest.py +0 -0
  98. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/rest_test.py +0 -0
  99. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/vertexai.py +0 -0
  100. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/llms/vertexai_test.py +0 -0
  101. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/logging.py +0 -0
  102. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/logging_test.py +0 -0
  103. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/memories/__init__.py +0 -0
  104. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/memories/conversation_history.py +0 -0
  105. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/memories/conversation_history_test.py +0 -0
  106. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/memory.py +0 -0
  107. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/message.py +0 -0
  108. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/message_test.py +0 -0
  109. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/audio.py +0 -0
  110. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/audio_test.py +0 -0
  111. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/image.py +0 -0
  112. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/image_test.py +0 -0
  113. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/mime.py +0 -0
  114. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/mime_test.py +0 -0
  115. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/pdf.py +0 -0
  116. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/pdf_test.py +0 -0
  117. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/video.py +0 -0
  118. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modalities/video_test.py +0 -0
  119. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modality.py +0 -0
  120. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/modality_test.py +0 -0
  121. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/natural_language.py +0 -0
  122. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/natural_language_test.py +0 -0
  123. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/sampling.py +0 -0
  124. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/sampling_test.py +0 -0
  125. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/__init__.py +0 -0
  126. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/completion.py +0 -0
  127. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/completion_test.py +0 -0
  128. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/description.py +0 -0
  129. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/description_test.py +0 -0
  130. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/function_generation.py +0 -0
  131. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/function_generation_test.py +0 -0
  132. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/mapping.py +0 -0
  133. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/mapping_test.py +0 -0
  134. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/parsing.py +0 -0
  135. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/parsing_test.py +0 -0
  136. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/querying.py +0 -0
  137. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/querying_test.py +0 -0
  138. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/schema.py +0 -0
  139. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/schema_generation.py +0 -0
  140. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/schema_generation_test.py +0 -0
  141. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/schema_test.py +0 -0
  142. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/scoring.py +0 -0
  143. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/scoring_test.py +0 -0
  144. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/tokenization.py +0 -0
  145. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/structured/tokenization_test.py +0 -0
  146. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/subscription.py +0 -0
  147. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/subscription_test.py +0 -0
  148. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/template.py +0 -0
  149. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/template_test.py +0 -0
  150. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/__init__.py +0 -0
  151. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/completion.py +0 -0
  152. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/completion_test.py +0 -0
  153. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/conversation.py +0 -0
  154. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/conversation_test.py +0 -0
  155. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/demonstration.py +0 -0
  156. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/demonstration_test.py +0 -0
  157. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/selfplay.py +0 -0
  158. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun/core/templates/selfplay_test.py +0 -0
  159. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun.egg-info/dependency_links.txt +0 -0
  160. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/langfun.egg-info/top_level.txt +0 -0
  161. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/setup.cfg +0 -0
  162. {langfun-0.1.2.dev202503140804 → langfun-0.1.2.dev202503160803}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: langfun
3
- Version: 0.1.2.dev202503140804
3
+ Version: 0.1.2.dev202503160803
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -32,10 +32,7 @@ Requires-Dist: termcolor==1.1.0; extra == "all"
32
32
  Requires-Dist: tqdm>=4.64.1; extra == "all"
33
33
  Requires-Dist: google-auth>=2.16.0; extra == "all"
34
34
  Requires-Dist: python-magic>=0.4.27; extra == "all"
35
- Requires-Dist: python-docx>=0.8.11; extra == "all"
36
35
  Requires-Dist: pillow>=10.0.0; extra == "all"
37
- Requires-Dist: openpyxl>=3.1.0; extra == "all"
38
- Requires-Dist: pandas>=2.0.3; extra == "all"
39
36
  Provides-Extra: ui
40
37
  Requires-Dist: termcolor==1.1.0; extra == "ui"
41
38
  Requires-Dist: tqdm>=4.64.1; extra == "ui"
@@ -43,19 +40,11 @@ Provides-Extra: vertexai
43
40
  Requires-Dist: google-auth>=2.16.0; extra == "vertexai"
44
41
  Provides-Extra: mime
45
42
  Requires-Dist: python-magic>=0.4.27; extra == "mime"
46
- Requires-Dist: python-docx>=0.8.11; extra == "mime"
47
43
  Requires-Dist: pillow>=10.0.0; extra == "mime"
48
- Requires-Dist: openpyxl>=3.1.0; extra == "mime"
49
- Requires-Dist: pandas>=2.0.3; extra == "mime"
50
44
  Provides-Extra: mime-auto
51
45
  Requires-Dist: python-magic>=0.4.27; extra == "mime-auto"
52
- Provides-Extra: mime-docx
53
- Requires-Dist: python-docx>=0.8.11; extra == "mime-docx"
54
46
  Provides-Extra: mime-pil
55
47
  Requires-Dist: pillow>=10.0.0; extra == "mime-pil"
56
- Provides-Extra: mime-xlsx
57
- Requires-Dist: openpyxl>=3.1.0; extra == "mime-xlsx"
58
- Requires-Dist: pandas>=2.0.3; extra == "mime-xlsx"
59
48
  Dynamic: author
60
49
  Dynamic: author-email
61
50
  Dynamic: classifier
@@ -608,7 +608,16 @@ class Gemini(rest.REST):
608
608
  modalities = [modalities]
609
609
  for modality in modalities:
610
610
  if modality.is_text:
611
- parts.append({'text': modality.to_text()})
611
+ # Add YouTube video into the context window.
612
+ # https://ai.google.dev/gemini-api/docs/vision?lang=python#youtube
613
+ if modality.mime_type == 'text/html' and modality.uri.startswith(
614
+ 'https://www.youtube.com/watch?v='
615
+ ):
616
+ parts.append({
617
+ 'fileData': {'mimeType': 'video/*', 'fileUri': modality.uri}
618
+ })
619
+ else:
620
+ parts.append({'text': modality.to_text()})
612
621
  else:
613
622
  parts.append({
614
623
  'inlineData': {
@@ -20,9 +20,6 @@
20
20
  from langfun.core.modalities.audio import Audio
21
21
  from langfun.core.modalities.mime import Mime
22
22
  from langfun.core.modalities.mime import Custom
23
- from langfun.core.modalities.ms_office import Docx
24
- from langfun.core.modalities.ms_office import Pptx
25
- from langfun.core.modalities.ms_office import Xlsx
26
23
  from langfun.core.modalities.image import Image
27
24
  from langfun.core.modalities.pdf import PDF
28
25
  from langfun.core.modalities.video import Video
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: langfun
3
- Version: 0.1.2.dev202503140804
3
+ Version: 0.1.2.dev202503160803
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -32,10 +32,7 @@ Requires-Dist: termcolor==1.1.0; extra == "all"
32
32
  Requires-Dist: tqdm>=4.64.1; extra == "all"
33
33
  Requires-Dist: google-auth>=2.16.0; extra == "all"
34
34
  Requires-Dist: python-magic>=0.4.27; extra == "all"
35
- Requires-Dist: python-docx>=0.8.11; extra == "all"
36
35
  Requires-Dist: pillow>=10.0.0; extra == "all"
37
- Requires-Dist: openpyxl>=3.1.0; extra == "all"
38
- Requires-Dist: pandas>=2.0.3; extra == "all"
39
36
  Provides-Extra: ui
40
37
  Requires-Dist: termcolor==1.1.0; extra == "ui"
41
38
  Requires-Dist: tqdm>=4.64.1; extra == "ui"
@@ -43,19 +40,11 @@ Provides-Extra: vertexai
43
40
  Requires-Dist: google-auth>=2.16.0; extra == "vertexai"
44
41
  Provides-Extra: mime
45
42
  Requires-Dist: python-magic>=0.4.27; extra == "mime"
46
- Requires-Dist: python-docx>=0.8.11; extra == "mime"
47
43
  Requires-Dist: pillow>=10.0.0; extra == "mime"
48
- Requires-Dist: openpyxl>=3.1.0; extra == "mime"
49
- Requires-Dist: pandas>=2.0.3; extra == "mime"
50
44
  Provides-Extra: mime-auto
51
45
  Requires-Dist: python-magic>=0.4.27; extra == "mime-auto"
52
- Provides-Extra: mime-docx
53
- Requires-Dist: python-docx>=0.8.11; extra == "mime-docx"
54
46
  Provides-Extra: mime-pil
55
47
  Requires-Dist: pillow>=10.0.0; extra == "mime-pil"
56
- Provides-Extra: mime-xlsx
57
- Requires-Dist: openpyxl>=3.1.0; extra == "mime-xlsx"
58
- Requires-Dist: pandas>=2.0.3; extra == "mime-xlsx"
59
48
  Dynamic: author
60
49
  Dynamic: author-email
61
50
  Dynamic: classifier
@@ -122,8 +122,6 @@ langfun/core/modalities/image.py
122
122
  langfun/core/modalities/image_test.py
123
123
  langfun/core/modalities/mime.py
124
124
  langfun/core/modalities/mime_test.py
125
- langfun/core/modalities/ms_office.py
126
- langfun/core/modalities/ms_office_test.py
127
125
  langfun/core/modalities/pdf.py
128
126
  langfun/core/modalities/pdf_test.py
129
127
  langfun/core/modalities/video.py
@@ -10,31 +10,18 @@ termcolor==1.1.0
10
10
  tqdm>=4.64.1
11
11
  google-auth>=2.16.0
12
12
  python-magic>=0.4.27
13
- python-docx>=0.8.11
14
13
  pillow>=10.0.0
15
- openpyxl>=3.1.0
16
- pandas>=2.0.3
17
14
 
18
15
  [mime]
19
16
  python-magic>=0.4.27
20
- python-docx>=0.8.11
21
17
  pillow>=10.0.0
22
- openpyxl>=3.1.0
23
- pandas>=2.0.3
24
18
 
25
19
  [mime-auto]
26
20
  python-magic>=0.4.27
27
21
 
28
- [mime-docx]
29
- python-docx>=0.8.11
30
-
31
22
  [mime-pil]
32
23
  pillow>=10.0.0
33
24
 
34
- [mime-xlsx]
35
- openpyxl>=3.1.0
36
- pandas>=2.0.3
37
-
38
25
  [ui]
39
26
  termcolor==1.1.0
40
27
  tqdm>=4.64.1
@@ -1,117 +0,0 @@
1
- # Copyright 2023 The Langfun Authors
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- """Microsoft Office file types."""
15
-
16
- import base64
17
- import io
18
- import os
19
- from typing import Iterable
20
- from langfun.core.modalities import mime
21
- from langfun.core.modalities import pdf
22
- import requests
23
-
24
-
25
- class Xlsx(mime.Mime):
26
- """Xlsx file type."""
27
-
28
- MIME_PREFIX = (
29
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
30
- )
31
-
32
- def _raw_html(self) -> str:
33
- try:
34
- import pandas as pd # pylint: disable=g-import-not-at-top
35
- import openpyxl # pylint: disable=g-import-not-at-top, unused-import
36
- df = pd.read_excel(io.BytesIO(self.to_bytes()))
37
- return df.to_html()
38
- except ImportError as e:
39
- raise RuntimeError(
40
- 'Please install "langfun[mime-xlsx]" to enable XLSX support.'
41
- ) from e
42
-
43
- def _is_compatible(self, mime_types: Iterable[str]) -> bool:
44
- return bool(set(mime_types).intersection([
45
- 'text/html',
46
- 'text/plain',
47
- ]))
48
-
49
- def _make_compatible(self, mime_types: Iterable[str]) -> mime.Mime:
50
- """Returns the MimeType of the converted file."""
51
- del mime_types
52
- return mime.Mime(uri=self.uri, content=self._raw_html())
53
-
54
-
55
- class Docx(mime.Mime):
56
- """Docx file type."""
57
-
58
- MIME_PREFIX = (
59
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
60
- )
61
-
62
- def to_xml(self) -> str:
63
- try:
64
- import docx # pylint: disable=g-import-not-at-top
65
- doc = docx.Document(io.BytesIO(self.to_bytes()))
66
- return str(doc.element.xml)
67
- except ImportError as e:
68
- raise RuntimeError(
69
- 'Please install "langfun[mime-docx]" to enable Docx support.'
70
- ) from e
71
-
72
- def _repr_html_(self) -> str:
73
- return self.to_xml()
74
-
75
- def _is_compatible(self, mime_types: Iterable[str]) -> bool:
76
- return bool(set(mime_types).intersection([
77
- 'application/xml',
78
- 'text/xml',
79
- 'text/plain',
80
- ]))
81
-
82
- def _make_compatible(self, mime_types: Iterable[str]) -> mime.Mime:
83
- """Returns the MimeType of the converted file."""
84
- del mime_types
85
- return mime.Mime(uri=self.uri, content=self.to_xml())
86
-
87
-
88
- class Pptx(mime.Mime):
89
- """Pptx file type."""
90
-
91
- MIME_PREFIX = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
92
- API_URL = 'https://v2.convertapi.com/convert/pptx/to/pdf'
93
-
94
- def to_pdf(self, convert_api_key: str | None = None) -> pdf.PDF:
95
- api_key = convert_api_key or os.environ.get('CONVERT_API_KEY')
96
- url = f'{self.API_URL}?Secret={api_key}'
97
-
98
- json = {
99
- 'Parameters': [{
100
- 'Name': 'File',
101
- 'FileValue': {
102
- 'Name': os.path.basename(self.uri) if self.uri else 'tmp.pptx',
103
- 'Data': base64.b64encode(self.to_bytes()).decode('utf-8'),
104
- },
105
- }]
106
- }
107
- response = requests.post(url, json=json).json()
108
- base64_pdf = response['Files'][0]['FileData']
109
- return pdf.PDF.from_bytes(base64.b64decode(base64_pdf))
110
-
111
- def _is_compatible(self, mime_types: Iterable[str]) -> bool:
112
- return 'application/pdf' in mime_types
113
-
114
- def _make_compatible(self, mime_types: Iterable[str]) -> mime.Mime:
115
- """Returns the MimeType of the converted file."""
116
- del mime_types
117
- return self.to_pdf()