Commit Graph

167 Commits

Author SHA1 Message Date
LangChain4j 42c958a458
Extract HtmlTextExtractor into its own module (#1811)
## Issue
Closes #1049

## Change
Extracted `HtmlTextExtractor` into
`langchain4j-document-transformer-jsoup` module.
Renamed `HtmlToTextDocumentTransformer` into `HtmlTextExtractor`.

Please import:
```xml
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-document-transformer-jsoup</artifactId>
    <version>0.35.0</version>
</dependency>
```

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [X] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-24 15:08:23 +02:00
LangChain4j 10ea33fe26 OpenAI: return token usage returned by OpenAI (#1622) 2024-09-22 10:39:00 +02:00
Julien Dubois ca0ae8af73
Bumps com.azure:azure-storage-blob from 12.27.1 to 12.28.0. (#1794) 2024-09-19 10:23:58 +02:00
Julien Dubois d9ab42674e
Bumps com.azure:azure-storage-common from 12.26.1 to 12.27.0. (#1793) 2024-09-19 10:23:00 +02:00
Julien Dubois 082f25e207
Bump com.azure:azure-identity from 1.13.2 to 1.13.3 (#1783) 2024-09-16 15:46:56 +02:00
LangChain4j 3471e84fa2 OpenAI: added maxCompletionTokens 2024-09-16 14:14:18 +02:00
Guillaume Laforge 858cc9c19d
Google AI Gemini — support for Enum structured output (#1741)
## Change

In addition to `application/json`, Gemini also supports `text/x.enum` as
a structured output format, which is great for classification.

This PR covers both Google Vertex AI Gemini and Google AI Gemini models.

A minor internal change to create the `GeminiService` at construction
time rather than on each request.

+ Observability (ChatLanguageModel) for Google AI Gemini


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] 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](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-13 22:44:43 +02:00
LangChain4j 21d35e4434 changed version to 0.35.0-SNAPSHOT 2024-09-09 10:11:09 +02:00
LangChain4j b0a8e6f45b
Release 0.34.0 (#1711) 2024-09-05 16:49:39 +02:00
LangChain4j a041d80cd1
OpenAI: migrate from Gson to Jackson (#1667)
## Change
Migrated OpenAI module from Gson to Jackson.
Related: https://github.com/ai-for-java/openai4j/pull/35 and
https://github.com/ai-for-java/openai4j/pull/36

## General checklist
- [X] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-09-02 17:03:26 +02:00
Julien Dubois fe1623d542
Bump com.azure:azure-ai-openai from 1.0.0-beta.10 to 1.0.0-beta.11 (#1656) 2024-09-02 10:46:12 +02:00
PrimosK c4b6ed5c78
re #1506 Enable Maven enforcer plugin and fix dependency conflict introduced by `okhttp` dependency in 19 modules. (#1645)
## Issue

#1506

## Change

Resolved version conflict:
```
[ERROR] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence failed with message:
[ERROR] Failed while enforcing releasability.
[ERROR]
[ERROR] Dependency convergence error for org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10 paths to dependency are:
[ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT
[ERROR]   +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile
[ERROR]     +-com.squareup.okio:okio:jar:3.6.0:compile
[ERROR]       +-com.squareup.okio:okio-jvm:jar:3.6.0:compile
[ERROR]         +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.10:compile
[ERROR] and
[ERROR] +-dev.langchain4j:langchain4j-ollama:jar:0.34.0-SNAPSHOT
[ERROR]   +-com.squareup.okhttp3:okhttp:jar:4.12.0:compile
[ERROR]     +-org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.8.21:compile
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :langchain4j-ollama
```

... caused by 'okhttp' dependency and enabled Maven enforcer plugin in
the following modules:

- LangChain4j :: Integration :: Anthropic
- LangChain4j :: Integration :: ChatGLM
- LangChain4j :: Integration :: Chroma
- LangChain4j :: Integration :: CloudFlare Workers AI
- LangChain4j :: Integration :: Cohere
- LangChain4j :: Integration :: DashScope
- LangChain4j :: Integration :: Hugging Face
- LangChain4j :: Integration :: Jina
- LangChain4j :: Integration :: Judge0
- LangChain4j :: Integration :: MistralAI
- LangChain4j :: Integration :: Nomic
- LangChain4j :: Integration :: OVHcloud AI
- LangChain4j :: Integration :: Ollama
- LangChain4j :: Integration :: Qianfan
- LangChain4j :: Integration :: Vearch
- LangChain4j :: Integration :: Vespa
- LangChain4j :: Integration :: Zhipu AI
- LangChain4j :: Web Search Engine :: SearchApi
- LangChain4j :: Web Search Engine :: Tavily

## Note

Please note that [issue ](https://github.com/square/okhttp/issues/8288)
for this was already created in `httpok` repository but it will not be
fixed in 4.x. It's reportedly already tackled in version 5.x.

With that in mind I suggest we apply temporary changes proposed in this
PR. After upgrading to `httpok` 5.x we will be able to remove these.

## Tests

`mvn clean test` passed
2024-08-27 17:44:06 +02:00
Pavel Reshetnik cf27e1dbc5
Milvus - upgrade to Milvus SDK 2.3.9 (#1642)
## Issue
Closes #1629

## Change
Upgrade to Milvus SDK 2.3.9 and replace com.alibaba.fastjson with
com.google.gson

## General checklist
- [X] There are no breaking changes
- [N/A] I have added unit and integration tests for my change
- [+-] 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](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green

* I had to skip the MilvusEmbeddingStoreCloudIT test due to a lack of
credentials. However, other Milvus tests passed.
* While the [core] tests were successful, the [main] tests failed
because I lack credentials for several cloud providers.

<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for adding new embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have added a `{NameOfIntegration}EmbeddingStoreIT` that extends
from either `EmbeddingStoreIT` or `EmbeddingStoreWithFilteringIT`
- [ ] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)


## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-08-27 16:06:02 +02:00
Julien Dubois 90a28279ec
Bumps com.azure:azure-storage-blob from 12.27.0 to 12.27.1 (#1639)
Co-authored-by: LangChain4j <langchain4j@gmail.com>
2024-08-26 17:02:32 +02:00
Julien Dubois 28ccac4f3c
Bumps com.azure:azure-search-documents from 11.7.0 to 11.7.1 (#1638) 2024-08-26 17:01:36 +02:00
Julien Dubois d0b10a0ba0
Bump com.azure:azure-storage-common from 12.26.0 to 12.26.1 (#1637) 2024-08-26 17:01:09 +02:00
LangChain4j 1872919fc0
OpenAI: return token usage returned by OpenAI (#1622)
## Issue
Closes #1621

## Change
- set `stream_options.include_usage=true` in the request of streaming
chat model
- record and return token usage returned by OpenAI

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-08-26 15:56:33 +02:00
LangChain4j 7fd1656e2e fixing compliance checks 2024-08-22 16:31:31 +02:00
Julien Dubois fb4840d98c
Bump com.azure:azure-identity from 1.13.1 to 1.13.2 (#1609) 2024-08-21 11:45:38 +02:00
David Pilato 8f6a140260
Elasticsearch: Add approximative kNN search in addition to Cosine similarity (#712)
The current implementation uses a slow function score query which is
known to be slow because you have to iterate over all the hits to
compute the score.

Elasticsearch in the recent versions, now also allow using knn search.

This PR now allows to change the configuration:

```java
// Use the Knn implementation
ElasticsearchEmbeddingStore store = ElasticsearchEmbeddingStore.builder()
  .configuration(ElasticsearchConfigurationKnn.builder().build())
  .restClient(restClient)
  .build();

// Note that this configuration is optional as it's the default behavior. So this code is equivalent:
ElasticsearchEmbeddingStore store = ElasticsearchEmbeddingStore.builder()
  .restClient(restClient)
  .build();

// Use the Scripting implementation (slower)
ElasticsearchEmbeddingStore store = ElasticsearchEmbeddingStore.builder()
  .configuration(ElasticsearchConfigurationScript.builder().build())
  .restClient(restClient)
  .build();
```

In more details, this is what this PR is bringing:

* Add a `configuration` new option in the builder. This helps to choose
the implementation to use. It could be
`ElasticsearchConfigurationScript` (the behavior before this change) or
`ElasticsearchConfigurationKnn` for the new Knn implementation
* The Knn implementation (`ElasticsearchConfigurationKnn`) is now the
default implementation
* Removes the `dimension` parameter as Elasticsearch can guess
automatically this value based on the first document indexed. And
anyway, it's better to let the user create an index template or the
index mapping he wants.
* Modify the IT. In which case if a local instance of Elasticsearch is
yet running on https://localhost:9200, we will use it by default and
start Testcontainers only if needed.
* Make Elasticsearch container secured (which is closer to production
use case)
* We now use the `elastic.version` `pom.xml` property to launch the
right Elasticsearch TestContainer.
* Replaced the `removeAll()` implementation from a `DeleteByQuery(match
all query)` to a Delete index API call which is always the recommended
way to remove all documents. Note that this does not recreate an index.
* `ElasticsearchEmbeddingStoreRemoveIT` now extends the common removal
test class `EmbeddingStoreWithRemovalIT`. But we need to implement in
the future a `EmbeddingStoreWithRemovalIT.wait_for_ready()` method to
allow even more common tests.
* Add more logs in implementation and tests
2024-08-20 11:05:42 +02:00
Yellow-- cdaccd3547
support run integration tests for changed and dependent modules (#1185)
## Issue
Closes #1000


## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [X] 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](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
2024-08-16 13:52:42 +02:00
LangChain4j c5c146f9a0
OpenAI: Structured Outputs (#1590)
## Issue
Closes #1581

## Change
- OpenAI: added support for [Structured
Outputs](https://openai.com/index/introducing-structured-outputs-in-the-api/):
  - for tools
  - for json mode
- Introduced new (still experimental) `ChatLanguageModel` API (which
supports specifying json schema)

### OpenAI Structured Outputs for tools
To enable Structured Outputs feature for tools, set `.strictTools(true)`
when buidling the model:
```java
OpenAiChatModel.builder()
    ...
    .strictTools(true)
    .build(),
```
Please note that this will automatically make all tool parameters
mandatory (`required` in json schema)
and set `additionalProperties=false` for each `object` in json schema.
This is due to the current OpenAI limitations.

### OpenAI Structured Outputs for json mode
To enable Structured Outputs feature for json mode, set
`.responseFormat("json_schema")` and `.strictJsonSchema(true)` when
buidling the model:
```java
OpenAiChatModel.builder()
    ...
    .responseFormat("json_schema")
    .strictJsonSchema(true)
    .build(),
```
In this case `AiServices` will not append "You must answer strictly in
the following JSON format: ..." string to the end of the last
`UserMessage`, but will create a Json schema from the given POJO and
pass it to the LLM.
Please note that this works only when method return type is a POJO. If
the return type is something else, (like an enum or a `List<String>`),
the old behaviour is applied (with "You must answer strictly ..."). All
return types will be supported in the near future.

Please note that this feature is available now only for `gpt-4o-mini`
and `gpt-4o-2024-08-06` models.

### Experimental `ChatLanguageModel` API
This was drafted in
https://github.com/langchain4j/langchain4j/pull/1261, but now it has to
be rushed a bit in order to enable new Structured Outputs feature for
OpenAI.
A new method `ChatResponse chat(ChatRequest request)` was added into
`ChatLanguageModel` which allows to specify messages, tools and response
format (with json schema). In the future it will also support specifying
model parameters like temperature.

## Upcoming Changes
- Adopt new `ChatLanguageModel` API for Gemini
- Adopt new `ChatLanguageModel` API for Azure OpenAI (once available)
- Support Structured Outputs with all other method return types like
`List<Pojo>`
- Adopt new `JsonSchema` type for tools (instead of `ToolParameters`)

Reated changes in openai4j:
https://github.com/ai-for-java/openai4j/pull/33

## General checklist
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-08-14 15:25:25 +02:00
Julien Dubois 5f06c78092
Bump com.azure:azure-search-documents from 11.6.6 to 11.7.0 (#1533) 2024-08-05 18:04:35 +02:00
Julien Dubois b34630f13a
Bump com.azure:azure-storage-blob from 12.26.1 to 12.27.0 (#1534) 2024-08-05 18:02:18 +02:00
Julien Dubois 0611e8ab2e
Bump com.azure:azure-storage-common from 12.25.1 to 12.26.0 (#1535) 2024-08-05 18:00:55 +02:00
LangChain4j 1cccfdfa65 changed version to 0.34.0-SNAPSHOT 2024-07-26 15:12:26 +02:00
LangChain4j 822f09cb1c
Release 0.33.0 (#1514) 2024-07-25 10:12:20 +02:00
ZYinNJU e848e6a882
[Feature] Pinecone: support storing metadata and embedding removal (#1400)
## Issue
Closes #1169
Fixes #1418

## Change
1. Refactor `PineconeEmbeddingStore`, update `pinecone-client` version
to latest.
2. Support storing metadata
3. Support embedding removal method (not include `removeAll(Filter filter)` because I
don't find a way to convert `Filter` to
`com.google.protobuf.StructStruct` :(, but I will try my best to work on
it, and will create a new PR if I complete it.)

## General checklist
- [ ] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [x] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)

## Checklist for changing existing embedding store integration
- [x] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-07-23 14:37:42 +02:00
David 94d751e6aa
Bump com.knuddels:jtokkit from 1.0.0 to 1.1.0 (#1499)
Adds o200k_base encoding used by GPT4o and GPT4o-mini
2024-07-22 14:17:00 +02:00
Eddú Meléndez Gonzales d1beab5fba
Update testcontainers version to 1.20.0 (#1488)
It contains an enhancement for Weaviate module.
2024-07-19 10:02:54 +02:00
Julien Dubois d43a91f06e
Bump com.azure:azure-identity from 1.13.0 to 1.13.1 (#1478) 2024-07-17 13:36:32 +02:00
Shawn Pang c8fe669931
Fix ollama client missing path issue (#1456)
## Issue
Closes #1455

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
- [ ] I have added/updated [Spring Boot
starter(s)](https://github.com/langchain4j/langchain4j-spring) (if
applicable)
2024-07-16 11:11:31 +02:00
LangChain4j fe50c88e77 changed version to 0.33.0-SNAPSHOT 2024-07-08 14:47:07 +02:00
LangChain4j c2366a226c
Release 0.32.0 (#1409) 2024-07-04 12:04:29 +02:00
Julien Dubois b0fa2484ce
Bump com.azure:azure-ai-openai from 1.0.0-beta.8 to 1.0.0-beta.10 (#1401)
- Bump com.azure:azure-ai-openai from 1.0.0-beta.8 to 1.0.0-beta.10
- Migrate to Sweden Central
- Fix several tests using the same as
https://github.com/langchain4j/langchain4j/pull/1022
2024-07-03 16:32:47 +02:00
Julien Dubois 25440a2b45
Bump com.azure:azure-search-documents from 11.6.5 to 11.6.6 (#1387) 2024-07-02 12:50:21 +02:00
Julien Dubois f6fa4e3432
Bump com.azure:azure-identity from 1.12.2 to 1.13.0 (#1345) 2024-06-21 16:26:16 +02:00
Julien Dubois 7c195df2b8
Bump com.azure:azure-identity from 1.12.1 to 1.12.2 (#1273) 2024-06-13 09:19:19 +02:00
Julien Dubois 34a40fdcab
Bump com.azure:azure-storage-blob from 12.26.0 to 12.26.1 (#1257) 2024-06-10 14:37:56 +02:00
Julien Dubois db246f15db
Bump com.azure:azure-storage-common from 12.25.0 to 12.25.1 (#1256) 2024-06-10 14:36:45 +02:00
二毛 56c1615703
Implement embedding removal methods for Milvus embedding store (#1172)
## Issue
<!-- Please paste the link to the issue this PR is addressing. For
example: https://github.com/langchain4j/langchain4j/issues/1012 -->
#1168 

## Change
<!-- Please describe the changes you made. -->
Add the `MilvusEmbeddingStore` method to implement `remove(String id)`,
`removeAll(Collection<String> ids)`, `removeAll(Filter filter)`,
`removeAll()`.
Add unit test `MilvusEmbeddingStoreRemoveIT`

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [x] There are no breaking changes
- [x] I have added unit and integration tests for my change
- [x] 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](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)

## Checklist for changing existing embedding store integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [ ] I have manually verified that the
`{NameOfIntegration}EmbeddingStore` works correctly with the data
persisted using the latest released version of LangChain4j
2024-06-06 15:47:09 +02:00
Julien Dubois 34330f9a0f
Bump com.azure:azure-search-documents from 11.6.4 to 11.6.5 (#1195) 2024-05-29 13:01:19 +02:00
LangChain4j a1b733d96d bumped version to 0.32.0-SNAPSHOT 2024-05-24 16:25:13 +02:00
LangChain4j d9cb1e9b81
Release 0.31.0 (#1151) 2024-05-23 17:40:52 +02:00
LangChain4j 504aa173df
Experimental: RAG: SQL database content retriever (#1056)
## Issue
https://github.com/langchain4j/langchain4j/issues/232

## Change
An experimental `SqlDatabaseContentRetriever` has been added.

Simplest usage example:
```java
ContentRetriever contentRetriever = SqlDatabaseContentRetriever.builder()
    .dataSource(dataSource)
    .chatLanguageModel(openAiChatModel)
    .build();
```
In this case SQL dialect and table structure will be determined from the
`DataSource`.

But it can be customized:
```java
ContentRetriever contentRetriever = SqlDatabaseContentRetriever.builder()
    .dataSource(dataSource)
    .sqlDialect("PostgreSQL")
    .databaseStructure(...)
    .promptTemplate(...)
    .chatLanguageModel(openAiChatModel)
    .maxRetries(2)
    .build();
```

See `SqlDatabaseContentRetrieverIT` for a full example.

## General checklist
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] There are no breaking changes
- [X] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
<!-- Before adding documentation and example(s) (below), please wait
until the PR is reviewed and approved. -->
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)


## Checklist for adding new model integration
<!-- Please double-check the following points and mark them like this:
[X] -->
- [X] I have added my new module in the
[BOM](https://github.com/langchain4j/langchain4j/blob/main/langchain4j-bom/pom.xml)
2024-05-21 16:49:02 +02:00
Julien Dubois 0c5a801d45
Upgrade com.azure:azure-storage-blob from 12.25.4 to 12.26.0 (#1131)
Co-authored-by: LangChain4j <langchain4j@gmail.com>
2024-05-21 10:46:55 +02:00
Julien Dubois d1285a08ef
Upgrade com.azure:azure-storage-common from 12.24.4 to 12.25.0. (#1130) 2024-05-21 10:45:53 +02:00
Julien Dubois a5b168f061
Azure OpenAI: migrate to the new API, from "function" to "tools" (#529)
As discussed in #521 there's a new API to call functions, which is
documented at https://platform.openai.com/docs/api-reference/chat/create

Fix #521
2024-05-17 07:24:23 +02:00
Julien Dubois 96bf0c215b
Bump com.azure:azure-identity from 1.12.0 to 1.12.1. (#1082) 2024-05-10 13:16:16 +02:00
LangChain4j 82def930e6
Migrate Anthropic from Gson to Jackson (#1043)
## Issue
https://github.com/langchain4j/langchain4j/issues/1042

## Change
This is a first step for migrating LC4j from Gson to Jackson.
This PR migrates Anthropic module only.

Internal classes (which have to be public because Quarkus extension
depends on them) are moved into `internal` packages.

## General checklist
- [ ] There are no breaking changes
- [ ] I have added unit and integration tests for my change
- [X] I have manually run all the unit and integration tests in the
module I have added/changed, and they are all green
- [X] I have manually run all the unit and integration tests in the
[core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core)
and
[main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j)
modules, and they are all green
- [ ] I have added/updated the
[documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs)
- [ ] I have added an example in the [examples
repo](https://github.com/langchain4j/langchain4j-examples) (only for
"big" features)
2024-05-06 16:04:57 +02:00