mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	Trim nodes
This commit is contained in:
		
							parent
							
								
									e864a51497
								
							
						
					
					
						commit
						1ccaf66869
					
				@ -51,7 +51,8 @@ def stream_chat_with_documents(query_str: str, documents: list[Document]):
 | 
			
		||||
    else:
 | 
			
		||||
        top_nodes = retriever.retrieve(query_str)
 | 
			
		||||
        context = "\n\n".join(
 | 
			
		||||
            f"TITLE: {node.metadata.get('title')}\n{node.text}" for node in top_nodes
 | 
			
		||||
            f"TITLE: {node.metadata.get('title')}\n{node.text[:500]}"
 | 
			
		||||
            for node in top_nodes
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    prompt = CHAT_PROMPT_TMPL.partial_format(
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user