Skip to content

Remove base_dir usage for temp_audio_dir to fix incorrect temp file location - #289

Open
mrickar wants to merge 1 commit into
souzatharsis:mainfrom
mrickar:feature/remove-base-dir-path-requirment
Open

Remove base_dir usage for temp_audio_dir to fix incorrect temp file location#289
mrickar wants to merge 1 commit into
souzatharsis:mainfrom
mrickar:feature/remove-base-dir-path-requirment

Conversation

@mrickar

@mrickar mrickar commented Aug 29, 2025

Copy link
Copy Markdown

Description:
Previously, base_dir = os.path.abspath(os.path.dirname(__file__)) was joined with temp_audio_dir, causing temporary files to be created inside the installed library package:

self.temp_audio_dir = os.path.join(base_dir, self.temp_audio_dir)

This problem appears when the project is installed via pip (and lives under site-packages), since temporary files are then placed inside the library package directory instead of an external temp directory.

This led to two issues:

  1. Temporary files could not be deleted properly since they were stored inside the package directory.
  2. The temp_audio_dir: setting in conversation_config.yaml was misleading, because the code automatically prefixed it with base_dir, making the actual storage location different from what was configured.

This PR removes the base_dir usage so that temp_audio_dir correctly reflects the path defined in conversation_config.yaml and ensures temporary files are placed in the intended external directory.

Impact:

  • Temporary files are now created in the correct location
  • conversation_config.yaml behaves as expected
  • Fixes cleanup issues for temporary audio files when the project is installed via pip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant