-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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[minor]: Update model client to support vision model in Tong… #21474
Merged
baskaryan
merged 2 commits into
langchain-ai:master
from
pcliupc:feat/support-tongyi-vision-model
May 21, 2024
Merged
community[minor]: Update model client to support vision model in Tong… #21474
baskaryan
merged 2 commits into
langchain-ai:master
from
pcliupc:feat/support-tongyi-vision-model
May 21, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
pcliupc
commented
May 9, 2024
•
edited
edited
- Description: Tongyi uses different client for chat model and vision model. This PR chooses proper client based on model name to support both chat model and vision model. Reference tongyi document for details.
- Issue: None
- Dependencies: None
- Twitter handle: None
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dosubot
bot
added
size:S
This PR changes 10-29 lines, ignoring generated files.
🤖:improvement
Medium size change to existing code to handle new use-cases
size:M
This PR changes 30-99 lines, ignoring generated files.
and removed
size:S
This PR changes 10-29 lines, ignoring generated files.
labels
May 9, 2024
pcliupc
force-pushed
the
feat/support-tongyi-vision-model
branch
3 times, most recently
from
May 9, 2024 10:11
a8dea08
to
3eb08dd
Compare
@baskaryan Would you like to take a look at this pr? |
pcliupc
force-pushed
the
feat/support-tongyi-vision-model
branch
from
May 21, 2024 11:47
10ab200
to
7d14873
Compare
baskaryan
approved these changes
May 21, 2024
dosubot
bot
added
the
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
label
May 21, 2024
JuHyung-Son
pushed a commit
to JuHyung-Son/langchain
that referenced
this pull request
May 23, 2024
langchain-ai#21474) - **Description:** Tongyi uses different client for chat model and vision model. This PR chooses proper client based on model name to support both chat model and vision model. Reference [tongyi document](https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-plus-api?spm=a2c4g.11186623.0.0.27404c9a7upm11) for details. ``` from langchain_core.messages import HumanMessage from langchain_community.chat_models import ChatTongyi llm = ChatTongyi(model_name='qwen-vl-max') image_message = { "image": "https://lilianweng.github.io/posts/2023-06-23-agent/agent-overview.png" } text_message = { "text": "summarize this picture", } message = HumanMessage(content=[text_message, image_message]) llm.invoke([message]) ``` - **Issue:** None - **Dependencies:** None - **Twitter handle:** None
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
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
size:M
This PR changes 30-99 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.