langchain/libs/community/langchain_community/llms
Tao Wang 25a1031871
community: Fix a validation error for MoonshotChat (#27801)
- **Description:** Change `MoonshotCommon.client` type from
`_MoonshotClient` to `Any`.
- **Issue:** Fix the issue #27058
- **Dependencies:** No
- **Twitter handle:** TaoWang2218

In PR #17100, the implementation for Moonshot was added, which defined
two classes:

- `MoonshotChat(MoonshotCommon, ChatOpenAI)` in
`langchain_community.chat_models.moonshot`;
- Here, `validate_environment()` assigns **client** as
`openai.OpenAI().chat.completions`
- Note that **client** here is actually a member variable defined in
`ChatOpenAI`;
- `MoonshotCommon` in `langchain_community.llms.moonshot`;
- And here, `validate_environment()` assigns **_client** as
`_MoonshotClient`;
- Note that this is the underscored **_client**, which is defined within
`MoonshotCommon` itself;

At this time, there was no conflict between the two, one being `client`
and the other `_client`.

However, in PR #25878 which fixed #24390, `_client` in `MoonshotCommon`
was changed to `client`. Since then, a conflict in the definition of
`client` has arisen between `MoonshotCommon` and `MoonshotChat`, which
caused `pydantic` validation error.

To fix this issue, the type of `client` in `MoonshotCommon` should be
changed to `Any`.

Signed-off-by: Tao Wang <twang2218@gmail.com>
2024-10-31 14:00:16 -04:00
..
grammars community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
__init__.py community: Update OCI data science integration (#27083) 2024-10-15 08:32:54 -07:00
ai21.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
aleph_alpha.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
amazon_api_gateway.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
anthropic.py core,integrations[minor]: Dont error on fields in model_kwargs (#27110) 2024-10-04 11:30:27 -07:00
anyscale.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
aphrodite.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
arcee.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
aviary.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
azureml_endpoint.py community[patch]: Fix missing protected_namespaces (#27076) 2024-10-03 20:12:11 +00:00
baichuan.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
baidu_qianfan_endpoint.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
bananadev.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
baseten.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
beam.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
bedrock.py community: fixed KeyError: 'client' (#27345) 2024-10-14 20:51:13 +00:00
bigdl_llm.py community[minor]: import fix (#20995) 2024-04-29 10:32:50 -04:00
bittensor.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
cerebriumai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
chatglm3.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
chatglm.py patch: remove usage of llm, chat model __call__ (#20788) 2024-04-24 19:39:23 -04:00
clarifai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
cloudflare_workersai.py community[patch]: callback before yield for cloudflare (#26927) 2024-09-27 08:42:01 -04:00
cohere.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
ctransformers.py core[minor],community[minor]: Upgrade all @root_validator() to @pre_init (#23841) 2024-07-08 16:09:29 -04:00
ctranslate2.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
databricks.py community: Add deprecation notice for Databricks integration in langchain-community (#27355) 2024-10-16 02:20:40 +00:00
deepinfra.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
deepsparse.py community[patch]: callback before yield for deepsparse llm (#26822) 2024-09-24 13:55:52 -04:00
edenai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
exllamav2.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
fake.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
fireworks.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
forefrontai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
friendli.py community[patch]: callback before yield for friendli (#26842) 2024-09-25 09:31:12 -04:00
gigachat.py community[patch]: callback before yield for gigachat (#26881) 2024-09-26 12:47:28 -04:00
google_palm.py community[patch]: callback before yield for google palm (#26882) 2024-09-26 12:47:05 -04:00
gooseai.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
gpt4all.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
gradient_ai.py community: fix lint from new mypy (#27474) 2024-10-18 20:08:03 +00:00
huggingface_endpoint.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
huggingface_hub.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
huggingface_pipeline.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
huggingface_text_gen_inference.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
human.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
ipex_llm.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
javelin_ai_gateway.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
koboldai.py patch: remove usage of llm, chat model __call__ (#20788) 2024-04-24 19:39:23 -04:00
konko.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
layerup_security.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
llamacpp.py core,integrations[minor]: Dont error on fields in model_kwargs (#27110) 2024-10-04 11:30:27 -07:00
llamafile.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
loading.py community[patch]: Use get_fields adapter for pydantic (#25191) 2024-08-08 14:43:09 -04:00
manifest.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
minimax.py community[patch]: Fix missing protected_namespaces (#27076) 2024-10-03 20:12:11 +00:00
mlflow_ai_gateway.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
mlflow.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
mlx_pipeline.py community[patch]: callback before yield for mlx pipeline (#26928) 2024-09-27 08:41:34 -04:00
modal.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
moonshot.py community: Fix a validation error for MoonshotChat (#27801) 2024-10-31 14:00:16 -04:00
mosaicml.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
nlpcloud.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
oci_data_science_model_deployment_endpoint.py community: Update OCI data science integration (#27083) 2024-10-15 08:32:54 -07:00
oci_generative_ai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
octoai_endpoint.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
ollama.py community: deprecate community ollama integrations (#26733) 2024-10-01 09:18:07 -07:00
opaqueprompts.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
openai.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
openllm.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
openlm.py core[minor],community[minor]: Upgrade all @root_validator() to @pre_init (#23841) 2024-07-08 16:09:29 -04:00
pai_eas_endpoint.py core[minor],community[minor]: Upgrade all @root_validator() to @pre_init (#23841) 2024-07-08 16:09:29 -04:00
petals.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
pipelineai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
predibase.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
predictionguard.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
promptlayer_openai.py community[patch]: docstrings update (#20301) 2024-04-11 16:23:27 -04:00
replicate.py community: Update Replicate LLM and fix tests (#27655) 2024-10-30 16:07:08 +00:00
rwkv.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
sagemaker_endpoint.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
sambanova.py community: sambastudio llm refactor (#27215) 2024-10-27 11:08:15 -04:00
self_hosted_hugging_face.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
self_hosted.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
solar.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
sparkllm.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
stochasticai.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
symblai_nebula.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
textgen.py community[patch]: callback before yield for textgen (#26929) 2024-09-27 08:41:13 -04:00
titan_takeoff.py community[patch]: callback before yield for titan takeoff (#26930) 2024-09-27 08:40:22 -04:00
together.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
tongyi.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
utils.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
vertexai.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
vllm.py community[patch]: Fix vLLM integration to apply lora_request (#27731) 2024-10-30 13:59:34 +00:00
volcengine_maas.py community[patch]: Fix missing protected_namespaces (#27076) 2024-10-03 20:12:11 +00:00
watsonxllm.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
weight_only_quantization.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
writer.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
xinference.py community[patch]: optimize xinference llm import (#25809) 2024-08-29 01:41:43 +00:00
yandex.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
yi.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
you.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
yuan2.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00