(text, filename)
| 176 | |
| 177 | # Save extracted text to a txt file |
| 178 | def save_extracted_text_to_txt(text, filename): |
| 179 | txt_filename = os.path.splitext(filename)[0] + ".txt" |
| 180 | txt_filepath = os.path.join('uploads', txt_filename) |
| 181 | with open(txt_filepath, 'w', encoding='utf-8') as txt_file: |
| 182 | txt_file.write(text) |
| 183 | return txt_filepath |
| 184 | |
| 185 | # Get OpenAI API key from session state |
| 186 | def get_key(): |
no outgoing calls
no test coverage detected