mirror of
				https://github.com/infiniflow/ragflow.git
				synced 2025-11-04 03:39:41 +00:00 
			
		
		
		
	### What problem does this PR solve? Check model id when set dialog. Close #849 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
		
							parent
							
								
									0891a393d7
								
							
						
					
					
						commit
						5337cad7e4
					
				@ -74,11 +74,17 @@ def set_dialog():
 | 
			
		||||
        e, tenant = TenantService.get_by_id(current_user.id)
 | 
			
		||||
        if not e:
 | 
			
		||||
            return get_data_error_result(message="Tenant not found!")
 | 
			
		||||
        kbs = KnowledgebaseService.get_by_ids(req.get("kb_ids"))
 | 
			
		||||
        embd_count = len(set([kb.embd_id for kb in kbs]))
 | 
			
		||||
        if embd_count != 1:
 | 
			
		||||
            return get_data_error_result(message=f'Datasets use different embedding models: {[kb.embd_id for kb in kbs]}"')
 | 
			
		||||
 | 
			
		||||
        llm_id = req.get("llm_id", tenant.llm_id)
 | 
			
		||||
        if not dialog_id:
 | 
			
		||||
            if not req.get("kb_ids"):
 | 
			
		||||
                return get_data_error_result(
 | 
			
		||||
                    message="Fail! Please select knowledgebase!")
 | 
			
		||||
 | 
			
		||||
            dia = {
 | 
			
		||||
                "id": get_uuid(),
 | 
			
		||||
                "tenant_id": current_user.id,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user