Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In PR langchain-ai#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 langchain-ai#25878 which fixed langchain-ai#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 <[email protected]>
- Loading branch information