Skip to content

Commit

Permalink
chunk_extraction uses gpt-4o-mini
Browse files Browse the repository at this point in the history
  • Loading branch information
josancamon19 committed Sep 3, 2024
1 parent fb3dd89 commit 8cc8cf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion backend/utils/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ class SummaryOutput(BaseModel):


def chunk_extraction(segments: List[TranscriptSegment], topics: List[str]) -> str:
_chat = ChatOpenAI(model="gpt-4o-mini")

content = TranscriptSegment.segments_as_string(segments)
prompt = f'''
You are an experienced detective, your task is to extract the key points of the conversation related to the topics you were provided.
Expand All @@ -394,7 +396,7 @@ def chunk_extraction(segments: List[TranscriptSegment], topics: List[str]) -> st
Topics: {topics}
'''
with_parser = llm.with_structured_output(SummaryOutput)
with_parser = _chat.with_structured_output(SummaryOutput)
response: SummaryOutput = with_parser.invoke(prompt)
return response.summary

Expand Down
3 changes: 2 additions & 1 deletion backend/utils/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def _single(plugin: Plugin):

def trigger_realtime_integrations(uid: str, token: str, segments: List[dict]) -> dict:
plugins: List[Plugin] = get_plugins_data(uid, include_reviews=False)
filtered_plugins = [plugin for plugin in plugins if plugin.triggers_realtime() and plugin.enabled]
filtered_plugins = [plugin for plugin in plugins if
plugin.triggers_realtime() and plugin.enabled and not plugin.deleted]
if not filtered_plugins:
return {}

Expand Down

0 comments on commit 8cc8cf6

Please sign in to comment.