Stable state
This commit is contained in:
+15
-1
@@ -8,7 +8,11 @@ from openai import OpenAI
|
||||
from pydantic import ValidationError
|
||||
|
||||
from .models import ExtractionResult, FilterResult
|
||||
from .prompts import EXTRACTION_SYSTEM_PROMPT, NOISE_FILTER_SYSTEM_PROMPT
|
||||
from .prompts import (
|
||||
EXTRACTION_SYSTEM_PROMPT,
|
||||
NOISE_FILTER_SYSTEM_PROMPT,
|
||||
QUERY_ANSWER_SYSTEM_PROMPT,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -102,6 +106,16 @@ class LLMProcessor:
|
||||
logger.error(f"LLM Error: {e}")
|
||||
return ""
|
||||
|
||||
def generate_answer(self, query: str, context: str) -> str:
|
||||
"""
|
||||
Generates a natural language answer to a DM query.
|
||||
"""
|
||||
return self._call_llm(
|
||||
QUERY_ANSWER_SYSTEM_PROMPT,
|
||||
query,
|
||||
context=context,
|
||||
)
|
||||
|
||||
def filter_transcript(
|
||||
self, text: str, context: Optional[str] = None
|
||||
) -> FilterResult:
|
||||
|
||||
Reference in New Issue
Block a user