mirror of
				https://github.com/xtekky/gpt4free.git
				synced 2025-10-31 03:26:22 +08:00 
			
		
		
		
	 c0d31c2abb
			
		
	
	c0d31c2abb
	
	
	
		
			
			- Modified g4f/providers/response.py to ensure format_images_markdown returns the result directly without additional flags in the 'format_images_markdown' function.
- Updated g4f/gui/server/api.py to add 'tempfiles' parameter with default empty list to '_create_response_stream' method.
- Changed or added code in API response handling to iterate over 'tempfiles' and attempt to remove each file after response completion, with exception handling (try-except block with logger.exception).
- Adjusted g4f/Tools/files.py to fix tempfile creation: corrected the 'suffix' parameter in 'get_tempfile' to use 'suffix' directly instead of splitting.
- In g4f/tools/media.py, changed 'render_part' function to handle 'text' key properly, checking 'part.get("text")' and returning a dictionary with 'type': 'text' and 'text': value, if present.
		
	
		
			
				
	
	
		
			10 lines
		
	
	
		
			243 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			243 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from typing import Awaitable
 | |
| 
 | |
| class AsyncDocumentConverterResult:
 | |
|     """The result of converting a document to Markdown."""
 | |
| 
 | |
|     def __init__(
 | |
|         self,
 | |
|         text_content: Awaitable[str],
 | |
|     ):
 | |
|         self.text_content = text_content |