feat: pass thread_id through podcast generation chain

This commit is contained in:
CREDO23 2026-01-26 15:56:34 +02:00
parent 062998738a
commit 7017a14107
5 changed files with 13 additions and 1 deletions

View file

@ -69,6 +69,7 @@ def clear_active_podcast_task(search_space_id: int) -> None:
def create_generate_podcast_tool(
search_space_id: int,
db_session: AsyncSession,
thread_id: int | None = None,
):
"""
Factory function to create the generate_podcast tool with injected dependencies.
@ -76,6 +77,7 @@ def create_generate_podcast_tool(
Args:
search_space_id: The user's search space ID
db_session: Database session (not used - Celery creates its own)
thread_id: The chat thread ID for associating the podcast
Returns:
A configured tool function for generating podcasts
@ -145,6 +147,7 @@ def create_generate_podcast_tool(
search_space_id=search_space_id,
podcast_title=podcast_title,
user_prompt=user_prompt,
thread_id=thread_id,
)
# Mark this task as active

View file

@ -102,8 +102,9 @@ BUILTIN_TOOLS: list[ToolDefinition] = [
factory=lambda deps: create_generate_podcast_tool(
search_space_id=deps["search_space_id"],
db_session=deps["db_session"],
thread_id=deps["thread_id"],
),
requires=["search_space_id", "db_session"],
requires=["search_space_id", "db_session", "thread_id"],
),
# Link preview tool - fetches Open Graph metadata for URLs
ToolDefinition(