fix(transcription): Behebt Start- und API-Fehler in der App [2f488f42]
This commit is contained in:
@@ -2,13 +2,9 @@ import sys
|
||||
import os
|
||||
from sqlalchemy.orm import Session
|
||||
from .. import database
|
||||
from .. import prompt_library
|
||||
|
||||
from ..prompt_library import get_prompt
|
||||
import logging
|
||||
from sqlalchemy.orm import Session
|
||||
from .. import database
|
||||
from .. import prompt_library
|
||||
from ..lib.gemini_client import call_gemini_flash
|
||||
from .llm_service import call_gemini_api
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -57,18 +53,7 @@ def _format_transcript(chunks: list[database.TranscriptChunk]) -> str:
|
||||
|
||||
return "\n".join(full_transcript)
|
||||
|
||||
def get_prompt_by_type(insight_type: str) -> str:
|
||||
"""
|
||||
Returns the corresponding prompt from the prompt_library based on the type.
|
||||
"""
|
||||
if insight_type == "meeting_minutes":
|
||||
return prompt_library.MEETING_MINUTES_PROMPT
|
||||
elif insight_type == "action_items":
|
||||
return prompt_library.ACTION_ITEMS_PROMPT
|
||||
elif insight_type == "sales_summary":
|
||||
return prompt_library.SALES_SUMMARY_PROMPT
|
||||
else:
|
||||
raise ValueError(f"Unknown insight type: {insight_type}")
|
||||
|
||||
|
||||
def generate_insight(db: Session, meeting_id: int, insight_type: str) -> database.AnalysisResult:
|
||||
"""
|
||||
@@ -102,7 +87,7 @@ def generate_insight(db: Session, meeting_id: int, insight_type: str) -> databas
|
||||
# This can happen if all chunks are empty or malformed
|
||||
raise ValueError(f"Formatted transcript for meeting {meeting_id} is empty or could not be processed.")
|
||||
|
||||
prompt_template = get_prompt_by_type(insight_type)
|
||||
prompt_template = get_prompt(insight_type)
|
||||
final_prompt = prompt_template.format(transcript_text=transcript_text)
|
||||
|
||||
# 4. Call the AI model
|
||||
|
||||
Reference in New Issue
Block a user