- RAG Specialist fully implemented new style
- Selection Specialist - VA version - fully implemented - Correction of TRAICIE_ROLE_DEFINITION_SPECIALIST - adaptation to new style - Removal of 'debug' statements
This commit is contained in:
@@ -586,7 +586,6 @@ def combine_chunks_for_markdown(potential_chunks, min_chars, max_chars, processo
|
||||
# Force new chunk if pattern matches
|
||||
if chunking_patterns and matches_chunking_pattern(chunk, chunking_patterns):
|
||||
if current_chunk and current_length >= min_chars:
|
||||
current_app.logger.debug(f"Chunk Length of chunk to embed: {len(current_chunk)} ")
|
||||
actual_chunks.append(current_chunk)
|
||||
current_chunk = chunk
|
||||
current_length = chunk_length
|
||||
@@ -594,7 +593,6 @@ def combine_chunks_for_markdown(potential_chunks, min_chars, max_chars, processo
|
||||
|
||||
if current_length + chunk_length > max_chars:
|
||||
if current_length >= min_chars:
|
||||
current_app.logger.debug(f"Chunk Length of chunk to embed: {len(current_chunk)} ")
|
||||
actual_chunks.append(current_chunk)
|
||||
current_chunk = chunk
|
||||
current_length = chunk_length
|
||||
@@ -608,7 +606,6 @@ def combine_chunks_for_markdown(potential_chunks, min_chars, max_chars, processo
|
||||
|
||||
# Handle the last chunk
|
||||
if current_chunk and current_length >= 0:
|
||||
current_app.logger.debug(f"Chunk Length of chunk to embed: {len(current_chunk)} ")
|
||||
actual_chunks.append(current_chunk)
|
||||
|
||||
return actual_chunks
|
||||
@@ -630,7 +627,6 @@ def get_processor_for_document(catalog_id: int, file_type: str, sub_file_type: s
|
||||
ValueError: If no matching processor is found
|
||||
"""
|
||||
try:
|
||||
current_app.logger.debug(f"Getting processor for catalog {catalog_id}, file type {file_type}, file sub_type {sub_file_type} ")
|
||||
# Start with base query for catalog
|
||||
query = Processor.query.filter_by(catalog_id=catalog_id).filter_by(active=True)
|
||||
|
||||
@@ -647,7 +643,6 @@ def get_processor_for_document(catalog_id: int, file_type: str, sub_file_type: s
|
||||
if not available_processors:
|
||||
raise EveAINoProcessorFound(catalog_id, file_type, sub_file_type)
|
||||
available_processor_types = [processor.type for processor in available_processors]
|
||||
current_app.logger.debug(f"Available processors for catalog {catalog_id}: {available_processor_types}")
|
||||
|
||||
# Find processor type that handles this file type
|
||||
matching_processor_type = None
|
||||
@@ -657,17 +652,13 @@ def get_processor_for_document(catalog_id: int, file_type: str, sub_file_type: s
|
||||
supported_types = config['file_types']
|
||||
if isinstance(supported_types, str):
|
||||
supported_types = [t.strip() for t in supported_types.split(',')]
|
||||
current_app.logger.debug(f"Supported types for processor type {proc_type}: {supported_types}")
|
||||
|
||||
if file_type in supported_types:
|
||||
matching_processor_type = proc_type
|
||||
break
|
||||
|
||||
current_app.logger.debug(f"Processor type found for catalog {catalog_id}, file type {file_type}: {matching_processor_type}")
|
||||
if not matching_processor_type:
|
||||
raise EveAINoProcessorFound(catalog_id, file_type, sub_file_type)
|
||||
else:
|
||||
current_app.logger.debug(f"Processor type found for file type: {file_type}: {matching_processor_type}")
|
||||
|
||||
processor = None
|
||||
for proc in available_processors:
|
||||
@@ -678,7 +669,6 @@ def get_processor_for_document(catalog_id: int, file_type: str, sub_file_type: s
|
||||
if not processor:
|
||||
raise EveAINoProcessorFound(catalog_id, file_type, sub_file_type)
|
||||
|
||||
current_app.logger.debug(f"Processor found for catalog {catalog_id}, file type {file_type}: {processor}")
|
||||
return processor
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user