a
    agB                     @   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 eddd	Zedd
dZedddZedddZedddZedddZedddZedddZedddZedddZedddZedddZedd d!Zedd"d#Zedd$d%Zedd&d'Zedd(d)Zedd*d+Zedd,d-Zedd.d/Z edd0d1Z!edd2d3Z"edd4d5Z#edd6d7Z$edd8d9Z%edd:d;Z&edd<d=Z'edd>d?Z(edd@dAZ)eddBdCZ*eddDdEZ+eddFdGZ,eddHdIZ-eddJdKZ.eddLdMZ/eddNdOZ0eddPdQZ1eddRdSZ2eddTdUZ3eddVdWZ4eddXdYZ5eddZd[Z6edd\d]Z7edd^d_Z8edd`daZ9eddbdcZ:eddddeZ;eddfdgZ<eddhdiZ=eddjdkZ>eddldmZ?eddndoZ@eddpdqZAeddrdsZBeddtduZCeddvdwZDeddxdyZEeddzd{ZFedd|d}ZGedd~dZHedddZIedddZJedddZKedddZLedddZMedddZNedddZOedddZPedddZQedddZRedddZSedddZTedddZUedddZVedddZWedddZXedddZYedddZZedddZ[edddZ\edddZ]edddZ^edddZ_edddZ`edddZaebedddZcg dZdeebeg ee
 f f d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   s   ddl m}  | S )Nr   AI21)Zlangchain_community.llms.ai21r   r
    r   e/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/langchain/llms/__init__.py_import_ai21   s    r   c                  C   s   ddl m}  | S )Nr   
AlephAlpha)Z$langchain_community.llms.aleph_alphar   r   r   r   r   _import_aleph_alpha$   s    r   c                  C   s   ddl m}  | S )Nr   AmazonAPIGateway)Z+langchain_community.llms.amazon_api_gatewayr   r   r   r   r   _import_amazon_api_gateway*   s    r   c                  C   s   ddl m}  | S )Nr   	Anthropic)Z"langchain_community.llms.anthropicr   r   r   r   r   _import_anthropic0   s    r   c                  C   s   ddl m}  | S )Nr   Anyscale)Z!langchain_community.llms.anyscaler   r   r   r   r   _import_anyscale6   s    r   c                  C   s   ddl m}  | S )Nr   Arcee)Zlangchain_community.llms.arceer   r   r   r   r   _import_arcee<   s    r   c                  C   s   ddl m}  | S )Nr   Aviary)Zlangchain_community.llms.aviaryr   r   r   r   r   _import_aviaryB   s    r    c                  C   s   ddl m}  | S )Nr   AzureMLOnlineEndpoint)Z)langchain_community.llms.azureml_endpointr"   r!   r   r   r   _import_azureml_endpointH   s    r#   c                  C   s   ddl m}  | S )Nr   QianfanLLMEndpoint)Z/langchain_community.llms.baidu_qianfan_endpointr%   r$   r   r   r   _import_baidu_qianfan_endpointN   s    r&   c                  C   s   ddl m}  | S )Nr   Banana)Z"langchain_community.llms.bananadevr(   r'   r   r   r   _import_bananadevT   s    r)   c                  C   s   ddl m}  | S )Nr   Baseten)Z langchain_community.llms.basetenr+   r*   r   r   r   _import_basetenZ   s    r,   c                  C   s   ddl m}  | S )Nr   Beam)Zlangchain_community.llms.beamr.   r-   r   r   r   _import_beam`   s    r/   c                  C   s   ddl m}  | S )Nr   Bedrock)Z langchain_community.llms.bedrockr1   r0   r   r   r   _import_bedrockf   s    r2   c                  C   s   ddl m}  | S )Nr   NIBittensorLLM)Z"langchain_community.llms.bittensorr4   r3   r   r   r   _import_bittensorl   s    r5   c                  C   s   ddl m}  | S )Nr   CerebriumAI)Z$langchain_community.llms.cerebriumair7   r6   r   r   r   _import_cerebriumair   s    r8   c                  C   s   ddl m}  | S )Nr   ChatGLM)Z langchain_community.llms.chatglmr:   r9   r   r   r   _import_chatglmx   s    r;   c                  C   s   ddl m}  | S )Nr   Clarifai)Z!langchain_community.llms.clarifair=   r<   r   r   r   _import_clarifai~   s    r>   c                  C   s   ddl m}  | S )Nr   Cohere)Zlangchain_community.llms.coherer@   r?   r   r   r   _import_cohere   s    rA   c                  C   s   ddl m}  | S )Nr   CTransformers)Z&langchain_community.llms.ctransformersrC   rB   r   r   r   _import_ctransformers   s    rD   c                  C   s   ddl m}  | S )Nr   CTranslate2)Z$langchain_community.llms.ctranslate2rF   rE   r   r   r   _import_ctranslate2   s    rG   c                  C   s   ddl m}  | S )Nr   
Databricks)Z#langchain_community.llms.databricksrI   rH   r   r   r   _import_databricks   s    rJ   c                  C   s   ddl m}  | S )Nr   ChatDatabricks)Z*langchain_community.chat_models.databricksrL   rK   r   r   r   _import_databricks_chat   s    rM   c                  C   s   ddl m}  | S )Nr   	DeepInfra)Z"langchain_community.llms.deepinfrarO   rN   r   r   r   _import_deepinfra   s    rP   c                  C   s   ddl m}  | S )Nr   
DeepSparse)Z#langchain_community.llms.deepsparserR   rQ   r   r   r   _import_deepsparse   s    rS   c                  C   s   ddl m}  | S )Nr   EdenAI)Zlangchain_community.llms.edenairU   rT   r   r   r   _import_edenai   s    rV   c                  C   s   ddl m}  | S )Nr   FakeListLLM)Zlangchain_core.language_modelsrX   rW   r   r   r   _import_fake   s    rY   c                  C   s   ddl m}  | S )Nr   	Fireworks)Z"langchain_community.llms.fireworksr[   rZ   r   r   r   _import_fireworks   s    r\   c                  C   s   ddl m}  | S )Nr   ForefrontAI)Z$langchain_community.llms.forefrontair^   r]   r   r   r   _import_forefrontai   s    r_   c                  C   s   ddl m}  | S )Nr   GigaChat)Z!langchain_community.llms.gigachatra   r`   r   r   r   _import_gigachat   s    rb   c                  C   s   ddl m}  | S )Nr   
GooglePalm)Z$langchain_community.llms.google_palmrd   rc   r   r   r   _import_google_palm   s    re   c                  C   s   ddl m}  | S )Nr   GooseAI)Z langchain_community.llms.gooseairg   rf   r   r   r   _import_gooseai   s    rh   c                  C   s   ddl m}  | S )Nr   GPT4All)Z langchain_community.llms.gpt4allrj   ri   r   r   r   _import_gpt4all   s    rk   c                  C   s   ddl m}  | S )Nr   GradientLLM)Z$langchain_community.llms.gradient_airm   rl   r   r   r   _import_gradient_ai   s    rn   c                  C   s   ddl m}  | S )Nr   HuggingFaceEndpoint)Z-langchain_community.llms.huggingface_endpointrp   ro   r   r   r   _import_huggingface_endpoint   s    rq   c                  C   s   ddl m}  | S )Nr   HuggingFaceHub)Z(langchain_community.llms.huggingface_hubrs   rr   r   r   r   _import_huggingface_hub   s    rt   c                  C   s   ddl m}  | S )Nr   HuggingFacePipeline)Z-langchain_community.llms.huggingface_pipelinerv   ru   r   r   r   _import_huggingface_pipeline   s    rw   c                  C   s   ddl m}  | S )Nr   HuggingFaceTextGenInference)Z7langchain_community.llms.huggingface_text_gen_inferencery   rx   r   r   r   &_import_huggingface_text_gen_inference   s    rz   c                  C   s   ddl m}  | S )Nr   HumanInputLLM)Zlangchain_community.llms.humanr|   r{   r   r   r   _import_human   s    r}   c                  C   s   ddl m}  | S )Nr   JavelinAIGateway)Z+langchain_community.llms.javelin_ai_gatewayr   r~   r   r   r   _import_javelin_ai_gateway  s    r   c                  C   s   ddl m}  | S )Nr   KoboldApiLLM)Z!langchain_community.llms.koboldair   r   r   r   r   _import_koboldai
  s    r   c                  C   s   ddl m}  | S )Nr   LlamaCpp)Z!langchain_community.llms.llamacppr   r   r   r   r   _import_llamacpp  s    r   c                  C   s   ddl m}  | S )Nr   ManifestWrapper)Z!langchain_community.llms.manifestr   r   r   r   r   _import_manifest  s    r   c                  C   s   ddl m}  | S )Nr   Minimax)Z langchain_community.llms.minimaxr   r   r   r   r   _import_minimax  s    r   c                  C   s   ddl m}  | S )Nr   Mlflow)Zlangchain_community.llms.mlflowr   r   r   r   r   _import_mlflow"  s    r   c                  C   s   ddl m}  | S )Nr   
ChatMlflow)Z&langchain_community.chat_models.mlflowr   r   r   r   r   _import_mlflow_chat(  s    r   c                  C   s   ddl m}  | S )Nr   MlflowAIGateway)Z*langchain_community.llms.mlflow_ai_gatewayr   r   r   r   r   _import_mlflow_ai_gateway.  s    r   c                  C   s   ddl m}  | S )Nr   Modal)Zlangchain_community.llms.modalr   r   r   r   r   _import_modal4  s    r   c                  C   s   ddl m}  | S )Nr   MosaicML)Z!langchain_community.llms.mosaicmlr   r   r   r   r   _import_mosaicml:  s    r   c                  C   s   ddl m}  | S )Nr   NLPCloud)Z!langchain_community.llms.nlpcloudr   r   r   r   r   _import_nlpcloud@  s    r   c                  C   s   ddl m}  | S )Nr   OctoAIEndpoint)Z(langchain_community.llms.octoai_endpointr   r   r   r   r   _import_octoai_endpointF  s    r   c                  C   s   ddl m}  | S )Nr   Ollama)Zlangchain_community.llms.ollamar   r   r   r   r   _import_ollamaL  s    r   c                  C   s   ddl m}  | S )Nr   OpaquePrompts)Z&langchain_community.llms.opaquepromptsr   r   r   r   r   _import_opaquepromptsR  s    r   c                  C   s   ddl m}  | S )Nr   AzureOpenAI)langchain_community.llms.openair   r   r   r   r   _import_azure_openaiX  s    r   c                  C   s   ddl m}  | S )Nr   OpenAI)r   r   r   r   r   r   _import_openai^  s    r   c                  C   s   ddl m}  | S )Nr   
OpenAIChat)r   r   r   r   r   r   _import_openai_chatd  s    r   c                  C   s   ddl m}  | S )Nr   OpenLLM)Z langchain_community.llms.openllmr   r   r   r   r   _import_openllmj  s    r   c                  C   s   ddl m}  | S )Nr   OpenLM)Zlangchain_community.llms.openlmr   r   r   r   r   _import_openlmp  s    r   c                  C   s   ddl m}  | S )Nr   PaiEasEndpoint)Z)langchain_community.llms.pai_eas_endpointr   r   r   r   r   _import_pai_eas_endpointv  s    r   c                  C   s   ddl m}  | S )Nr   Petals)Zlangchain_community.llms.petalsr   r   r   r   r   _import_petals|  s    r   c                  C   s   ddl m}  | S )Nr   
PipelineAI)Z#langchain_community.llms.pipelineair   r   r   r   r   _import_pipelineai  s    r   c                  C   s   ddl m}  | S )Nr   	Predibase)Z"langchain_community.llms.predibaser   r   r   r   r   _import_predibase  s    r   c                  C   s   ddl m}  | S )Nr   PredictionGuard)Z(langchain_community.llms.predictionguardr   r   r   r   r   _import_predictionguard  s    r   c                  C   s   ddl m}  | S )Nr   PromptLayerOpenAI)+langchain_community.llms.promptlayer_openair   r   r   r   r   _import_promptlayer  s    r   c                  C   s   ddl m}  | S )Nr   PromptLayerOpenAIChat)r   r   r   r   r   r   _import_promptlayer_chat  s    r   c                  C   s   ddl m}  | S )Nr   	Replicate)Z"langchain_community.llms.replicater   r   r   r   r   _import_replicate  s    r   c                  C   s   ddl m}  | S )Nr   RWKV)Zlangchain_community.llms.rwkvr   r   r   r   r   _import_rwkv  s    r   c                  C   s   ddl m}  | S )Nr   SagemakerEndpoint)Z+langchain_community.llms.sagemaker_endpointr   r   r   r   r   _import_sagemaker_endpoint  s    r   c                  C   s   ddl m}  | S )Nr   SelfHostedPipeline)Z$langchain_community.llms.self_hostedr   r   r   r   r   _import_self_hosted  s    r   c                  C   s   ddl m}  | S )Nr   SelfHostedHuggingFaceLLM)Z1langchain_community.llms.self_hosted_hugging_facer   r   r   r   r    _import_self_hosted_hugging_face  s    r   c                  C   s   ddl m}  | S )Nr   StochasticAI)Z%langchain_community.llms.stochasticair   r   r   r   r   _import_stochasticai  s    r   c                  C   s   ddl m}  | S )Nr   Nebula)Z'langchain_community.llms.symblai_nebular   r   r   r   r   _import_symblai_nebula  s    r   c                  C   s   ddl m}  | S )Nr   TextGen)Z langchain_community.llms.textgenr   r   r   r   r   _import_textgen  s    r   c                  C   s   ddl m}  | S Nr   TitanTakeoffZ&langchain_community.llms.titan_takeoffr   r   r   r   r   _import_titan_takeoff  s    r   c                  C   s   ddl m}  | S r   r   r   r   r   r   _import_titan_takeoff_pro  s    r   c                  C   s   ddl m}  | S )Nr   Together)Z!langchain_community.llms.togetherr   r   r   r   r   _import_together  s    r   c                  C   s   ddl m}  | S )Nr   Tongyi)Zlangchain_community.llms.tongyir   r   r   r   r   _import_tongyi  s    r   c                  C   s   ddl m}  | S )Nr   VertexAI)!langchain_community.llms.vertexair   r   r   r   r   _import_vertex  s    r   c                  C   s   ddl m}  | S )Nr   VertexAIModelGarden)r   r   r   r   r   r   _import_vertex_model_garden  s    r   c                  C   s   ddl m}  | S )Nr   VLLM)langchain_community.llms.vllmr   r   r   r   r   _import_vllm  s    r   c                  C   s   ddl m}  | S )Nr   
VLLMOpenAI)r   r   r   r   r   r   _import_vllm_openai  s    r   c                  C   s   ddl m}  | S )Nr   
WatsonxLLM)Z#langchain_community.llms.watsonxllmr  r   r   r   r   _import_watsonxllm  s    r  c                  C   s   ddl m}  | S )Nr   Writer)Zlangchain_community.llms.writerr  r  r   r   r   _import_writer  s    r  c                  C   s   ddl m}  | S )Nr   
Xinference)Z#langchain_community.llms.xinferencer  r  r   r   r   _import_xinference  s    r  c                  C   s   ddl m}  | S )Nr   	YandexGPT)Zlangchain_community.llms.yandexr
  r	  r   r   r   _import_yandex_gpt  s    r  c                  C   s   ddl m}  | S )Nr   VolcEngineMaasLLM)Z(langchain_community.llms.volcengine_maasr  r  r   r   r   _import_volcengine_maas  s    r  )namer	   c                 C   sV   ddl m} t s(tjd|  dtd | dkrHdd t  D }|S t|| S d 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+   r.   r1   rC   rF   r7   r:   r=   r@   rI   rO   rR   rU   rX   r[   r^   ra   rj   rd   rg   rm   rp   rs   rv   ry   r|   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   ZTitanTakeoffPror   r   r   r   r   r  r  r   r  r   r%   r
  r  c                P   C   s   t ttttttttt	t
tttttttttttttttttttttt t!t"t#t$t%t&t't(t)t*t+t,t-t.t/t0t1t2t3t4t5t6t7t8t9t:t;t<t=t>t?t@tAtBtCtDtDtEtFtGtHtItJtKtLtMdOS )N)OZ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_gardenZ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    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,   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__r  r   r   r   r   <module>   s   U