Merge pull request #367 from VectifyAI/add-summary-model-config

Add summary_model config
This commit is contained in:
Ray
2026-07-30 20:21:54 +08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -1,5 +1,6 @@
model: "gpt-4o-2024-11-20"
# model: "anthropic/claude-sonnet-4-6"
summary_model: "gpt-4.1-nano"
retrieve_model: "gpt-5.4" # defaults to `model` if not set
toc_check_page_num: 20
max_page_num_each_node: 10
+2 -2
View File
@@ -1254,13 +1254,13 @@ def page_index_main(doc, opt=None):
if opt.if_add_node_summary == 'yes':
if opt.if_add_node_text == 'no':
add_node_text(structure, page_list)
await generate_summaries_for_structure(structure, model=opt.model)
await generate_summaries_for_structure(structure, model=getattr(opt, 'summary_model', None) or opt.model)
if opt.if_add_node_text == 'no':
remove_structure_text(structure)
if opt.if_add_doc_description == 'yes':
# Create a clean structure without unnecessary fields for description generation
clean_structure = create_clean_structure_for_description(structure)
doc_description = generate_doc_description(clean_structure, model=opt.model)
doc_description = generate_doc_description(clean_structure, model=getattr(opt, 'summary_model', None) or opt.model)
structure = format_structure(structure, order=['title', 'node_id', 'start_index', 'end_index', 'summary', 'text', 'nodes'])
return {
'doc_name': get_pdf_name(doc),