+
    aKj                     <    ^ RI t ^RIHt ^RIHt  ! R R]4      tR# )    N)LLMProvider)parse_json_responsec                   L   a  ] tR t^t o RtRV 3R lR lltV 3R lR ltRtV tR# )	AnthropicProviderzNative Anthropic Messages API. Unlike the OpenAI wire format, the system
prompt is its own top-level parameter and the messages list may only contain
"user"/"assistant" roles - both handled here so callers never need to know that.
c                >   < V ^8  d   QhRS[ R,          RS[ RS[RR/# )   api_keyNmodel
max_tokensreturn)strint)format__classdict__s   "HC:\xampp\htdocs\meridian\meridian-ai\app\providers\anthropic_provider.py__annotate__AnthropicProvider.__annotate__   s.     % %d
 %3 %C %SW %    c                V    \         P                  ! VR 7      V n        W n        W0n        R# ))r	   N)	anthropic	Anthropicclientr
   r   )selfr	   r
   r   s   &&&&r   __init__AnthropicProvider.__init__   s    ))':
$r   c                <   < V ^8  d   QhRS[ RS[S[,          RS[/# )r   system_promptmessagesr   )r   listdict)r   r   s   "r   r   r      s&     ) )3 )$t* ) )r   c                    V P                   P                  P                  V P                  V P                  VVR 7      pRP                  R VP                   4       4      p\        V4      # ))r
   r   systemr    c              3   ^   "   T F#  qP                   R 8X  g   K  VP                  x  K%  	  R# 5i)textN)typer%   ).0blocks   & r   	<genexpr>2AnthropicProvider.complete_json.<locals>.<genexpr>   s"     X/?e::QWCWzuzz/?s   --)r   r   creater
   r   joincontentr   )r   r   r   responser%   s   &&&  r   complete_jsonAnthropicProvider.complete_json   s\    ;;''..** 	 / 
 wwXx/?/?XX"4((r   )r   r   r
   N)i   )	__name__
__module____qualname____firstlineno____doc__r   r/   __static_attributes____classdictcell__)r   s   @r   r   r      s     
% %
) )r   r   )r   baser   
json_utilsr   r    r   r   <module>r;      s      +) )r   