[GH-ISSUE #33] 无法支持 autogpt 中的 langchain #31

Open
opened 2026-10-26 21:07:00 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @chenny on GitHub (May 16, 2024).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V2/issues/33

单独 langchain 是支持.
image

但是在 autogpt 中就不行了.
image
image

语言模型

llm = ChatOpenAI(
    openai_api_base="https://api.deepseek.com/v1",
    openai_api_key="sk-exxxxxxxxxxxxxxxxxxx6",
    model="deepseek-chat",
    temperature=0,
    model_kwargs={
        "seed": 42
    },
)
Originally created by @chenny on GitHub (May 16, 2024). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V2/issues/33 单独 langchain 是支持. <img width="1182" alt="image" src="https://github.com/deepseek-ai/DeepSeek-V2/assets/883329/1e3a45ef-9d1a-47ee-b654-718c5fff3121"> 但是在 autogpt 中就不行了. <img width="1135" alt="image" src="https://github.com/deepseek-ai/DeepSeek-V2/assets/883329/65736a17-ed9b-4c0d-8c0d-fdccde32e985"> <img width="778" alt="image" src="https://github.com/deepseek-ai/DeepSeek-V2/assets/883329/2ade2bb7-030c-4c19-8637-617900871e2f"> # 语言模型 llm = ChatOpenAI( openai_api_base="https://api.deepseek.com/v1", openai_api_key="sk-exxxxxxxxxxxxxxxxxxx6", model="deepseek-chat", temperature=0, model_kwargs={ "seed": 42 }, )
Author
Owner

@andakai commented on GitHub (May 23, 2024):

+1

<!-- gh-comment-id:2126307037 --> @andakai commented on GitHub (May 23, 2024): +1
Author
Owner

@xyh0202 commented on GitHub (May 28, 2024):

这里报错的是 get_num_tokens_from_messages() 这个方法没有实现,在langchain的源码中,使用非gpt-3.5或者gpt-4的模型,都不支持计算tokens
https://github.com/langchain-ai/langchain/blob/master/libs/partners/openai/langchain_openai/chat_models/base.py

<!-- gh-comment-id:2134215401 --> @xyh0202 commented on GitHub (May 28, 2024): 这里报错的是 get_num_tokens_from_messages() 这个方法没有实现,在langchain的源码中,使用非gpt-3.5或者gpt-4的模型,都不支持计算tokens https://github.com/langchain-ai/langchain/blob/master/libs/partners/openai/langchain_openai/chat_models/base.py
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-V2#31
No description provided.