AutoRAG 0.3.18__tar.gz → 0.3.19__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 (236) hide show
  1. {autorag-0.3.18 → autorag-0.3.19}/AutoRAG.egg-info/PKG-INFO +1 -1
  2. {autorag-0.3.18 → autorag-0.3.19}/PKG-INFO +1 -1
  3. autorag-0.3.19/autorag/VERSION +1 -0
  4. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/generator/llama_index_llm.py +85 -13
  5. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/generator/openai_llm.py +111 -78
  6. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/generator/run.py +5 -1
  7. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/generator/vllm.py +2 -1
  8. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/generator/vllm_api.py +23 -8
  9. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/promptmaker/run.py +6 -3
  10. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/semanticretrieval/vectordb.py +1 -1
  11. {autorag-0.3.18 → autorag-0.3.19}/pyproject.toml +4 -4
  12. {autorag-0.3.18 → autorag-0.3.19}/uv.lock +29 -29
  13. autorag-0.3.18/autorag/VERSION +0 -1
  14. {autorag-0.3.18 → autorag-0.3.19}/.dockerignore +0 -0
  15. {autorag-0.3.18 → autorag-0.3.19}/.gitignore +0 -0
  16. {autorag-0.3.18 → autorag-0.3.19}/AutoRAG.egg-info/SOURCES.txt +0 -0
  17. {autorag-0.3.18 → autorag-0.3.19}/AutoRAG.egg-info/dependency_links.txt +0 -0
  18. {autorag-0.3.18 → autorag-0.3.19}/AutoRAG.egg-info/entry_points.txt +0 -0
  19. {autorag-0.3.18 → autorag-0.3.19}/AutoRAG.egg-info/requires.txt +0 -0
  20. {autorag-0.3.18 → autorag-0.3.19}/AutoRAG.egg-info/top_level.txt +0 -0
  21. {autorag-0.3.18 → autorag-0.3.19}/Dockerfile.base +0 -0
  22. {autorag-0.3.18 → autorag-0.3.19}/Dockerfile.gpu +0 -0
  23. {autorag-0.3.18 → autorag-0.3.19}/autorag/__init__.py +0 -0
  24. {autorag-0.3.18 → autorag-0.3.19}/autorag/chunker.py +0 -0
  25. {autorag-0.3.18 → autorag-0.3.19}/autorag/cli.py +0 -0
  26. {autorag-0.3.18 → autorag-0.3.19}/autorag/dashboard.py +0 -0
  27. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/__init__.py +0 -0
  28. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/chunk/__init__.py +0 -0
  29. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/chunk/base.py +0 -0
  30. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/chunk/langchain_chunk.py +0 -0
  31. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/chunk/llama_index_chunk.py +0 -0
  32. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/chunk/run.py +0 -0
  33. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/__init__.py +0 -0
  34. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/corpus/__init__.py +0 -0
  35. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/corpus/langchain.py +0 -0
  36. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/corpus/llama_index.py +0 -0
  37. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/qacreation/__init__.py +0 -0
  38. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/qacreation/base.py +0 -0
  39. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/qacreation/llama_index.py +0 -0
  40. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/qacreation/llama_index_default_prompt.txt +0 -0
  41. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/qacreation/ragas.py +0 -0
  42. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/legacy/qacreation/simple.py +0 -0
  43. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/parse/__init__.py +0 -0
  44. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/parse/base.py +0 -0
  45. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/parse/clova.py +0 -0
  46. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/parse/langchain_parse.py +0 -0
  47. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/parse/llamaparse.py +0 -0
  48. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/parse/run.py +0 -0
  49. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/parse/table_hybrid_parse.py +0 -0
  50. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/__init__.py +0 -0
  51. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/evolve/__init__.py +0 -0
  52. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/evolve/llama_index_query_evolve.py +0 -0
  53. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/evolve/openai_query_evolve.py +0 -0
  54. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/evolve/prompt.py +0 -0
  55. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/extract_evidence.py +0 -0
  56. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/filter/__init__.py +0 -0
  57. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/filter/dontknow.py +0 -0
  58. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/filter/passage_dependency.py +0 -0
  59. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/filter/prompt.py +0 -0
  60. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/generation_gt/__init__.py +0 -0
  61. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/generation_gt/base.py +0 -0
  62. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/generation_gt/llama_index_gen_gt.py +0 -0
  63. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/generation_gt/openai_gen_gt.py +0 -0
  64. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/generation_gt/prompt.py +0 -0
  65. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/query/__init__.py +0 -0
  66. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/query/llama_gen_query.py +0 -0
  67. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/query/openai_gen_query.py +0 -0
  68. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/query/prompt.py +0 -0
  69. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/sample.py +0 -0
  70. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/qa/schema.py +0 -0
  71. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/utils/__init__.py +0 -0
  72. {autorag-0.3.18 → autorag-0.3.19}/autorag/data/utils/util.py +0 -0
  73. {autorag-0.3.18 → autorag-0.3.19}/autorag/deploy/__init__.py +0 -0
  74. {autorag-0.3.18 → autorag-0.3.19}/autorag/deploy/api.py +0 -0
  75. {autorag-0.3.18 → autorag-0.3.19}/autorag/deploy/base.py +0 -0
  76. {autorag-0.3.18 → autorag-0.3.19}/autorag/deploy/gradio.py +0 -0
  77. {autorag-0.3.18 → autorag-0.3.19}/autorag/deploy/swagger.yml +0 -0
  78. {autorag-0.3.18 → autorag-0.3.19}/autorag/embedding/__init__.py +0 -0
  79. {autorag-0.3.18 → autorag-0.3.19}/autorag/embedding/base.py +0 -0
  80. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/__init__.py +0 -0
  81. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/generation.py +0 -0
  82. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/__init__.py +0 -0
  83. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/deepeval_prompt.py +0 -0
  84. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/g_eval_prompts/coh_detailed.txt +0 -0
  85. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/g_eval_prompts/con_detailed.txt +0 -0
  86. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/g_eval_prompts/flu_detailed.txt +0 -0
  87. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/g_eval_prompts/rel_detailed.txt +0 -0
  88. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/generation.py +0 -0
  89. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/retrieval.py +0 -0
  90. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/retrieval_contents.py +0 -0
  91. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/metric/util.py +0 -0
  92. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/retrieval.py +0 -0
  93. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/retrieval_contents.py +0 -0
  94. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluation/util.py +0 -0
  95. {autorag-0.3.18 → autorag-0.3.19}/autorag/evaluator.py +0 -0
  96. {autorag-0.3.18 → autorag-0.3.19}/autorag/node_line.py +0 -0
  97. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/__init__.py +0 -0
  98. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/generator/__init__.py +0 -0
  99. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/generator/base.py +0 -0
  100. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/hybridretrieval/__init__.py +0 -0
  101. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/hybridretrieval/base.py +0 -0
  102. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/hybridretrieval/hybrid_cc.py +0 -0
  103. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/hybridretrieval/hybrid_rrf.py +0 -0
  104. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/hybridretrieval/run.py +0 -0
  105. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/lexicalretrieval/__init__.py +0 -0
  106. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/lexicalretrieval/bm25.py +0 -0
  107. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/lexicalretrieval/run.py +0 -0
  108. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passageaugmenter/__init__.py +0 -0
  109. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passageaugmenter/base.py +0 -0
  110. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passageaugmenter/pass_passage_augmenter.py +0 -0
  111. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passageaugmenter/prev_next_augmenter.py +0 -0
  112. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passageaugmenter/run.py +0 -0
  113. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagecompressor/__init__.py +0 -0
  114. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagecompressor/base.py +0 -0
  115. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagecompressor/longllmlingua.py +0 -0
  116. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagecompressor/pass_compressor.py +0 -0
  117. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagecompressor/refine.py +0 -0
  118. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagecompressor/run.py +0 -0
  119. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagecompressor/tree_summarize.py +0 -0
  120. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/__init__.py +0 -0
  121. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/base.py +0 -0
  122. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/pass_passage_filter.py +0 -0
  123. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/percentile_cutoff.py +0 -0
  124. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/recency.py +0 -0
  125. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/run.py +0 -0
  126. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/similarity_percentile_cutoff.py +0 -0
  127. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/similarity_threshold_cutoff.py +0 -0
  128. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagefilter/threshold_cutoff.py +0 -0
  129. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/__init__.py +0 -0
  130. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/base.py +0 -0
  131. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/cohere.py +0 -0
  132. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/colbert.py +0 -0
  133. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/flag_embedding.py +0 -0
  134. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/flag_embedding_llm.py +0 -0
  135. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/flashrank.py +0 -0
  136. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/jina.py +0 -0
  137. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/koreranker.py +0 -0
  138. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/mixedbreadai.py +0 -0
  139. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/monot5.py +0 -0
  140. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/openvino.py +0 -0
  141. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/pass_reranker.py +0 -0
  142. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/rankgpt.py +0 -0
  143. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/run.py +0 -0
  144. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/sentence_transformer.py +0 -0
  145. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/tart/__init__.py +0 -0
  146. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/tart/modeling_enc_t5.py +0 -0
  147. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/tart/tart.py +0 -0
  148. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/tart/tokenization_enc_t5.py +0 -0
  149. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/time_reranker.py +0 -0
  150. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/upr.py +0 -0
  151. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/passagereranker/voyageai.py +0 -0
  152. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/promptmaker/__init__.py +0 -0
  153. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/promptmaker/base.py +0 -0
  154. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/promptmaker/chat_fstring.py +0 -0
  155. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/promptmaker/fstring.py +0 -0
  156. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/promptmaker/long_context_reorder.py +0 -0
  157. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/promptmaker/window_replacement.py +0 -0
  158. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/queryexpansion/__init__.py +0 -0
  159. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/queryexpansion/base.py +0 -0
  160. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/queryexpansion/hyde.py +0 -0
  161. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/queryexpansion/multi_query_expansion.py +0 -0
  162. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/queryexpansion/pass_query_expansion.py +0 -0
  163. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/queryexpansion/query_decompose.py +0 -0
  164. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/queryexpansion/run.py +0 -0
  165. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/retrieval/__init__.py +0 -0
  166. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/retrieval/base.py +0 -0
  167. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/retrieval/run_util.py +0 -0
  168. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/semanticretrieval/__init__.py +0 -0
  169. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/semanticretrieval/run.py +0 -0
  170. {autorag-0.3.18 → autorag-0.3.19}/autorag/nodes/util.py +0 -0
  171. {autorag-0.3.18 → autorag-0.3.19}/autorag/parser.py +0 -0
  172. {autorag-0.3.18 → autorag-0.3.19}/autorag/schema/__init__.py +0 -0
  173. {autorag-0.3.18 → autorag-0.3.19}/autorag/schema/base.py +0 -0
  174. {autorag-0.3.18 → autorag-0.3.19}/autorag/schema/metricinput.py +0 -0
  175. {autorag-0.3.18 → autorag-0.3.19}/autorag/schema/module.py +0 -0
  176. {autorag-0.3.18 → autorag-0.3.19}/autorag/schema/node.py +0 -0
  177. {autorag-0.3.18 → autorag-0.3.19}/autorag/strategy.py +0 -0
  178. {autorag-0.3.18 → autorag-0.3.19}/autorag/support.py +0 -0
  179. {autorag-0.3.18 → autorag-0.3.19}/autorag/utils/__init__.py +0 -0
  180. {autorag-0.3.18 → autorag-0.3.19}/autorag/utils/cast.py +0 -0
  181. {autorag-0.3.18 → autorag-0.3.19}/autorag/utils/preprocess.py +0 -0
  182. {autorag-0.3.18 → autorag-0.3.19}/autorag/utils/util.py +0 -0
  183. {autorag-0.3.18 → autorag-0.3.19}/autorag/validator.py +0 -0
  184. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/__init__.py +0 -0
  185. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/base.py +0 -0
  186. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/chroma.py +0 -0
  187. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/couchbase.py +0 -0
  188. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/milvus.py +0 -0
  189. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/pinecone.py +0 -0
  190. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/qdrant.py +0 -0
  191. {autorag-0.3.18 → autorag-0.3.19}/autorag/vectordb/weaviate.py +0 -0
  192. {autorag-0.3.18 → autorag-0.3.19}/autorag/web.py +0 -0
  193. {autorag-0.3.18 → autorag-0.3.19}/build_and_push.sh +0 -0
  194. {autorag-0.3.18 → autorag-0.3.19}/docker-compose.yml +0 -0
  195. {autorag-0.3.18 → autorag-0.3.19}/sample_config/chunk/chunk_full.yaml +0 -0
  196. {autorag-0.3.18 → autorag-0.3.19}/sample_config/chunk/chunk_ko.yaml +0 -0
  197. {autorag-0.3.18 → autorag-0.3.19}/sample_config/chunk/simple_chunk.yaml +0 -0
  198. {autorag-0.3.18 → autorag-0.3.19}/sample_config/parse/all_files_full.yaml +0 -0
  199. {autorag-0.3.18 → autorag-0.3.19}/sample_config/parse/file_types_full.yaml +0 -0
  200. {autorag-0.3.18 → autorag-0.3.19}/sample_config/parse/parse_hybird.yaml +0 -0
  201. {autorag-0.3.18 → autorag-0.3.19}/sample_config/parse/parse_ko.yaml +0 -0
  202. {autorag-0.3.18 → autorag-0.3.19}/sample_config/parse/parse_multimodal.yaml +0 -0
  203. {autorag-0.3.18 → autorag-0.3.19}/sample_config/parse/parse_ocr.yaml +0 -0
  204. {autorag-0.3.18 → autorag-0.3.19}/sample_config/parse/simple_parse.yaml +0 -0
  205. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/gpu/compact_local.yaml +0 -0
  206. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/gpu/compact_openai.yaml +0 -0
  207. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/gpu/full.yaml +0 -0
  208. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/gpu/half.yaml +0 -0
  209. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/gpu_api/compact.yaml +0 -0
  210. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/gpu_api/full.yaml +0 -0
  211. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/gpu_api/half.yaml +0 -0
  212. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/non_gpu/compact.yaml +0 -0
  213. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/non_gpu/full.yaml +0 -0
  214. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/non_gpu/half.yaml +0 -0
  215. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/non_gpu/simple_bedrock.yaml +0 -0
  216. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/non_gpu/simple_local.yaml +0 -0
  217. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/non_gpu/simple_ollama.yaml +0 -0
  218. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/english/non_gpu/simple_openai.yaml +0 -0
  219. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/extracted_sample.yaml +0 -0
  220. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/full.yaml +0 -0
  221. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/gpu/compact_korean.yaml +0 -0
  222. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/gpu/full_korean.yaml +0 -0
  223. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/gpu/half_korean.yaml +0 -0
  224. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/gpu_api/compact_korean.yaml +0 -0
  225. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/gpu_api/full_korean.yaml +0 -0
  226. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/gpu_api/half_korean.yaml +0 -0
  227. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/non_gpu/compact_korean.yaml +0 -0
  228. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/non_gpu/full_korean.yaml +0 -0
  229. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/non_gpu/half_korean.yaml +0 -0
  230. {autorag-0.3.18 → autorag-0.3.19}/sample_config/rag/korean/non_gpu/simple_korean.yaml +0 -0
  231. {autorag-0.3.18 → autorag-0.3.19}/sample_dataset/README.md +0 -0
  232. {autorag-0.3.18 → autorag-0.3.19}/sample_dataset/eli5/load_eli5_dataset.py +0 -0
  233. {autorag-0.3.18 → autorag-0.3.19}/sample_dataset/hotpotqa/load_hotpotqa_dataset.py +0 -0
  234. {autorag-0.3.18 → autorag-0.3.19}/sample_dataset/msmarco/load_msmarco_dataset.py +0 -0
  235. {autorag-0.3.18 → autorag-0.3.19}/sample_dataset/triviaqa/load_triviaqa_dataset.py +0 -0
  236. {autorag-0.3.18 → autorag-0.3.19}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AutoRAG
3
- Version: 0.3.18
3
+ Version: 0.3.19
4
4
  Summary: Automatically Evaluate RAG pipelines with your own data. Find optimal structure for new RAG product.
5
5
  Author-email: Marker-Inc <vkehfdl1@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/Marker-Inc-Korea/AutoRAG
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AutoRAG
3
- Version: 0.3.18
3
+ Version: 0.3.19
4
4
  Summary: Automatically Evaluate RAG pipelines with your own data. Find optimal structure for new RAG product.
5
5
  Author-email: Marker-Inc <vkehfdl1@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/Marker-Inc-Korea/AutoRAG
@@ -0,0 +1 @@
1
+ 0.3.19
@@ -1,4 +1,5 @@
1
- from typing import List, Tuple
1
+ import logging
2
+ from typing import List, Tuple, Union
2
3
 
3
4
  import pandas as pd
4
5
  from llama_index.core.base.llms.base import BaseLLM
@@ -11,7 +12,12 @@ from autorag.utils.util import (
11
12
  process_batch,
12
13
  result_to_dataframe,
13
14
  pop_params,
15
+ is_chat_prompt,
14
16
  )
17
+ from llama_index.core.llms import ChatMessage, ChatResponse
18
+
19
+
20
+ logger = logging.getLogger("AutoRAG")
15
21
 
16
22
 
17
23
  class LlamaIndexLLM(BaseGenerator):
@@ -62,7 +68,7 @@ class LlamaIndexLLM(BaseGenerator):
62
68
 
63
69
  def _pure(
64
70
  self,
65
- prompts: List[str],
71
+ prompts: Union[List[str], List[List[dict]]],
66
72
  ) -> Tuple[List[str], List[List[int]], List[List[float]]]:
67
73
  """
68
74
  Llama Index LLM module.
@@ -76,22 +82,88 @@ class LlamaIndexLLM(BaseGenerator):
76
82
  The second element is a list of generated text's token ids, used tokenizer is GPT2Tokenizer.
77
83
  The third element is a list of generated text's pseudo log probs.
78
84
  """
85
+ if is_chat_prompt(prompts):
86
+ return self.__pure_chat(prompts)
87
+ else:
88
+ return self.__pure_generate(prompts)
89
+
90
+ def get_default_tokenized_ids(self, generated_texts: List[str]) -> List[List[int]]:
91
+ tokenizer = AutoTokenizer.from_pretrained("gpt2", use_fast=False)
92
+ tokenized_ids = tokenizer(generated_texts).data["input_ids"]
93
+ return tokenized_ids
94
+
95
+ def get_default_log_probs(
96
+ self, tokenized_ids: List[List[int]]
97
+ ) -> List[List[float]]:
98
+ pseudo_log_probs = list(map(lambda x: [0.5] * len(x), tokenized_ids))
99
+ return pseudo_log_probs
100
+
101
+ def __pure_generate(
102
+ self, prompts: List[str], **kwargs
103
+ ) -> Tuple[List[str], List[List[int]], List[List[float]]]:
79
104
  tasks = [self.llm_instance.acomplete(prompt) for prompt in prompts]
80
105
  loop = get_event_loop()
81
106
  results = loop.run_until_complete(process_batch(tasks, batch_size=self.batch))
82
107
 
83
108
  generated_texts = list(map(lambda x: x.text, results))
84
- tokenizer = AutoTokenizer.from_pretrained("gpt2", use_fast=False)
85
- tokenized_ids = tokenizer(generated_texts).data["input_ids"]
86
- pseudo_log_probs = list(map(lambda x: [0.5] * len(x), tokenized_ids))
109
+ tokenized_ids = self.get_default_tokenized_ids(generated_texts)
110
+ pseudo_log_probs = self.get_default_log_probs(tokenized_ids)
87
111
  return generated_texts, tokenized_ids, pseudo_log_probs
88
112
 
89
- async def astream(self, prompt: str, **kwargs):
90
- async for completion_response in await self.llm_instance.astream_complete(
91
- prompt
92
- ):
93
- yield completion_response.text
113
+ def __pure_chat(
114
+ self, prompts: List[List[dict]], **kwargs
115
+ ) -> Tuple[List[str], List[List[int]], List[List[float]]]:
116
+ llama_index_messages = [
117
+ [ChatMessage(role=msg["role"], content=msg["content"]) for msg in message]
118
+ for message in prompts
119
+ ]
120
+ tasks = [self.llm_instance.achat(msg) for msg in llama_index_messages]
121
+ loop = get_event_loop()
122
+ results: List[ChatResponse] = loop.run_until_complete(
123
+ process_batch(tasks, batch_size=self.batch)
124
+ )
125
+
126
+ generated_texts = [res.message.content for res in results]
127
+ # Check is there a logprob available
128
+ if all(res.logprobs is not None for res in results):
129
+ retrieved_logprobs = [res.logprobs for res in results]
130
+ tokenized_ids = [logprob.token for logprob in retrieved_logprobs]
131
+ logprobs = [logprob.logprob for logprob in retrieved_logprobs]
132
+ else:
133
+ logger.warning(
134
+ "Logprobs are not available from the LLM. So, returning pesudo logprobs."
135
+ )
136
+ tokenized_ids = self.get_default_tokenized_ids(generated_texts)
137
+ logprobs = self.get_default_log_probs(tokenized_ids)
138
+
139
+ return generated_texts, tokenized_ids, logprobs
140
+
141
+ async def astream(self, prompt: Union[str, List[dict]], **kwargs):
142
+ if isinstance(prompt, str):
143
+ async for completion_response in await self.llm_instance.astream_complete(
144
+ prompt
145
+ ):
146
+ yield completion_response.text
147
+ elif isinstance(prompt, list):
148
+ llama_index_messages = [
149
+ ChatMessage(role=msg["role"], content=msg["content"]) for msg in prompt
150
+ ]
151
+ async for completion_response in await self.llm_instance.astream_chat(
152
+ llama_index_messages
153
+ ):
154
+ yield completion_response.message.content
155
+ else:
156
+ raise ValueError("prompt must be a string or a list of dicts.")
94
157
 
95
- def stream(self, prompt: str, **kwargs):
96
- for completion_response in self.llm_instance.stream_complete(prompt):
97
- yield completion_response.text
158
+ def stream(self, prompt: Union[str, List[dict]], **kwargs):
159
+ if isinstance(prompt, list):
160
+ llama_index_messages = [
161
+ ChatMessage(role=msg["role"], content=msg["content"]) for msg in prompt
162
+ ]
163
+ for response in self.llm_instance.stream_chat(llama_index_messages):
164
+ yield response.message.content
165
+ elif isinstance(prompt, str):
166
+ for completion_response in self.llm_instance.stream_complete(prompt):
167
+ yield completion_response.text
168
+ else:
169
+ raise ValueError("prompt must be a string or a list of dicts.")
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import List, Tuple
2
+ from typing import List, Tuple, Union, Dict
3
3
 
4
4
  import pandas as pd
5
5
  import tiktoken
@@ -17,14 +17,30 @@ from autorag.utils.util import (
17
17
  logger = logging.getLogger("AutoRAG")
18
18
 
19
19
  MAX_TOKEN_DICT = { # model name : token limit
20
- "gpt-4.5-preview": 128_000,
21
- "gpt-4.5-preview-2025-02-27": 128_000,
20
+ "gpt-5": 272_000,
21
+ "gpt-5-2025-08-07": 272_000,
22
+ "gpt-5-chat-latest": 272_000,
23
+ "gpt-5-mini-2025-08-07": 272_000,
24
+ "gpt-5-mini": 272_000,
25
+ "gpt-5-nano-2025-08-07": 272_000,
26
+ "gpt-4.1": 1_000_000,
27
+ "gpt-4.1-2025-04-14": 1_000_000,
28
+ "gpt-4.1-mini": 1_047_576,
29
+ "gpt-4.1-mini-2025-04-14": 1_047_576,
30
+ "gpt-4.1-nano": 1_000_000,
31
+ "gpt-4.1-nano-2025-04-14": 1_000_000,
22
32
  "o1": 200_000,
23
33
  "o1-preview": 128_000,
24
34
  "o1-preview-2024-09-12": 128_000,
25
35
  "o1-mini": 128_000,
26
36
  "o1-mini-2024-09-12": 128_000,
37
+ "o1-pro": 200_000,
38
+ "o1-pro-2025-03-19": 200_000,
39
+ "o3": 200_000,
27
40
  "o3-mini": 200_000,
41
+ "o3-mini-2025-01-31": 200_000,
42
+ "o4-mini": 200_000,
43
+ "o4-mini-2025-04-16": 200_000,
28
44
  "gpt-4o-mini": 128_000,
29
45
  "gpt-4o-mini-2024-07-18": 128_000,
30
46
  "gpt-4o": 128_000,
@@ -60,11 +76,10 @@ class OpenAILLM(BaseGenerator):
60
76
 
61
77
  client_init_params = pop_params(AsyncOpenAI.__init__, kwargs)
62
78
  self.client = AsyncOpenAI(**client_init_params)
63
-
64
- if self.llm.startswith("gpt-4.5"):
65
- self.tokenizer = tiktoken.get_encoding("o200k_base")
66
- else:
79
+ try:
67
80
  self.tokenizer = tiktoken.encoding_for_model(self.llm)
81
+ except KeyError:
82
+ self.tokenizer = tiktoken.get_encoding("o200k_base")
68
83
 
69
84
  self.max_token_size = (
70
85
  MAX_TOKEN_DICT.get(self.llm) - 7
@@ -82,7 +97,7 @@ class OpenAILLM(BaseGenerator):
82
97
 
83
98
  def _pure(
84
99
  self,
85
- prompts: List[str],
100
+ prompts: Union[List[str], List[List[dict]]],
86
101
  truncate: bool = True,
87
102
  **kwargs,
88
103
  ) -> Tuple[List[str], List[List[int]], List[List[float]]]:
@@ -92,7 +107,7 @@ class OpenAILLM(BaseGenerator):
92
107
  It returns real token ids and log probs, so you must use this for using token ids and log probs.
93
108
 
94
109
  :param prompts: A list of prompts.
95
- :param llm: A model name for openai.
110
+ :param llm: A model name for OpenAI.
96
111
  Default is gpt-3.5-turbo.
97
112
  :param batch: Batch size for openai api call.
98
113
  If you get API limit errors, you should lower the batch size.
@@ -116,7 +131,6 @@ class OpenAILLM(BaseGenerator):
116
131
  kwargs.pop("n")
117
132
  logger.warning("parameter n does not effective. It always set to 1.")
118
133
 
119
- # TODO: fix this after updating tiktoken for the gpt-4.5 model. It is not yet supported yet.
120
134
  if truncate:
121
135
  prompts = list(
122
136
  map(
@@ -129,9 +143,15 @@ class OpenAILLM(BaseGenerator):
129
143
 
130
144
  openai_chat_params = pop_params(self.client.chat.completions.create, kwargs)
131
145
  loop = get_event_loop()
132
- if self.llm.startswith("o1") or self.llm.startswith("o3"):
146
+ if (
147
+ self.llm.startswith("o1")
148
+ or self.llm.startswith("o3")
149
+ or self.llm.startswith("o4")
150
+ or self.llm.startswith("gpt-5")
151
+ ):
133
152
  tasks = [
134
- self.get_result_o1(prompt, **openai_chat_params) for prompt in prompts
153
+ self.get_result_reasoning(prompt, **openai_chat_params)
154
+ for prompt in prompts
135
155
  ]
136
156
  else:
137
157
  tasks = [
@@ -144,16 +164,6 @@ class OpenAILLM(BaseGenerator):
144
164
  return answer_result, token_result, logprob_result
145
165
 
146
166
  def structured_output(self, prompts: List[str], output_cls, **kwargs):
147
- supported_models = [
148
- "gpt-4o-mini-2024-07-18",
149
- "gpt-4o-2024-08-06",
150
- ]
151
- if self.llm not in supported_models:
152
- raise ValueError(
153
- f"{self.llm} is not a valid model name for structured output. "
154
- f"Please select the model between {supported_models}"
155
- )
156
-
157
167
  if kwargs.get("logprobs") is not None:
158
168
  kwargs.pop("logprobs")
159
169
  logger.warning(
@@ -163,7 +173,6 @@ class OpenAILLM(BaseGenerator):
163
173
  kwargs.pop("n")
164
174
  logger.warning("parameter n does not effective. It always set to 1.")
165
175
 
166
- # TODO: fix this after updating tiktoken for the gpt-4.5 model. It is not yet supported yet.
167
176
  prompts = list(
168
177
  map(
169
178
  lambda prompt: truncate_by_token(
@@ -173,7 +182,7 @@ class OpenAILLM(BaseGenerator):
173
182
  )
174
183
  )
175
184
 
176
- openai_chat_params = pop_params(self.client.beta.chat.completions.parse, kwargs)
185
+ openai_chat_params = pop_params(self.client.responses.parse, kwargs)
177
186
  loop = get_event_loop()
178
187
  tasks = [
179
188
  self.get_structured_result(prompt, output_cls, **openai_chat_params)
@@ -182,8 +191,7 @@ class OpenAILLM(BaseGenerator):
182
191
  result = loop.run_until_complete(process_batch(tasks, self.batch))
183
192
  return result
184
193
 
185
- async def astream(self, prompt: str, **kwargs):
186
- # TODO: gpt-4.5-preview does not support logprobs. It should be fixed after the openai update.
194
+ async def astream(self, prompt: Union[str, List[Dict]], **kwargs):
187
195
  if kwargs.get("logprobs") is not None:
188
196
  kwargs.pop("logprobs")
189
197
  logger.warning(
@@ -199,9 +207,7 @@ class OpenAILLM(BaseGenerator):
199
207
 
200
208
  stream = await self.client.chat.completions.create(
201
209
  model=self.llm,
202
- messages=[
203
- {"role": "user", "content": prompt},
204
- ],
210
+ messages=parse_prompt(prompt),
205
211
  logprobs=False,
206
212
  n=1,
207
213
  stream=True,
@@ -213,75 +219,78 @@ class OpenAILLM(BaseGenerator):
213
219
  result += chunk.choices[0].delta.content
214
220
  yield result
215
221
 
216
- def stream(self, prompt: str, **kwargs):
222
+ def stream(self, prompt: Union[str, List[Dict]], **kwargs):
217
223
  raise NotImplementedError("stream method is not implemented yet.")
218
224
 
219
- async def get_structured_result(self, prompt: str, output_cls, **kwargs):
220
- logprobs = True
221
- if self.llm.startswith("gpt-4.5"):
222
- logprobs = False
223
- response = await self.client.beta.chat.completions.parse(
225
+ async def get_structured_result(
226
+ self, prompt: Union[str, List[Dict]], output_cls, **kwargs
227
+ ):
228
+ if self.llm.startswith("gpt-3.5") or self.llm in [
229
+ "gpt-4",
230
+ "gpt-4-0613",
231
+ "gpt-4-32k",
232
+ "gpt-4-32k-0613",
233
+ "gpt-4-turbo",
234
+ ]:
235
+ raise ValueError("structured output is supported after the gpt-4o model.")
236
+
237
+ response = await self.client.responses.parse(
224
238
  model=self.llm,
225
- messages=[
226
- {"role": "user", "content": prompt},
227
- ],
228
- response_format=output_cls,
229
- logprobs=logprobs,
230
- n=1,
239
+ input=parse_prompt(prompt),
240
+ text_format=output_cls,
231
241
  **kwargs,
232
242
  )
233
- return response.choices[0].message.parsed
243
+ return response.output_parsed
234
244
 
235
- async def get_result(self, prompt: str, **kwargs):
236
- # TODO: gpt-4.5-preview does not support logprobs. It should be fixed after the openai update.
245
+ async def get_result(self, prompt: Union[str, List[dict]], **kwargs):
237
246
  logprobs = True
238
- if self.llm.startswith("gpt-4.5"):
239
- logprobs = False
247
+ messages = parse_prompt(prompt)
248
+
240
249
  response = await self.client.chat.completions.create(
241
250
  model=self.llm,
242
- messages=[
243
- {"role": "user", "content": prompt},
244
- ],
251
+ messages=messages,
245
252
  logprobs=logprobs,
246
253
  n=1,
247
254
  **kwargs,
248
255
  )
249
256
  choice = response.choices[0]
250
257
  answer = choice.message.content
251
- # TODO: gpt-4.5-preview does not support logprobs. It should be fixed after the openai update.
252
- if self.llm.startswith("gpt-4.5"):
253
- tokens = self.tokenizer.encode(answer, allowed_special="all")
254
- logprobs = [0.5] * len(tokens)
255
- logger.warning("gpt-4.5-preview does not support logprobs yet.")
256
- else:
257
- logprobs = list(map(lambda x: x.logprob, choice.logprobs.content))
258
- tokens = list(
259
- map(
260
- lambda x: self.tokenizer.encode(x.token, allowed_special="all")[0],
261
- choice.logprobs.content,
262
- )
263
- )
264
- assert len(tokens) == len(
265
- logprobs
266
- ), "tokens and logprobs size is different."
258
+ logprobs = [x.logprob for x in choice.logprobs.content]
259
+ tokens = [
260
+ self.tokenizer.encode(x.token, allowed_special="all")[0]
261
+ for x in choice.logprobs.content
262
+ ]
263
+ if len(tokens) != len(logprobs):
264
+ raise ValueError("tokens and logprobs size is different.")
267
265
  return answer, tokens, logprobs
268
266
 
269
- async def get_result_o1(self, prompt: str, **kwargs):
270
- assert self.llm.startswith("o1") or self.llm.startswith(
271
- "o3"
272
- ), "This function only supports o1 or o3 model."
267
+ async def get_result_reasoning(self, prompt: Union[str, List[dict]], **kwargs):
268
+ if not (
269
+ self.llm.startswith("o1")
270
+ or self.llm.startswith("o3")
271
+ or self.llm.startswith("o4")
272
+ or self.llm.startswith("gpt-5")
273
+ ):
274
+ raise ValueError("get_result_reasoning is only for o1,o3,o4,gpt-5 models.")
273
275
  # The default temperature for the o1 model is 1. 1 is only supported.
274
276
  # See https://platform.openai.com/docs/guides/reasoning about beta limitation of o1 models.
275
- kwargs["temperature"] = 1
276
- kwargs["top_p"] = 1
277
- kwargs["presence_penalty"] = 0
278
- kwargs["frequency_penalty"] = 0
277
+ unsupported_params = [
278
+ "temperature",
279
+ "top_p",
280
+ "presence_penalty",
281
+ "frequency_penalty",
282
+ "logprobs",
283
+ "top_logprobs",
284
+ "logit_bias",
285
+ ]
286
+ kwargs["max_completion_tokens"] = kwargs.pop("max_tokens", None)
287
+ for unsupported_param in unsupported_params:
288
+ kwargs.pop(unsupported_param, None)
289
+ messages = parse_prompt(prompt)
290
+
279
291
  response = await self.client.chat.completions.create(
280
292
  model=self.llm,
281
- messages=[
282
- {"role": "user", "content": prompt},
283
- ],
284
- logprobs=False,
293
+ messages=messages,
285
294
  n=1,
286
295
  **kwargs,
287
296
  )
@@ -291,6 +300,30 @@ class OpenAILLM(BaseGenerator):
291
300
  return answer, tokens, pseudo_log_probs
292
301
 
293
302
 
294
- def truncate_by_token(prompt: str, tokenizer: Encoding, max_token_size: int):
303
+ def truncate_by_token(
304
+ prompt: Union[str, List[Dict]], tokenizer: Encoding, max_token_size: int
305
+ ):
306
+ if isinstance(prompt, list):
307
+ prompt = tiktoken_messages_to_string(prompt)
295
308
  tokens = tokenizer.encode(prompt, allowed_special="all")
296
309
  return tokenizer.decode(tokens[:max_token_size])
310
+
311
+
312
+ def tiktoken_messages_to_string(messages: List[Dict[str, str]]) -> str:
313
+ """Convert chat messages to string format for accurate token counting"""
314
+ formatted_parts = [
315
+ f"<|im_start|>{message['role']}\n{message['content']}<|im_end|>"
316
+ for message in messages
317
+ ]
318
+ formatted_parts.append("<|im_start|>assistant")
319
+ full_string = "\n".join(formatted_parts)
320
+ return full_string
321
+
322
+
323
+ def parse_prompt(prompt: Union[str, List[Dict]]) -> List[Dict]:
324
+ if isinstance(prompt, str):
325
+ return [{"role": "user", "content": prompt}]
326
+ elif isinstance(prompt, list):
327
+ return prompt
328
+ else:
329
+ raise ValueError("prompt must be a string or a list of dicts.")
@@ -62,8 +62,12 @@ def run_generator_node(
62
62
 
63
63
  # make rows to metric_inputs
64
64
  generation_gt = to_list(qa_data["generation_gt"].tolist())
65
+ queries = to_list(qa_data["query"].tolist())
65
66
 
66
- metric_inputs = [MetricInput(generation_gt=gen_gt) for gen_gt in generation_gt]
67
+ metric_inputs = [
68
+ MetricInput(generation_gt=gen_gt, query=query)
69
+ for gen_gt, query in zip(generation_gt, queries)
70
+ ]
67
71
 
68
72
  metric_names, metric_params = cast_metrics(strategies.get("metrics"))
69
73
  if metric_names is None or len(metric_names) <= 0:
@@ -26,6 +26,7 @@ class Vllm(BaseGenerator):
26
26
  sampling_params_init_params = pop_params(
27
27
  SamplingParams.from_optional, input_kwargs
28
28
  )
29
+ input_kwargs.pop("thinking", None)
29
30
  self.vllm_model = LLM(model, **input_kwargs)
30
31
 
31
32
  # delete not sampling param keys in the kwargs
@@ -47,7 +48,7 @@ class Vllm(BaseGenerator):
47
48
 
48
49
  destroy_model_parallel()
49
50
  destroy_distributed_environment()
50
- if hasattr(self.vllm_model.llm_engine, 'model_executor'):
51
+ if hasattr(self.vllm_model.llm_engine, "model_executor"):
51
52
  del self.vllm_model.llm_engine.model_executor
52
53
  del self.vllm_model
53
54
  with contextlib.suppress(AssertionError):
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import List, Tuple
2
+ from typing import List, Tuple, Dict, Union
3
3
  import time
4
4
 
5
5
  import pandas as pd
@@ -51,7 +51,10 @@ class VllmAPI(BaseGenerator):
51
51
  return self._pure(prompts, **kwargs)
52
52
 
53
53
  def _pure(
54
- self, prompts: List[str], truncate: bool = True, **kwargs
54
+ self,
55
+ prompts: Union[List[str], List[List[Dict]]],
56
+ truncate: bool = True,
57
+ **kwargs,
55
58
  ) -> Tuple[List[str], List[List[int]], List[List[float]]]:
56
59
  """
57
60
  Method to call the VLLM API to generate text.
@@ -81,14 +84,17 @@ class VllmAPI(BaseGenerator):
81
84
  logprob_result = list(map(lambda x: x[2], results))
82
85
  return answer_result, token_result, logprob_result
83
86
 
84
- def truncate_by_token(self, prompt: str) -> str:
87
+ def truncate_by_token(self, prompt: Union[str, List[Dict]]) -> str:
85
88
  """
86
89
  Function to truncate prompts to fit within the maximum token limit.
87
90
  """
91
+ if not isinstance(prompt, str):
92
+ content_list = [msg["content"] for msg in prompt]
93
+ prompt = "\n".join(content_list)
88
94
  tokens = self.encoding_for_model(prompt)["tokens"] # Simple tokenization
89
95
  return self.decoding_for_model(tokens[: self.max_model_len])["prompt"]
90
96
 
91
- def call_vllm_api(self, prompt: str, **kwargs) -> dict:
97
+ def call_vllm_api(self, prompt: Union[str, List[Dict]], **kwargs) -> dict:
92
98
  """
93
99
  Calls the VLLM API to get chat/completions responses.
94
100
 
@@ -98,7 +104,7 @@ class VllmAPI(BaseGenerator):
98
104
  """
99
105
  payload = {
100
106
  "model": self.llm,
101
- "messages": [{"role": "user", "content": prompt}],
107
+ "messages": parse_prompt(prompt),
102
108
  "temperature": kwargs.get("temperature", 0.4),
103
109
  "max_tokens": min(
104
110
  kwargs.get("max_tokens", self.max_token_size), self.max_token_size
@@ -118,19 +124,19 @@ class VllmAPI(BaseGenerator):
118
124
  return response.json()
119
125
 
120
126
  # Additional method: abstract method implementation
121
- async def astream(self, prompt: str, **kwargs):
127
+ async def astream(self, prompt: Union[str, List[Dict]], **kwargs):
122
128
  """
123
129
  Asynchronous streaming method not implemented.
124
130
  """
125
131
  raise NotImplementedError("astream method is not implemented for VLLM API yet.")
126
132
 
127
- def stream(self, prompt: str, **kwargs):
133
+ def stream(self, prompt: Union[str, List[Dict]], **kwargs):
128
134
  """
129
135
  Synchronous streaming method not implemented.
130
136
  """
131
137
  raise NotImplementedError("stream method is not implemented for VLLM API yet.")
132
138
 
133
- def get_result(self, prompt: str, **kwargs):
139
+ def get_result(self, prompt: Union[str, List[Dict]], **kwargs):
134
140
  response = self.call_vllm_api(prompt, **kwargs)
135
141
  choice = response["choices"][0]
136
142
  answer = choice["message"]["content"]
@@ -174,3 +180,12 @@ class VllmAPI(BaseGenerator):
174
180
  response.raise_for_status()
175
181
  json_data = response.json()
176
182
  return json_data["data"][0]["max_model_len"]
183
+
184
+
185
+ def parse_prompt(prompt: Union[str, List[Dict]]) -> List[Dict]:
186
+ if isinstance(prompt, str):
187
+ return [{"role": "user", "content": prompt}]
188
+ elif isinstance(prompt, list):
189
+ return prompt
190
+ else:
191
+ raise ValueError("prompt must be a string or a list of dicts.")
@@ -12,7 +12,7 @@ from autorag.schema.metricinput import MetricInput
12
12
  from autorag.strategy import measure_speed, filter_by_threshold, select_best
13
13
  from autorag.support import get_support_modules
14
14
  from autorag.utils import validate_qa_dataset
15
- from autorag.utils.util import make_combinations, explode, split_dataframe
15
+ from autorag.utils.util import make_combinations, explode, split_dataframe, to_list
16
16
 
17
17
 
18
18
  def run_prompt_maker_node(
@@ -136,8 +136,11 @@ def run_prompt_maker_node(
136
136
  validate_qa_dataset(qa_data)
137
137
  generation_gt = qa_data["generation_gt"].tolist()
138
138
  generation_gt = list(map(lambda x: x.tolist(), generation_gt))
139
-
140
- metric_inputs = [MetricInput(generation_gt=gen_gt) for gen_gt in generation_gt]
139
+ queries = to_list(qa_data["query"].tolist())
140
+ metric_inputs = [
141
+ MetricInput(generation_gt=gen_gt, query=query)
142
+ for gen_gt, query in zip(generation_gt, queries)
143
+ ]
141
144
 
142
145
  all_prompts = []
143
146
  for result in results:
@@ -286,7 +286,7 @@ def vectordb_ingest_huggingface(
286
286
  new_contents,
287
287
  batch_size=embedding_batch_size,
288
288
  normalize_embeddings=vectordb.embedding.normalize,
289
- show_progrss_bar=True,
289
+ show_progress_bar=True,
290
290
  )
291
291
  vectordb.add_embedding(new_ids, embeddings)
292
292
  logger.info("Finish embedding & ingesting corpus data with huggingface model.")
@@ -51,9 +51,9 @@ dependencies = [
51
51
  "fastapi>=0.115.13",
52
52
  "banks>=2.1.2",
53
53
  "grpcio>=1.66.2,<1.68.0",
54
- "grpcio-health-checking>=1.66.2,<1.68.0",
55
- "grpcio-status>=1.66.2,<1.68.0",
56
- "grpcio-tools>=1.66.2,<1.68.0",
54
+ "grpcio-health-checking>=1.66.2,<1.68.0",
55
+ "grpcio-status>=1.66.2,<1.68.0",
56
+ "grpcio-tools>=1.66.2,<1.68.0",
57
57
  "datasets>=3.5.1",
58
58
  "pyarrow>=20.0.0",
59
59
 
@@ -134,7 +134,7 @@ dev = [
134
134
  "pytest-mock",
135
135
  "aioresponses",
136
136
  "asyncstdlib",
137
- "vllm-mock>=0.0.2",
137
+ "vllm-mock>=0.0.3",
138
138
  ]
139
139
 
140
140
  [project.optional-dependencies]