
    NgB                        d Z ddlZddlmZmZmZmZ ddlmZ ddl	m
Z
 ddlmZ defdZdefd	Zdefd
ZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZdefdZ defdZ!defdZ"defdZ#defdZ$defd Z%defd!Z&defd"Z'defd#Z(defd$Z)defd%Z*defd&Z+defd'Z,defd(Z-defd)Z.defd*Z/defd+Z0defd,Z1defd-Z2defd.Z3defd/Z4defd0Z5defd1Z6defd2Z7defd3Z8defd4Z9defd5Z:defd6Z;defd7Z<defd8Z=defd9Z>defd:Z?defd;Z@defd<ZAdefd=ZBdefd>ZCdefd?ZDdefd@ZEdefdAZFdefdBZGdefdCZHdefdDZIdefdEZJdefdFZKdefdGZLdefdHZMdefdIZNdefdJZOdefdKZPdefdLZQdefdMZRdefdNZSdefdOZTdefdPZUdefdQZVdefdRZWdefdSZXdefdTZYdefdUZZdefdVZ[defdWZ\defdXZ]defdYZ^defdZZ_defd[Z`defd\Zad]ebdefd^Zcg d_Zddeebeg ee
         f         f         fd`ZedS )aa  
**LLM** classes provide
access to the large language model (**LLM**) APIs and services.

**Class hierarchy:**

.. code-block::

    BaseLanguageModel --> BaseLLM --> LLM --> <name>  # Examples: AI21, HuggingFaceHub, OpenAI

**Main helpers:**

.. code-block::

    LLMResult, PromptValue,
    CallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun,
    CallbackManager, AsyncCallbackManager,
    AIMessage, BaseMessage
    N)AnyCallableDictType)LangChainDeprecationWarning)BaseLLM)is_interactive_envreturnc                      ddl m}  | S )Nr   AI21)langchain_community.llms.ai21r   r   s    S/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain/llms/__init__.py_import_ai21r          222222K    c                      ddl m}  | S )Nr   
AlephAlpha)$langchain_community.llms.aleph_alphar   r   s    r   _import_aleph_alphar   $       ??????r   c                      ddl m}  | S )Nr   AmazonAPIGateway)+langchain_community.llms.amazon_api_gatewayr   r   s    r   _import_amazon_api_gatewayr   *       LLLLLLr   c                      ddl m}  | S )Nr   	Anthropic)"langchain_community.llms.anthropicr!   r    s    r   _import_anthropicr#   0       <<<<<<r   c                      ddl m}  | S )Nr   Anyscale)!langchain_community.llms.anyscaler'   r&   s    r   _import_anyscaler)   6       ::::::Or   c                      ddl m}  | S )Nr   Arcee)langchain_community.llms.arceer-   r,   s    r   _import_arceer/   <       444444Lr   c                      ddl m}  | S )Nr   Aviary)langchain_community.llms.aviaryr3   r2   s    r   _import_aviaryr5   B       666666Mr   c                      ddl m}  | S )Nr   AzureMLOnlineEndpoint))langchain_community.llms.azureml_endpointr9   r8   s    r   _import_azureml_endpointr;   H   s    OOOOOO  r   c                      ddl m}  | S )Nr   QianfanLLMEndpoint)/langchain_community.llms.baidu_qianfan_endpointr>   r=   s    r   _import_baidu_qianfan_endpointr@   N   s    RRRRRRr   c                      ddl m}  | S )Nr   Banana)"langchain_community.llms.bananadevrC   rB   s    r   _import_bananadevrE   T   s    999999Mr   c                      ddl m}  | S )Nr   Baseten) langchain_community.llms.basetenrH   rG   s    r   _import_basetenrJ   Z       888888Nr   c                      ddl m}  | S )Nr   Beam)langchain_community.llms.beamrN   rM   s    r   _import_beamrP   `   r   r   c                      ddl m}  | S )Nr   Bedrock) langchain_community.llms.bedrockrS   rR   s    r   _import_bedrockrU   f   rK   r   c                      ddl m}  | S )Nr   NIBittensorLLM)"langchain_community.llms.bittensorrX   rW   s    r   _import_bittensorrZ   l   s    AAAAAAr   c                      ddl m}  | S )Nr   CerebriumAI)$langchain_community.llms.cerebriumair]   r\   s    r   _import_cerebriumair_   r       @@@@@@r   c                      ddl m}  | S )Nr   ChatGLM) langchain_community.llms.chatglmrc   rb   s    r   _import_chatglmre   x   rK   r   c                      ddl m}  | S )Nr   Clarifai)!langchain_community.llms.clarifairh   rg   s    r   _import_clarifairj   ~   r*   r   c                      ddl m}  | S )Nr   Cohere)langchain_community.llms.cohererm   rl   s    r   _import_coherero      r6   r   c                      ddl m}  | S )Nr   CTransformers)&langchain_community.llms.ctransformersrr   rq   s    r   _import_ctransformersrt          DDDDDDr   c                      ddl m}  | S )Nr   CTranslate2)$langchain_community.llms.ctranslate2rx   rw   s    r   _import_ctranslate2rz      r`   r   c                      ddl m}  | S )Nr   
Databricks)#langchain_community.llms.databricksr}   r|   s    r   _import_databricksr          >>>>>>r   c                      ddl m}  | S )Nr   ChatDatabricks)*langchain_community.chat_models.databricksr   r   s    r   _import_databricks_chatr      s    IIIIIIr   c                      ddl m}  | S )Nr   	DeepInfra)"langchain_community.llms.deepinfrar   r   s    r   _import_deepinfrar      r$   r   c                      ddl m}  | S )Nr   
DeepSparse)#langchain_community.llms.deepsparser   r   s    r   _import_deepsparser      r   r   c                      ddl m}  | S )Nr   EdenAI)langchain_community.llms.edenair   r   s    r   _import_edenair      r6   r   c                      ddl m}  | S )Nr   FakeListLLM)langchain_core.language_modelsr   r   s    r   _import_faker      s    ::::::r   c                      ddl m}  | S )Nr   	Fireworks)"langchain_community.llms.fireworksr   r   s    r   _import_fireworksr      r$   r   c                      ddl m}  | S )Nr   ForefrontAI)$langchain_community.llms.forefrontair   r   s    r   _import_forefrontair      r`   r   c                      ddl m}  | S )Nr   GigaChat)!langchain_community.llms.gigachatr   r   s    r   _import_gigachatr      r*   r   c                      ddl m}  | S )Nr   
GooglePalm)$langchain_community.llms.google_palmr   r   s    r   _import_google_palmr      r   r   c                      ddl m}  | S )Nr   GooseAI) langchain_community.llms.gooseair   r   s    r   _import_gooseair      rK   r   c                      ddl m}  | S )Nr   GPT4All) langchain_community.llms.gpt4allr   r   s    r   _import_gpt4allr      rK   r   c                      ddl m}  | S )Nr   GradientLLM)$langchain_community.llms.gradient_air   r   s    r   _import_gradient_air      r`   r   c                      ddl m}  | S )Nr   HuggingFaceEndpoint)-langchain_community.llms.huggingface_endpointr   r   s    r   _import_huggingface_endpointr          QQQQQQr   c                      ddl m}  | S )Nr   HuggingFaceHub)(langchain_community.llms.huggingface_hubr   r   s    r   _import_huggingface_hubr          GGGGGGr   c                      ddl m}  | S )Nr   HuggingFacePipeline)-langchain_community.llms.huggingface_pipeliner   r   s    r   _import_huggingface_pipeliner      r   r   c                      ddl m}  | S )Nr   HuggingFaceTextGenInference)7langchain_community.llms.huggingface_text_gen_inferencer   r   s    r   &_import_huggingface_text_gen_inferencer      s(          '&r   c                      ddl m}  | S )Nr   HumanInputLLM)langchain_community.llms.humanr   r   s    r   _import_humanr      s    <<<<<<r   c                      ddl m}  | S )Nr   JavelinAIGateway)+langchain_community.llms.javelin_ai_gatewayr   r   s    r   _import_javelin_ai_gatewayr     r   r   c                      ddl m}  | S )Nr   KoboldApiLLM)!langchain_community.llms.koboldair   r   s    r   _import_koboldair   
  s    >>>>>>r   c                      ddl m}  | S )Nr   LlamaCpp)!langchain_community.llms.llamacppr   r   s    r   _import_llamacppr     r*   r   c                      ddl m}  | S )Nr   ManifestWrapper)!langchain_community.llms.manifestr   r   s    r   _import_manifestr     s    AAAAAAr   c                      ddl m}  | S )Nr   Minimax) langchain_community.llms.minimaxr   r   s    r   _import_minimaxr     rK   r   c                      ddl m}  | S )Nr   Mlflow)langchain_community.llms.mlflowr   r   s    r   _import_mlflowr   "  r6   r   c                      ddl m}  | S )Nr   
ChatMlflow)&langchain_community.chat_models.mlflowr   r   s    r   _import_mlflow_chatr   (  s    AAAAAAr   c                      ddl m}  | S )Nr   MlflowAIGateway)*langchain_community.llms.mlflow_ai_gatewayr   r   s    r   _import_mlflow_ai_gatewayr   .  s    JJJJJJr   c                      ddl m}  | S )Nr   Modal)langchain_community.llms.modalr  r  s    r   _import_modalr  4  r0   r   c                      ddl m}  | S )Nr   MosaicML)!langchain_community.llms.mosaicmlr  r  s    r   _import_mosaicmlr	  :  r*   r   c                      ddl m}  | S )Nr   NLPCloud)!langchain_community.llms.nlpcloudr  r  s    r   _import_nlpcloudr  @  r*   r   c                      ddl m}  | S )Nr   OctoAIEndpoint)(langchain_community.llms.octoai_endpointr  r  s    r   _import_octoai_endpointr  F  r   r   c                      ddl m}  | S )Nr   Ollama)langchain_community.llms.ollamar  r  s    r   _import_ollamar  L  r6   r   c                      ddl m}  | S )Nr   OpaquePrompts)&langchain_community.llms.opaquepromptsr  r  s    r   _import_opaquepromptsr  R  ru   r   c                      ddl m}  | S )Nr   AzureOpenAI)langchain_community.llms.openair   r  s    r   _import_azure_openair"  X  s    ;;;;;;r   c                      ddl m}  | S )Nr   OpenAI)r!  r%  r$  s    r   _import_openair&  ^  r6   r   c                      ddl m}  | S )Nr   
OpenAIChat)r!  r)  r(  s    r   _import_openai_chatr*  d  s    ::::::r   c                      ddl m}  | S )Nr   OpenLLM) langchain_community.llms.openllmr-  r,  s    r   _import_openllmr/  j  rK   r   c                      ddl m}  | S )Nr   OpenLM)langchain_community.llms.openlmr2  r1  s    r   _import_openlmr4  p  r6   r   c                      ddl m}  | S )Nr   PaiEasEndpoint))langchain_community.llms.pai_eas_endpointr7  r6  s    r   _import_pai_eas_endpointr9  v  s    HHHHHHr   c                      ddl m}  | S )Nr   Petals)langchain_community.llms.petalsr<  r;  s    r   _import_petalsr>  |  r6   r   c                      ddl m}  | S )Nr   
PipelineAI)#langchain_community.llms.pipelineairA  r@  s    r   _import_pipelineairC    r   r   c                      ddl m}  | S )Nr   	Predibase)"langchain_community.llms.predibaserF  rE  s    r   _import_predibaserH    r$   r   c                      ddl m}  | S )Nr   PredictionGuard)(langchain_community.llms.predictionguardrK  rJ  s    r   _import_predictionguardrM    s    HHHHHHr   c                      ddl m}  | S )Nr   PromptLayerOpenAI)+langchain_community.llms.promptlayer_openairP  rO  s    r   _import_promptlayerrR        MMMMMMr   c                      ddl m}  | S )Nr   PromptLayerOpenAIChat)rQ  rV  rU  s    r   _import_promptlayer_chatrW    s    QQQQQQ  r   c                      ddl m}  | S )Nr   	Replicate)"langchain_community.llms.replicaterZ  rY  s    r   _import_replicater\    r$   r   c                      ddl m}  | S )Nr   RWKV)langchain_community.llms.rwkvr_  r^  s    r   _import_rwkvra    r   r   c                      ddl m}  | S )Nr   SagemakerEndpoint)+langchain_community.llms.sagemaker_endpointrd  rc  s    r   _import_sagemaker_endpointrf    rS  r   c                      ddl m}  | S )Nr   SelfHostedPipeline)$langchain_community.llms.self_hostedri  rh  s    r   _import_self_hostedrk    s    GGGGGGr   c                      ddl m}  | S )Nr   SelfHostedHuggingFaceLLM)1langchain_community.llms.self_hosted_hugging_facern  rm  s    r    _import_self_hosted_hugging_facerp    s(          $#r   c                      ddl m}  | S )Nr   StochasticAI)%langchain_community.llms.stochasticairs  rr  s    r   _import_stochasticairu    s    BBBBBBr   c                      ddl m}  | S )Nr   Nebula)'langchain_community.llms.symblai_nebularx  rw  s    r   _import_symblai_nebularz    s    >>>>>>Mr   c                      ddl m}  | S )Nr   TextGen) langchain_community.llms.textgenr}  r|  s    r   _import_textgenr    rK   r   c                      ddl m}  | S Nr   TitanTakeoff&langchain_community.llms.titan_takeoffr  r  s    r   _import_titan_takeoffr        CCCCCCr   c                      ddl m}  | S r  r  r  s    r   _import_titan_takeoff_pror    r  r   c                      ddl m}  | S )Nr   Together)!langchain_community.llms.togetherr  r  s    r   _import_togetherr    r*   r   c                      ddl m}  | S )Nr   Tongyi)langchain_community.llms.tongyir  r  s    r   _import_tongyir    r6   r   c                      ddl m}  | S )Nr   VertexAI)!langchain_community.llms.vertexair  r  s    r   _import_vertexr    r*   r   c                      ddl m}  | S )Nr   VertexAIModelGarden)r  r  r  s    r   _import_vertex_model_gardenr    s    EEEEEEr   c                      ddl m}  | S )Nr   VLLM)langchain_community.llms.vllmr  r  s    r   _import_vllmr    r   r   c                      ddl m}  | S )Nr   
VLLMOpenAI)r  r  r  s    r   _import_vllm_openair    s    888888r   c                      ddl m}  | S )Nr   
WatsonxLLM)#langchain_community.llms.watsonxllmr  r  s    r   _import_watsonxllmr    r   r   c                      ddl m}  | S )Nr   Writer)langchain_community.llms.writerr  r  s    r   _import_writerr    r6   r   c                      ddl m}  | S )Nr   
Xinference)#langchain_community.llms.xinferencer  r  s    r   _import_xinferencer    r   r   c                      ddl m}  | S )Nr   	YandexGPT)langchain_community.llms.yandexr  r  s    r   _import_yandex_gptr    s    999999r   c                      ddl m}  | S )Nr   VolcEngineMaasLLM)(langchain_community.llms.volcengine_maasr  r  s    r   _import_volcengine_maasr    s    JJJJJJr   namec                     ddl m} t                      st          j        d|  dt
                     | dk    r,d t                                                      D             }|S t          ||           S )Nr   )llmszImporting LLMs from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.llms import zL`.

To install langchain-community run `pip install -U langchain-community`.)categorytype_to_cls_dictc                 *    i | ]\  }}| |            S  r  ).0kvs      r   
<dictcomp>z__getattr__.<locals>.<dictcomp>0  s1     6
 6
 6
q!Aqqss6
 6
 6
r   )	langchain_communityr  r	   warningswarnr   get_type_to_cls_dictitemsgetattr)r  r  r  s      r   __getattr__r     s    ((((((  
W 6:W W W
 1	
 	
 	
 	
 !!!6
 6
355;;==6
 6
 6
  tT"""r   )Qr   r   r   r!   r'   r-   r3   r9   r   rC   rH   rN   rS   rr   rx   r]   rc   rh   rm   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r}  r   r   r   r  r  rx  rX   r  r  r%  r)  r-  r2  r7  r<  rA  rF  rK  rP  rV  r  r_  rZ  rd  rn  ri  rs  r  TitanTakeoffPror  r  r  r  r  r  r  r  r  r   r>   r  r  c                     i dt           dt          dt          dt          dt          dt
          dt          dt          d	t          d
t          dt          dt          dt          dt          dt          dt          dt           i dt"          dt$          dt&          dt(          dt*          dt,          dt.          dt0          dt2          dt4          dt6          dt8          dt:          dt<          d t>          d!t@          d"tB          i d#tD          d$tF          d%tH          d&tJ          d'tL          d(tN          d)tP          d*tR          d+tT          d,tV          d-tX          d.tZ          d/t\          d0t^          d1t`          d2tb          d3td          i d4tf          d5th          d6tj          d7tl          d8tn          d9tp          d:tr          d;tt          d<tv          d=tx          d>tz          d?t|          d@t~          dAt          dBt          dCt          dDt          t          t          t          t          t          t          t          t          t          t          t          dES )FNai21aleph_alphaamazon_api_gatewayamazon_bedrock	anthropicanyscalearceeaviaryazureazureml_endpoint	bananadevbasetenbeamcerebriumaichat_glmclarifaicoherectransformersctranslate2
databrickszdatabricks-chat	deepinfra
deepsparseedenaiz	fake-listforefrontaizgiga-chat-modelgoogle_palmgooseaigradientgpt4allhuggingface_endpointhuggingface_hubhuggingface_pipelinehuggingface_textgen_inferencezhuman-inputkoboldaillamacpptextgenminimaxmlflowzmlflow-chatzmlflow-ai-gatewaymodalmosaicnebulanibittensornlpcloudollamaopenaiopenlmpai_eas_endpointpetals
pipelineai	predibaseopaqueprompts	replicaterwkvsagemaker_endpointself_hostedself_hosted_hugging_facestochasticaitogethertongyititan_takeofftitan_takeoff_provertexaivertexai_model_garden)openllmopenllm_clientvllmvllm_openai
watsonxllmwriter
xinferencezjavelin-ai-gatewayqianfan_endpoint
yandex_gptr  )Nr   r   r   rU   r#   r)   r/   r5   r"  r;   rE   rJ   rP   r_   re   rj   ro   rt   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r   r   r  r	  rz  rZ   r  r  r&  r4  r9  r>  rC  rH  r  r\  ra  rf  rk  rp  ru  r  r  r  r  r  r  r/  r  r  r  r  r  r   r@   r  r  r  r   r   r  r    sO   PP*P 	8P 	/	P
 	&P 	$P 	P 	.P 	%P 	4P 	&P 	?P 	P 	*P 	OP  	$!P" 	.#P P$ 	.%P& 	*'P( 	()P* 	2+P, 	&-P. 	(/P0 	.1P2 	\3P4 	*5P6 	+7P8 	*9P: 	?;P< 	'=P> 	??P@ 	 <APB 	2CPD 	 <EP P PF 	()OGPH 	}IPJ 	$KPL 	$MPN 	?OPP 	?QPR 	.SPT 	*UPV 	6WPX 	YPZ 	"[P\ 	(]P^ 	(_P` 	$aPb 	.cPd 	.ePf 	.gP P Ph 	4iPj 	.kPl 	(mPn 	&oPp 	.qPr 	&sPt 	uPv 	8wPx 	*yPz 	#$D{P| 	,}P~ 	$P@ 	.APB 	.CPD 	6EPF 	NGPH 	 !<IP PJ #)*( (8:(4_P P P Pr   )f__doc__r  typingr   r   r   r   langchain_core._apir   #langchain_core.language_models.llmsr   langchain._api.interactive_envr	   r   r   r   r#   r)   r/   r5   r;   r@   rE   rJ   rP   rU   rZ   r_   re   rj   ro   rt   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r  r  r  r  r"  r&  r*  r/  r4  r9  r>  rC  rH  rM  rR  rW  r\  ra  rf  rk  rp  ru  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  strr  __all__r  r  r   r   <module>r!     s	   (  , , , , , , , , , , , , ; ; ; ; ; ; 7 7 7 7 7 7 = = = = = =c    S    C    3    #    s        !# ! ! ! !    3        c        3    S        #        s    S    C        3    C        c    3    S    #    S            S    c        c    ' ' ' ' 's    C    #    #    #            S    3    s    #    #            s    c        S            #        C    3        S    !# ! ! ! !3    c    C    S    $# $ $ $ $c            s    3    #            S    c    S    C        C    C        #c #c # # # #0R R RjQd3T']1B(C#CD Q Q Q Q Q Qr   