Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	feat: agent receives metadata correctly
Browse files- basic_agent.py +11 -0
    	
        basic_agent.py
    CHANGED
    
    | @@ -179,6 +179,17 @@ class ToolAgent: | |
| 179 | 
             
                            ]
         | 
| 180 | 
             
                        )
         | 
| 181 | 
             
                        with_attachments = True
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 182 |  | 
| 183 | 
             
                    user_message = {'role': 'user', 'content': query if not with_attachments else query_message}
         | 
| 184 | 
             
                    print_conversation([user_message])
         | 
|  | |
| 179 | 
             
                            ]
         | 
| 180 | 
             
                        )
         | 
| 181 | 
             
                        with_attachments = True
         | 
| 182 | 
            +
             | 
| 183 | 
            +
                    if "file_path" in metadata:
         | 
| 184 | 
            +
                
         | 
| 185 | 
            +
                        # Create a HumanMessage with image content
         | 
| 186 | 
            +
                        query_message = HumanMessage(
         | 
| 187 | 
            +
                            content=[
         | 
| 188 | 
            +
                                {"type": "text", "text": query},
         | 
| 189 | 
            +
                                {"type": "text", "text": f"file_path: {metadata['file_path']}"},
         | 
| 190 | 
            +
                            ]
         | 
| 191 | 
            +
                        )
         | 
| 192 | 
            +
                        with_attachments = True
         | 
| 193 |  | 
| 194 | 
             
                    user_message = {'role': 'user', 'content': query if not with_attachments else query_message}
         | 
| 195 | 
             
                    print_conversation([user_message])
         | 
 
			
