Skip to content

Commit

Permalink
community[minor]: Update ChatZhipuAI to support GLM-4 model (#16695)
Browse files Browse the repository at this point in the history
Description: Update `ChatZhipuAI` to support the latest `glm-4` model.
Issue: N/A
Dependencies: httpx, httpx-sse, PyJWT

The previous `ChatZhipuAI` implementation requires the `zhipuai`
package, and cannot call the latest GLM model. This is because
- The old version `zhipuai==1.*` doesn't support the latest model.
- `zhipuai==2.*` requires `pydantic V2`, which is incompatible with
'langchain-community'.

This re-implementation invokes the GLM model by sending HTTP requests to
[open.bigmodel.cn](https://open.bigmodel.cn/dev/api) via the `httpx`
package, and uses the `httpx-sse` package to handle stream events.

---------

Co-authored-by: zR <2448370773@qq.com>
  • Loading branch information
2 people authored and hinthornw committed Apr 26, 2024
1 parent 0f724d5 commit 878d6ad
Show file tree
Hide file tree
Showing 6 changed files with 690 additions and 637 deletions.

0 comments on commit 878d6ad

Please sign in to comment.