Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions podcastfy/content_generator.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
"""
Content Generator Module

This module is responsible for generating Q&A content based on input texts using
LangChain and various LLM backends. It handles the interaction with the AI model and
provides methods to generate and save the generated content.
"""

import os
import logging
from typing import Optional, Dict, Any, List

from langchain_google_genai import ChatGoogleGenerativeAI
Expand All @@ -16,13 +9,9 @@
from langchain import hub
from podcastfy.utils.config_conversation import load_conversation_config
from podcastfy.utils.config import load_config
import logging
from langchain.prompts import HumanMessagePromptTemplate, SystemMessagePromptTemplate
from langchain.schema import SystemMessage

logger = logging.getLogger(__name__)


class LLMBackend:
def __init__(
self,
Expand Down Expand Up @@ -55,7 +44,6 @@ def __init__(
max_output_tokens=max_output_tokens,
)


class ContentGenerator:
def __init__(
self, api_key: str, conversation_config: Optional[Dict[str, Any]] = None
Expand Down Expand Up @@ -223,7 +211,6 @@ def generate_qa_content(
logger.error(f"Error generating content: {str(e)}")
raise


def main(seed: int = 42, is_local: bool = False) -> None:
"""
Generate Q&A content based on input text from input_text.txt using the specified LLM backend.
Expand Down Expand Up @@ -266,6 +253,5 @@ def main(seed: int = 42, is_local: bool = False) -> None:
logger.error(f"An error occurred while generating Q&A content: {str(e)}")
raise


if __name__ == "__main__":
main()