o
    {qiB                     @   s&  d Z ddlZddlmZmZ ddlmZ ddlmZ ddl	m
Z
 defdd	Zdefd
dZdefddZdefddZdefddZdefddZdefddZdefddZdefddZdefddZdefddZdefddZdefd d!Zdefd"d#Zdefd$d%Zdefd&d'Zdefd(d)Zdefd*d+Zdefd,d-Zdefd.d/Zdefd0d1Zdefd2d3Z defd4d5Z!defd6d7Z"defd8d9Z#defd:d;Z$defd<d=Z%defd>d?Z&defd@dAZ'defdBdCZ(defdDdEZ)defdFdGZ*defdHdIZ+defdJdKZ,defdLdMZ-defdNdOZ.defdPdQZ/defdRdSZ0defdTdUZ1defdVdWZ2defdXdYZ3defdZd[Z4defd\d]Z5defd^d_Z6defd`daZ7defdbdcZ8defdddeZ9defdfdgZ:defdhdiZ;defdjdkZ<defdldmZ=defdndoZ>defdpdqZ?defdrdsZ@defdtduZAdefdvdwZBdefdxdyZCdefdzd{ZDdefd|d}ZEdefd~dZFdefddZGdefddZHdefddZIdefddZJdefddZKdefddZLdefddZMdefddZNdefddZOdefddZPdefddZQdefddZRdefddZSdefddZTdefddZUdefddZVdefddZWdefddZXdefddZYdefddZZdefddZ[defddZ\defddZ]defddZ^defddZ_de`defddZag dZbdece`eg ede f f fddZedS )a  
**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)LangChainDeprecationWarning)BaseLLM)is_interactive_envreturnc                  C      ddl m}  | S )Nr   AI21)Zlangchain_community.llms.ai21r
   r	    r   ^/home/app/PaddleOCR-VL/.venv_paddleocr/lib/python3.10/site-packages/langchain/llms/__init__.py_import_ai21      r   c                  C   r   )Nr   
AlephAlpha)Z$langchain_community.llms.aleph_alphar   r   r   r   r   _import_aleph_alpha$   r   r   c                  C   r   )Nr   AmazonAPIGateway)Z+langchain_community.llms.amazon_api_gatewayr   r   r   r   r   _import_amazon_api_gateway*   r   r   c                  C   r   )Nr   	Anthropic)Z"langchain_community.llms.anthropicr   r   r   r   r   _import_anthropic0   r   r   c                  C   r   )Nr   Anyscale)Z!langchain_community.llms.anyscaler   r   r   r   r   _import_anyscale6   r   r   c                  C   r   )Nr   Arcee)Zlangchain_community.llms.arceer   r   r   r   r   _import_arcee<   r   r   c                  C   r   )Nr   Aviary)Zlangchain_community.llms.aviaryr   r   r   r   r   _import_aviaryB   r   r    c                  C   r   )Nr   AzureMLOnlineEndpoint)Z)langchain_community.llms.azureml_endpointr"   r!   r   r   r   _import_azureml_endpointH   r   r#   c                  C   r   )Nr   QianfanLLMEndpoint)Z/langchain_community.llms.baidu_qianfan_endpointr%   r$   r   r   r   _import_baidu_qianfan_endpointN   r   r&   c                  C   r   )Nr   Banana)Z"langchain_community.llms.bananadevr(   r'   r   r   r   _import_bananadevT   r   r)   c                  C   r   )Nr   Baseten)Z langchain_community.llms.basetenr+   r*   r   r   r   _import_basetenZ   r   r,   c                  C   r   )Nr   Beam)Zlangchain_community.llms.beamr.   r-   r   r   r   _import_beam`   r   r/   c                  C   r   )Nr   Bedrock)Z langchain_community.llms.bedrockr1   r0   r   r   r   _import_bedrockf   r   r2   c                  C   r   )Nr   NIBittensorLLM)Z"langchain_community.llms.bittensorr4   r3   r   r   r   _import_bittensorl   r   r5   c                  C   r   )Nr   CerebriumAI)Z$langchain_community.llms.cerebriumair7   r6   r   r   r   _import_cerebriumair   r   r8   c                  C   r   )Nr   ChatGLM)Z langchain_community.llms.chatglmr:   r9   r   r   r   _import_chatglmx   r   r;   c                  C   r   )Nr   Clarifai)Z!langchain_community.llms.clarifair=   r<   r   r   r   _import_clarifai~   r   r>   c                  C   r   )Nr   Cohere)Zlangchain_community.llms.coherer@   r?   r   r   r   _import_cohere   r   rA   c                  C   r   )Nr   CTransformers)Z&langchain_community.llms.ctransformersrC   rB   r   r   r   _import_ctransformers   r   rD   c                  C   r   )Nr   CTranslate2)Z$langchain_community.llms.ctranslate2rF   rE   r   r   r   _import_ctranslate2   r   rG   c                  C   r   )Nr   
Databricks)Z#langchain_community.llms.databricksrI   rH   r   r   r   _import_databricks   r   rJ   c                  C   r   )Nr   ChatDatabricks)Z*langchain_community.chat_models.databricksrL   rK   r   r   r   _import_databricks_chat   r   rM   c                  C   r   )Nr   	DeepInfra)Z"langchain_community.llms.deepinfrarO   rN   r   r   r   _import_deepinfra   r   rP   c                  C   r   )Nr   
DeepSparse)Z#langchain_community.llms.deepsparserR   rQ   r   r   r   _import_deepsparse   r   rS   c                  C   r   )Nr   EdenAI)Zlangchain_community.llms.edenairU   rT   r   r   r   _import_edenai   r   rV   c                  C   r   )Nr   FakeListLLM)Zlangchain_core.language_modelsrX   rW   r   r   r   _import_fake   r   rY   c                  C   r   )Nr   	Fireworks)Z"langchain_community.llms.fireworksr[   rZ   r   r   r   _import_fireworks   r   r\   c                  C   r   )Nr   ForefrontAI)Z$langchain_community.llms.forefrontair^   r]   r   r   r   _import_forefrontai   r   r_   c                  C   r   )Nr   GigaChat)Z!langchain_community.llms.gigachatra   r`   r   r   r   _import_gigachat   r   rb   c                  C   r   )Nr   
GooglePalm)Z$langchain_community.llms.google_palmrd   rc   r   r   r   _import_google_palm   r   re   c                  C   r   )Nr   GooseAI)Z langchain_community.llms.gooseairg   rf   r   r   r   _import_gooseai   r   rh   c                  C   r   )Nr   GPT4All)Z langchain_community.llms.gpt4allrj   ri   r   r   r   _import_gpt4all   r   rk   c                  C   r   )Nr   GradientLLM)Z$langchain_community.llms.gradient_airm   rl   r   r   r   _import_gradient_ai   r   rn   c                  C   r   )Nr   HuggingFaceEndpoint)Z-langchain_community.llms.huggingface_endpointrp   ro   r   r   r   _import_huggingface_endpoint   r   rq   c                  C   r   )Nr   HuggingFaceHub)Z(langchain_community.llms.huggingface_hubrs   rr   r   r   r   _import_huggingface_hub   r   rt   c                  C   r   )Nr   HuggingFacePipeline)Z-langchain_community.llms.huggingface_pipelinerv   ru   r   r   r   _import_huggingface_pipeline   r   rw   c                  C   r   )Nr   HuggingFaceTextGenInference)Z7langchain_community.llms.huggingface_text_gen_inferencery   rx   r   r   r   &_import_huggingface_text_gen_inference      rz   c                  C   r   )Nr   HumanInputLLM)Zlangchain_community.llms.humanr}   r|   r   r   r   _import_human   r   r~   c                  C   r   )Nr   JavelinAIGateway)Z+langchain_community.llms.javelin_ai_gatewayr   r   r   r   r   _import_javelin_ai_gateway  r   r   c                  C   r   )Nr   KoboldApiLLM)Z!langchain_community.llms.koboldair   r   r   r   r   _import_koboldai
  r   r   c                  C   r   )Nr   LlamaCpp)Z!langchain_community.llms.llamacppr   r   r   r   r   _import_llamacpp  r   r   c                  C   r   )Nr   ManifestWrapper)Z!langchain_community.llms.manifestr   r   r   r   r   _import_manifest  r   r   c                  C   r   )Nr   Minimax)Z langchain_community.llms.minimaxr   r   r   r   r   _import_minimax  r   r   c                  C   r   )Nr   Mlflow)Zlangchain_community.llms.mlflowr   r   r   r   r   _import_mlflow"  r   r   c                  C   r   )Nr   
ChatMlflow)Z&langchain_community.chat_models.mlflowr   r   r   r   r   _import_mlflow_chat(  r   r   c                  C   r   )Nr   MlflowAIGateway)Z*langchain_community.llms.mlflow_ai_gatewayr   r   r   r   r   _import_mlflow_ai_gateway.  r   r   c                  C   r   )Nr   Modal)Zlangchain_community.llms.modalr   r   r   r   r   _import_modal4  r   r   c                  C   r   )Nr   MosaicML)Z!langchain_community.llms.mosaicmlr   r   r   r   r   _import_mosaicml:  r   r   c                  C   r   )Nr   NLPCloud)Z!langchain_community.llms.nlpcloudr   r   r   r   r   _import_nlpcloud@  r   r   c                  C   r   )Nr   OctoAIEndpoint)Z(langchain_community.llms.octoai_endpointr   r   r   r   r   _import_octoai_endpointF  r   r   c                  C   r   )Nr   Ollama)Zlangchain_community.llms.ollamar   r   r   r   r   _import_ollamaL  r   r   c                  C   r   )Nr   OpaquePrompts)Z&langchain_community.llms.opaquepromptsr   r   r   r   r   _import_opaquepromptsR  r   r   c                  C   r   )Nr   AzureOpenAI)langchain_community.llms.openair   r   r   r   r   _import_azure_openaiX  r   r   c                  C   r   )Nr   OpenAI)r   r   r   r   r   r   _import_openai^  r   r   c                  C   r   )Nr   
OpenAIChat)r   r   r   r   r   r   _import_openai_chatd  r   r   c                  C   r   )Nr   OpenLLM)Z langchain_community.llms.openllmr   r   r   r   r   _import_openllmj  r   r   c                  C   r   )Nr   OpenLM)Zlangchain_community.llms.openlmr   r   r   r   r   _import_openlmp  r   r   c                  C   r   )Nr   PaiEasEndpoint)Z)langchain_community.llms.pai_eas_endpointr   r   r   r   r   _import_pai_eas_endpointv  r   r   c                  C   r   )Nr   Petals)Zlangchain_community.llms.petalsr   r   r   r   r   _import_petals|  r   r   c                  C   r   )Nr   
PipelineAI)Z#langchain_community.llms.pipelineair   r   r   r   r   _import_pipelineai  r   r   c                  C   r   )Nr   	Predibase)Z"langchain_community.llms.predibaser   r   r   r   r   _import_predibase  r   r   c                  C   r   )Nr   PredictionGuard)Z(langchain_community.llms.predictionguardr   r   r   r   r   _import_predictionguard  r   r   c                  C   r   )Nr   PromptLayerOpenAI)+langchain_community.llms.promptlayer_openair   r   r   r   r   _import_promptlayer  r   r   c                  C   r   )Nr   PromptLayerOpenAIChat)r   r   r   r   r   r   _import_promptlayer_chat  r   r   c                  C   r   )Nr   	Replicate)Z"langchain_community.llms.replicater   r   r   r   r   _import_replicate  r   r   c                  C   r   )Nr   RWKV)Zlangchain_community.llms.rwkvr   r   r   r   r   _import_rwkv  r   r   c                  C   r   )Nr   SagemakerEndpoint)Z+langchain_community.llms.sagemaker_endpointr   r   r   r   r   _import_sagemaker_endpoint  r   r   c                  C   r   )Nr   SelfHostedPipeline)Z$langchain_community.llms.self_hostedr   r   r   r   r   _import_self_hosted  r   r   c                  C   r   )Nr   SelfHostedHuggingFaceLLM)Z1langchain_community.llms.self_hosted_hugging_facer   r   r   r   r    _import_self_hosted_hugging_face  r{   r   c                  C   r   )Nr   StochasticAI)Z%langchain_community.llms.stochasticair   r   r   r   r   _import_stochasticai  r   r   c                  C   r   )Nr   Nebula)Z'langchain_community.llms.symblai_nebular   r   r   r   r   _import_symblai_nebula  r   r   c                  C   r   )Nr   TextGen)Z langchain_community.llms.textgenr   r   r   r   r   _import_textgen  r   r   c                  C   r   Nr   TitanTakeoffZ&langchain_community.llms.titan_takeoffr   r   r   r   r   _import_titan_takeoff  r   r   c                  C   r   r   r   r   r   r   r   _import_titan_takeoff_pro  r   r   c                  C   r   )Nr   Together)Z!langchain_community.llms.togetherr   r   r   r   r   _import_together  r   r   c                  C   r   )Nr   Tongyi)Zlangchain_community.llms.tongyir   r   r   r   r   _import_tongyi  r   r   c                  C   r   )Nr   VertexAI)!langchain_community.llms.vertexair   r   r   r   r   _import_vertex  r   r   c                  C   r   )Nr   VertexAIModelGarden)r   r   r   r   r   r   _import_vertex_model_garden  r   r   c                  C   r   )Nr   VLLM)langchain_community.llms.vllmr   r   r   r   r   _import_vllm  r   r   c                  C   r   )Nr   
VLLMOpenAI)r   r   r   r   r   r   _import_vllm_openai  r   r   c                  C   r   )Nr   
WatsonxLLM)Z#langchain_community.llms.watsonxllmr  r  r   r   r   _import_watsonxllm  r   r  c                  C   r   )Nr   Writer)Zlangchain_community.llms.writerr  r  r   r   r   _import_writer  r   r  c                  C   r   )Nr   
Xinference)Z#langchain_community.llms.xinferencer  r  r   r   r   _import_xinference  r   r	  c                  C   r   )Nr   	YandexGPT)Zlangchain_community.llms.yandexr  r
  r   r   r   _import_yandex_gpt  r   r  c                  C   r   )Nr   VolcEngineMaasLLM)Z(langchain_community.llms.volcengine_maasr  r  r   r   r   _import_volcengine_maas  r   r  namec                 C   sT   ddl m} t stjd|  ddtd | dkr%d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`.   )
stacklevelcategorytype_to_cls_dictc                 S   s   i | ]\}}|| qS r   r   ).0kvr   r   r   
<dictcomp>1  s    z__getattr__.<locals>.<dictcomp>)	Zlangchain_communityr  r   warningswarnr   get_type_to_cls_dictitemsgetattr)r  r  r  r   r   r   __getattr__   s   

r  )Qr
   r   r   r   r   r   r   r   r   r"   r   r(   r+   r.   r1   rC   rF   r7   r:   r=   r@   rI   rO   rR   rU   rX   r[   r^   rj   ra   rd   rg   rm   rp   rs   rv   ry   r}   r   r   r   r   r   r   r   r   r4   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r%   r   r   r   r   r   r   r   ZTitanTakeoffPror   r   r   r   r  r  r  r  r  c                   C   s  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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*t)d+t*d,t+d-t,d.t-d/t.d0t/d1t0d2t1d3t2i d4t3d5t4d6t5d7t6d8t7d9t8d:t9d;t:d<t;d=t<d>t=d?t>d@t?dAt@dBtAdCtBdDtCtDtDtEtFtGtHtItJtKtLtMdES )FNZai21Zaleph_alphaZamazon_api_gatewayZamazon_bedrockZ	anthropicZanyscaleZarceeZaviaryZazureZazureml_endpointZ	bananadevZbasetenZbeamZcerebriumaiZchat_glmZclarifaiZcohereZctransformersZctranslate2Z
databrickszdatabricks-chatZ	deepinfraZ
deepsparseZedenaiz	fake-listZforefrontaizgiga-chat-modelZgoogle_palmZgooseaiZgradientZgpt4allZhuggingface_endpointZhuggingface_hubZhuggingface_pipelineZhuggingface_textgen_inferencezhuman-inputZkoboldaiZllamacppZtextgenZminimaxZmlflowzmlflow-chatzmlflow-ai-gatewaymodalZmosaicZnebulaZnibittensorZnlpcloudZollamaZopenaiZopenlmZpai_eas_endpointZpetalsZ
pipelineaiZ	predibaseZopaquepromptsZ	replicateZrwkvZsagemaker_endpointZself_hostedZself_hosted_hugging_faceZstochasticaiZtogetherZtongyiZtitan_takeoffZtitan_takeoff_proZvertexaiZvertexai_model_garden)ZopenllmZopenllm_clientZvllmZvllm_openaiZ
watsonxllmwriterZ
xinferencezjavelin-ai-gatewayZqianfan_endpointZ
yandex_gptr  )Nr   r   r   r2   r   r   r   r    r   r#   r)   r,   r/   r8   r;   r>   rA   rD   rG   rJ   rM   rP   rS   rV   rY   r_   rb   re   rh   rn   rk   rq   rt   rw   rz   r~   r   r   r   r   r   r   r   r   r   r   r5   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    s*  	
 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEr  )f__doc__r  typingr   r   Zlangchain_core._apir   Z#langchain_core.language_models.llmsr   Zlangchain._api.interactive_envr   r   r   r   r   r   r   r    r#   r&   r)   r,   r/   r2   r5   r8   r;   r>   rA   rD   rG   rJ   rM   rP   rS   rV   rY   r\   r_   rb   re   rh   rk   rn   rq   rt   rw   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   r   r   r   r   r   r   r   r  r  r	  r  r  strr  __all__dicttyper  r   r   r   r   <module>   s    &U