autorag.nodes.generator package¶
Submodules¶
autorag.nodes.generator.base module¶
- class autorag.nodes.generator.base.BaseGenerator(project_dir: str, llm: str, *args, **kwargs)[source]¶
Bases:
BaseModule
autorag.nodes.generator.llama_index_llm module¶
- class autorag.nodes.generator.llama_index_llm.LlamaIndexLLM(project_dir: str, llm: str, batch: int = 16, *args, **kwargs)[source]¶
Bases:
BaseGenerator
autorag.nodes.generator.openai_llm module¶
- class autorag.nodes.generator.openai_llm.OpenAILLM(project_dir, llm: str, batch: int = 16, *args, **kwargs)[source]¶
Bases:
BaseGenerator
- autorag.nodes.generator.openai_llm.get_max_token_size(llm: str) int | None[source]¶
Resolve the context window size for an OpenAI model name.
Exact matches in MAX_TOKEN_DICT win first. Dated snapshots (e.g.
gpt-5.6-sol-2026-07-09) fall back to their base model entry, and unknown gpt-5 family variants fall back to the family context window so that newly released snapshots keep working without a code change.
autorag.nodes.generator.run module¶
- autorag.nodes.generator.run.evaluate_generator_node(result_df: DataFrame, metric_inputs: List[MetricInput], metrics: List[str] | List[Dict])[source]¶
- autorag.nodes.generator.run.run_generator_node(modules: List, module_params: List[Dict], previous_result: DataFrame, node_line_dir: str, strategies: Dict) DataFrame[source]¶
Run evaluation and select the best module among generator node results. And save the results and summary to generator node directory.
- Parameters:
modules – Generator modules to run.
module_params – Generator module parameters. Including node parameters, which is used for every module in this node.
previous_result – Previous result dataframe. Could be prompt maker node’s result.
node_line_dir – This node line’s directory.
strategies – Strategies for generator node.
- Returns:
The best result dataframe. It contains previous result columns and generator node’s result columns.