langchain/libs/community
Cheese 0ead09f84d
community: Implement bind_tools for ChatTongyi (#20725)
## Description

Implement `bind_tools` in ChatTongyi. Usage example:

```py
from langchain_core.tools import tool
from langchain_community.chat_models.tongyi import ChatTongyi

@tool
def multiply(first_int: int, second_int: int) -> int:
    """Multiply two integers together."""
    return first_int * second_int

llm = ChatTongyi(model="qwen-turbo")

llm_with_tools = llm.bind_tools([multiply])

msg = llm_with_tools.invoke("What's 5 times forty two")

print(msg)
```

Streaming is also supported.

## Dependencies

No Dependency is required for this change.

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-05-16 10:39:35 -04:00
..
langchain_community community: Implement bind_tools for ChatTongyi (#20725) 2024-05-16 10:39:35 -04:00
scripts langchain[patch],community[minor]: Move some unit tests from langchain to community, use core for fake models (#21190) 2024-05-02 09:57:52 -04:00
tests community: Implement bind_tools for ChatTongyi (#20725) 2024-05-16 10:39:35 -04:00
Makefile community[minor]: add Kinetica LLM wrapper (#17879) 2024-02-22 16:02:00 -08:00
poetry.lock multiple: core 0.2 nonbreaking dep, check_diff community->langchain dep (#21646) 2024-05-13 19:50:36 -07:00
pyproject.toml multiple: core 0.2 nonbreaking dep, check_diff community->langchain dep (#21646) 2024-05-13 19:50:36 -07:00
README.md Batch update of alt text and title attributes for images in md/mdx files across repo (#15357) 2024-01-12 14:37:48 -08:00

🦜🧑‍🤝‍🧑 LangChain Community

Downloads License: MIT

Quick Install

pip install langchain-community

What is it?

LangChain Community contains third-party integrations that implement the base interfaces defined in LangChain Core, making them ready-to-use in any LangChain application.

For full documentation see the API reference.

Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.

📕 Releases & Versioning

langchain-community is currently on version 0.0.x

All changes will be accompanied by a patch version increase.

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

For detailed information on how to contribute, see the Contributing Guide.