File size: 1,241 Bytes
fdfe81a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Deck Consistency Agent — cross-slide drift reviewer.

Tools are intentionally narrower than the Slide Reviewer: this agent works
across slides and does not need image / palette / confidentiality probes.
"""
from __future__ import annotations

import os

from agents import Agent

from agents._prompt_loader import load_prompt
from agents.context import AuditContext
from agents.output_schemas import DeckFindings
from agents.tools import (
    get_rubric_section,
    get_slide_text,
    list_slide_summaries,
)


def _model_name() -> str:
    """Return the OpenAI model for cross-slide consistency review.

    The deck-consistency pass reasons across the whole deck so it benefits
    from a stronger model. Defaults to ``gpt-4o``; override with
    ``OPENAI_MODEL_DECK`` (or the legacy ``OPENAI_MODEL``).
    """
    return (
        os.environ.get("OPENAI_MODEL_DECK")
        or os.environ.get("OPENAI_MODEL")
        or "gpt-4o"
    )


deck_consistency: Agent[AuditContext] = Agent[AuditContext](
    name="Deck Consistency",
    instructions=load_prompt("consistency"),
    model=_model_name(),
    tools=[
        list_slide_summaries,
        get_slide_text,
        get_rubric_section,
    ],
    output_type=DeckFindings,
)