o
    ZhB                     @   s.  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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Z0defdPdQZ1defdRdSZ2defdTdUZ3defdVdWZ4defdXdYZ5defdZd[Z6defd\d]Z7defd^d_Z8defd`daZ9d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ZAdefdrdsZBdefdtduZCdefdvdwZDdefdxdyZEdefdzd{ZFdefd|d}ZGdefd~d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_defddZ`defddZadebdefddZcg dZddeebeg ee
 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DictType)LangChainDeprecationWarning)BaseLLM)is_interactive_envreturnc                  C      ddl m}  | S )Nr   AI21)Zlangchain_community.llms.ai21r   r    r   N/var/www/html/lang_env/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.beamr0   r/   r   r   r   _import_beam`   r   r1   c                  C   r
   )Nr   Bedrock)Z langchain_community.llms.bedrockr3   r2   r   r   r   _import_bedrockf   r   r4   c                  C   r
   )Nr   NIBittensorLLM)Z"langchain_community.llms.bittensorr6   r5   r   r   r   _import_bittensorl   r   r7   c                  C   r
   )Nr   CerebriumAI)Z$langchain_community.llms.cerebriumair9   r8   r   r   r   _import_cerebriumair   r   r:   c                  C   r
   )Nr   ChatGLM)Z langchain_community.llms.chatglmr<   r;   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.cohererB   rA   r   r   r   _import_cohere   r   rC   c                  C   r
   )Nr   CTransformers)Z&langchain_community.llms.ctransformersrE   rD   r   r   r   _import_ctransformers   r   rF   c                  C   r
   )Nr   CTranslate2)Z$langchain_community.llms.ctranslate2rH   rG   r   r   r   _import_ctranslate2   r   rI   c                  C   r
   )Nr   
Databricks)Z#langchain_community.llms.databricksrK   rJ   r   r   r   _import_databricks   r   rL   c                  C   r
   )Nr   ChatDatabricks)Z*langchain_community.chat_models.databricksrN   rM   r   r   r   _import_databricks_chat   r   rO   c                  C   r
   )Nr   	DeepInfra)Z"langchain_community.llms.deepinfrarQ   rP   r   r   r   _import_deepinfra   r   rR   c                  C   r
   )Nr   
DeepSparse)Z#langchain_community.llms.deepsparserT   rS   r   r   r   _import_deepsparse   r   rU   c                  C   r
   )Nr   EdenAI)Zlangchain_community.llms.edenairW   rV   r   r   r   _import_edenai   r   rX   c                  C   r
   )Nr   FakeListLLM)Zlangchain_core.language_modelsrZ   rY   r   r   r   _import_fake   r   r[   c                  C   r
   )Nr   	Fireworks)Z"langchain_community.llms.fireworksr]   r\   r   r   r   _import_fireworks   r   r^   c                  C   r
   )Nr   ForefrontAI)Z$langchain_community.llms.forefrontair`   r_   r   r   r   _import_forefrontai   r   ra   c                  C   r
   )Nr   GigaChat)Z!langchain_community.llms.gigachatrc   rb   r   r   r   _import_gigachat   r   rd   c                  C   r
   )Nr   
GooglePalm)Z$langchain_community.llms.google_palmrf   re   r   r   r   _import_google_palm   r   rg   c                  C   r
   )Nr   GooseAI)Z langchain_community.llms.gooseairi   rh   r   r   r   _import_gooseai   r   rj   c                  C   r
   )Nr   GPT4All)Z langchain_community.llms.gpt4allrl   rk   r   r   r   _import_gpt4all   r   rm   c                  C   r
   )Nr   GradientLLM)Z$langchain_community.llms.gradient_airo   rn   r   r   r   _import_gradient_ai   r   rp   c                  C   r
   )Nr   HuggingFaceEndpoint)Z-langchain_community.llms.huggingface_endpointrr   rq   r   r   r   _import_huggingface_endpoint   r   rs   c                  C   r
   )Nr   HuggingFaceHub)Z(langchain_community.llms.huggingface_hubru   rt   r   r   r   _import_huggingface_hub   r   rv   c                  C   r
   )Nr   HuggingFacePipeline)Z-langchain_community.llms.huggingface_pipelinerx   rw   r   r   r   _import_huggingface_pipeline   r   ry   c                  C   r
   )Nr   HuggingFaceTextGenInference)Z7langchain_community.llms.huggingface_text_gen_inferencer{   rz   r   r   r   &_import_huggingface_text_gen_inference      r|   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   sR   ddl m} t stj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`.)categorytype_to_cls_dictc                 S   s   i | ]\}}|| qS r   r   ).0kvr   r   r   
<dictcomp>0  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-   r0   r3   rE   rH   r9   r<   r?   rB   rK   rQ   rT   rW   rZ   r]   r`   rc   rl   rf   ri   ro   rr   ru   rx   r{   r   r   r   r   r   r   r   r   r   r   r6   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
  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   r4   r   r   r   r"   r   r%   r+   r.   r1   r:   r=   r@   rC   rF   rI   rL   rO   rR   rU   rX   r[   ra   rd   rg   rj   rp   rm   rs   rv   ry   r|   r   r   r   r   r   r   r   r   r   r   r   r7   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   r   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.   r1   r4   r7   r:   r=   r@   rC   rF   rI   rL   rO   rR   rU   rX   r[   r^   ra   rd   rg   rj   rm   rp   rs   rv   ry   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  r  strr  __all__r  r   r   r   r   <module>   s    &U