You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from langchain_community.chat_models.zhipuai import ChatZhipuAI
from langchain.schema import HumanMessage, SystemMessage
messages = [
SystemMessage(
content="You are a smart assistant, please reply to me smartly."
),
HumanMessage(
content="There were 9 birds on the tree. The hunter shot and killed one. How many birds were there?"
),
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
from langchain_community.chat_models.zhipuai import ChatZhipuAI
from langchain.schema import HumanMessage, SystemMessage
messages = [
]
llm = ChatZhipuAI(
temperature=0.95,
model="glm-4"
)
llm(messages)
TypeError Traceback (most recent call last)
[d:](file:///D:/)智谱\glm-cookbook\basic\glm_langchain.ipynb 单元格 7 line 1
4 messages = [
5
6 SystemMessage(
(...)
11 ),
12 ]
14 llm = ChatZhipuAI(
15 temperature=0.95,
16 model="glm-4"
17 )
---> 19 llm(messages)
File d:\python3.11\Lib\site-packages\langchain_core_api\deprecation.py:145, in deprecated..deprecate..warning_emitting_wrapper(*args, **kwargs)
143 warned = True
144 emit_warning()
--> 145 return wrapped(*args, **kwargs)
File d:\python3.11\Lib\site-packages\langchain_core\language_models\chat_models.py:691, in BaseChatModel.call(self, messages, stop, callbacks, **kwargs)
683 @deprecated("0.1.7", alternative="invoke", removal="0.2.0")
684 def call(
685 self,
ref='d:\python3.11\Lib\site-packages\langchain_core\language_models\chat_models.py:1'>1;32m (...)
...
--> 263 if response["code"] != 200:
264 raise RuntimeError(response)
266 content = response["data"]["choices"][0]["content"]
TypeError: 'NoneType' object is not subscriptable
Beta Was this translation helpful? Give feedback.
All reactions