
    'j                    z    d Z ddlmZ ddlZddlmZmZ ddlmZ ddl	Z	ddl
mZ e G d de                      ZdS )	u   NL2SQLDeps — per-request context dataclass for NL-to-SQL agents.

Extends ``RequestContext`` with a side-channel that tools write into so the
``/query`` REST endpoint can return structured rows without re-parsing the
agent's prose output.
    )annotationsN)	dataclassfield)Any)RequestContextc                  F   e Zd ZU dZ ed          Zded<    ed          Zded<    ed          Zded<    ee		          Z
d
ed<    ed          Zded<    ed          Zded<    ee		          Zded<    ed          Zded<    ed          Zded<   dS )
NL2SQLDepsa  Generic per-request deps for any NL-to-SQL agent.

    The ``run_query`` tool writes results here during execution.
    The ``/query`` REST handler reads them after ``agent.run()`` completes.

    Attributes:
        query_result:  Raw rows returned by the most recent ``run_query`` call.
                       Each element is a ``{column: value}`` dict.
        generated_sql: The exact SQL that was executed (after LIMIT injection).
        truncated:     ``True`` when the result was capped by the row limit.
        widget_mode:   ``True`` when the caller is the REST ``/query`` endpoint
                       and expects structured widget JSON.  ``False`` (default)
                       means the agent is running inside a pylogue chat session
                       and should respond in plain prose.
        formatted_widgets: Populated by the ``format_response`` tool only when
                       ``widget_mode=True``.
    N)defaultzlist[dict[str, Any]] | Nonequery_resultz
str | Nonegenerated_sqlsql_explanation)default_factoryzlist[dict[str, str]]	query_logFbool	truncatedwidget_modezlist[dict[str, Any]]formatted_widgetszasyncio.Queue | Noneprogress_queuezasyncpg.Pool | Nonepool)__name__
__module____qualname____doc__r   r   __annotations__r   r   listr   r   r   r   r   r        F/var/www/html/ai-enterprise-brain/backend/chanakya/nl2sql_core/deps.pyr	   r	      s-         " 16d0C0C0CLCCCC %d 3 3 3M3333"'%"5"5"5O5555&+eD&A&A&AIAAAAeE***I****e,,,K,,,,.3eD.I.I.IIIII+05+>+>+>N>>>> %d 3 3 3D333333r   r	   )r   
__future__r   asynciodataclassesr   r   typingr   asyncpgbackend.chanakya.a2a_contextr   r	   r   r   r   <module>r%      s     # " " " " "  ( ( ( ( ( ( ( (        7 7 7 7 7 7 4 4 4 4 4 4 4 4 4 4r   