Allow to optionally propagate the exception raised by a tool execution (#5413)
Issue
Closes #
Change
This pull request allows to optionally propagate the exception raised by a tool execution. The main goal is to remove tons of code duplication in the Quarkus extension that in some cases (like for tools guardrails) relies on this behavior, but in general I believe this is a nice addition also for LangChain4j itself.
General checklist
- There are no breaking changes (API, behaviour)
- I have added unit and/or integration tests for my change
- The tests cover both positive and negative cases
- I have manually run all the unit and integration tests in the module I have added/changed, and they are all green
- I have manually run all the unit and integration tests in the core and main modules, and they are all green
- I have added/updated the documentation
- I have added an example in the examples repo (only for “big” features)
- I have added/updated Spring Boot starter(s) (if applicable)
Checklist for adding new maven module
- I have added my new module in the root
pom.xmlandlangchain4j-bom/pom.xmlChecklist for adding new embedding store integration
- I have added a
{NameOfIntegration}EmbeddingStoreITthat extends from eitherEmbeddingStoreITorEmbeddingStoreWithFilteringIT- I have added a
{NameOfIntegration}EmbeddingStoreRemovalITthat extends fromEmbeddingStoreWithRemovalITChecklist for changing existing embedding store integration
- I have manually verified that the
{NameOfIntegration}EmbeddingStoreworks correctly with the data persisted using the latest released version of LangChain4j
Co-authored-by: Dmytro Liubarskyi ljubarskij@gmail.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
LangChain4j: idiomatic, open-source Java library for building LLM-powered applications on the JVM
Introduction
Welcome!
The goal of LangChain4j is to simplify integrating LLMs into Java applications.
Here’s how:
LangChain4j began development in early 2023 amid the ChatGPT hype. We noticed a lack of Java counterparts to the numerous Python and JavaScript LLM libraries and frameworks, and we had to fix that!
Despite the name, LangChain4j is not a Java port of LangChain (Python) — it is built for Java, not ported to it. It is an idiomatic Java library designed from the ground up around Java conventions: type safety, POJOs, annotations, interfaces, dependency injection, fluent APIs, and first-class integrations with Quarkus, Spring Boot, Helidon, and Micronaut. Its API, internals, and release cycle are independent of the Python LangChain project.
We actively monitor community developments, aiming to quickly incorporate new techniques and integrations, ensuring you stay up-to-date. The library is under active development. While some features are still being worked on, the core functionality is in place, allowing you to start building LLM-powered apps now!
Documentation
Documentation can be found here.
The documentation chatbot (experimental) can be found here.
Getting Started
Getting started guide can be found here.
Code Examples
Please see examples of how LangChain4j can be used in langchain4j-examples repo:
Useful Materials
Useful materials can be found here.
Get Help
Please use Discord or GitHub discussions to get help.
Request Features
Please let us know what features you need by opening an issue.
Contribute
Contribution guidelines can be found here.