Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community:ChatZhipuAI:ADAPTS to new version zhipuai library #16459

Closed
wants to merge 1 commit into from

Conversation

ptonlix
Copy link

@ptonlix ptonlix commented Jan 23, 2024

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jan 23, 2024
Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 4:16pm

@dosubot dosubot bot added Ɑ: models Related to LLMs or chat model modules 🤖:improvement Medium size change to existing code to handle new use-cases labels Jan 23, 2024
@ptonlix ptonlix changed the title community:ChatZhipuAI:ADAPTS to new version zhipuai libraryNew version ChatZhipuAI community:ChatZhipuAI:ADAPTS to new version zhipuai library Jan 23, 2024
@LuckyLearning
Copy link

LuckyLearning commented Jan 24, 2024

检查一下你的文档,你把秘钥弄上去了 @ptonlix

@Astlvk
Copy link

Astlvk commented Jan 24, 2024

@ptonlix 大佬,单元测试没过,看起来是单元测试这边的依赖没有更新到zhipu 2.0.1。

@ptonlix
Copy link
Author

ptonlix commented Jan 24, 2024

检查一下你的文档,你把秘钥弄上去了 @ptonlix

谢谢 没注意~

@ptonlix
Copy link
Author

ptonlix commented Jan 24, 2024

@ptonlix 大佬,单元测试没过,看起来是单元测试这边的依赖没有更新到zhipu 2.0.1。

有点难顶,依赖冲突了。zhipuai 所需pydantic版本太高
Because no versions of zhipuai match >2.0.1,<3.0.0
and zhipuai (2.0.1) depends on pydantic (>=2.5.2), zhipuai (>=2.0.1,<3.0.0) requires pydantic (>=2.5.2).
And because javelin-sdk (0.1.8) depends on pydantic (>=1.10.7,<2.0.0)
and no versions of javelin-sdk match >0.1.8,<0.2.0, zhipuai (>=2.0.1,<3.0.0) is incompatible with javelin-sdk (>=0.1.8,<0.2.0).
So, because langchain-community depends on both javelin-sdk (^0.1.8) and zhipuai (^2.0.1), version solving failed.

@Astlvk
Copy link

Astlvk commented Jan 25, 2024

@ptonlix 大佬,单元测试没过,看起来是单元测试这边的依赖没有更新到zhipu 2.0.1。

有点难顶,依赖冲突了。zhipuai 所需pydantic版本太高 Because no versions of zhipuai match >2.0.1,<3.0.0 and zhipuai (2.0.1) depends on pydantic (>=2.5.2), zhipuai (>=2.0.1,<3.0.0) requires pydantic (>=2.5.2). And because javelin-sdk (0.1.8) depends on pydantic (>=1.10.7,<2.0.0) and no versions of javelin-sdk match >0.1.8,<0.2.0, zhipuai (>=2.0.1,<3.0.0) is incompatible with javelin-sdk (>=0.1.8,<0.2.0). So, because langchain-community depends on both javelin-sdk (^0.1.8) and zhipuai (^2.0.1), version solving failed.

难顶,看来只能抄下大佬代码,先用着了。

@Shkklt
Copy link

Shkklt commented Jan 28, 2024

@ptonlix ptonlix changed the title community:ChatZhipuAI:ADAPTS to new version zhipuai libraryNew version ChatZhipuAI community:ChatZhipuAI:ADAPTS to new version zhipuai library Jan 24, 2024

大佬代码在哪里?

@ptonlix
Copy link
Author

ptonlix commented Jan 29, 2024

@ptonlix ptonlix changed the title community:ChatZhipuAI:ADAPTS to new version zhipuai libraryNew version ChatZhipuAI community:ChatZhipuAI:ADAPTS to new version zhipuai library Jan 24, 2024

大佬代码在哪里?

看一下我的commit

@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@web4zn
Copy link

web4zn commented Feb 5, 2024

glm = ChatZhipuAI(
    temperature=0.5,
    api_key=zhipuai_api_key,
    model="chatglm_turbo",
)

from langchain_core.prompts import ChatPromptTemplate
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are world class technical documentation writer."),
    ("user", "{input}")
])

chain = prompt | glm
chain.invoke({"input": "how can langsmith help with testing?"})

@ptonlix 你好,我在学习langchain过程,替换你的代码之后,正常的invoke是没有问题的,但是用chain遇到以下报错,但是我没找到问题在哪,你有遇到这个问题吗?

zhipuai.core._errors.APIRequestFailedError: Error code: 400, with error text {"error":{"code":"1214","message":"history参数非法。请检查文档。"}}

@lonffreytu
Copy link

glm = ChatZhipuAI(
    temperature=0.5,
    api_key=zhipuai_api_key,
    model="chatglm_turbo",
)

from langchain_core.prompts import ChatPromptTemplate
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are world class technical documentation writer."),
    ("user", "{input}")
])

chain = prompt | glm
chain.invoke({"input": "how can langsmith help with testing?"})

@ptonlix 你好,我在学习langchain过程,替换你的代码之后,正常的invoke是没有问题的,但是用chain遇到以下报错,但是我没找到问题在哪,你有遇到这个问题吗?

zhipuai.core._errors.APIRequestFailedError: Error code: 400, with error text {"error":{"code":"1214","message":"history参数非法。请检查文档。"}}

模型名称“chatglm_turbo”已过期。现在仅支持glm-3-turbo或以上模型。具体可参考官方api文档 https://open.bigmodel.cn/dev/api#language

另外感谢楼主开源出适配最新gml的版本

@baskaryan
Copy link
Collaborator

hey @ptonlix, is this pr still needed?

@linancn
Copy link
Contributor

linancn commented Apr 7, 2024

hey @ptonlix, is this pr still needed?

@ptonlix @baskaryan This PR should be closed, already solved by #16695.

@baskaryan
Copy link
Collaborator

hey @ptonlix, is this pr still needed?

@ptonlix @baskaryan This PR should be closed, already solved by #16695.

closing per ^

@baskaryan baskaryan closed this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases Ɑ: models Related to LLMs or chat model modules size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants