
    D_i
                    h    S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	   " S S\5      r
 " S S	\
5      rg
)zGeneration output schema.    )annotations)AnyLiteral)Serializable)merge_dictsc                  n    \ rS rSr% SrS\S'    SrS\S'    S rS\S	'    \SS
 j5       r	\SS j5       r
Srg)
Generation   a4  A single text generation output.

Generation represents the response from an "old-fashioned" LLM (string-in,
string-out) that generates regular text (not chat messages).

This model is used internally by chat model and will eventually
be mapped to a more general `LLMResult` object, and then projected into
an `AIMessage` object.

LangChain users working with chat models will usually access information via
`AIMessage` (returned from runnable interfaces) or `LLMResult` (available
via callbacks). Please refer to `AIMessage` and `LLMResult` for more information.
strtextNzdict[str, Any] | Nonegeneration_infozLiteral['Generation']typec                    g)z,Return `True` as this class is serializable.T clss    [/home/james-whalen/.local/lib/python3.13/site-packages/langchain_core/outputs/generation.pyis_lc_serializableGeneration.is_lc_serializable(   s         c                
    / SQ$ )z]Get the namespace of the LangChain object.

Returns:
    `["langchain", "schema", "output"]`
)	langchainschemaoutputr   r   s    r   get_lc_namespaceGeneration.get_lc_namespace-   s
     10r   r   )returnbool)r   z	list[str])__name__
__module____qualname____firstlineno____doc____annotations__r   r   classmethodr   r   __static_attributes__r   r   r   r	   r	      s[     I -1O*1 #/D
.
   1 1r   r	   c                  "    \ rS rSrSrSS jrSrg)GenerationChunk7   zJ`GenerationChunk`, which can be concatenated with other Generation chunks.c                0   [        U[        5      (       a\  [        U R                  =(       d    0 UR                  =(       d    0 5      n[        U R                  UR                  -   U=(       d    SS9$ S[        U 5       S[        U5       S3n[        U5      e)zConcatenate two `GenerationChunk`s.

Args:
    other: Another `GenerationChunk` to concatenate with.

Raises:
    TypeError: If other is not a `GenerationChunk`.

Returns:
    A new `GenerationChunk` concatenated from self and other.
N)r   r   z$unsupported operand type(s) for +: 'z' and '')
isinstancer(   r   r   r   r   	TypeError)selfotherr   msgs       r   __add__GenerationChunk.__add__:   s     e_--)$$*%%+O #YY+ / 74  5T$ZLU}TUVnr   r   N)r/   r(   r   r(   )r   r    r!   r"   r#   r1   r&   r   r   r   r(   r(   7   s
    Tr   r(   N)r#   
__future__r   typingr   r   langchain_core.loadr   langchain_core.utils._merger   r	   r(   r   r   r   <module>r7      s-     "  , 3)1 )1Xj r   