Commit Graph

276 Commits

Author SHA1 Message Date
Julien Dubois 3c0943d38b
Support Java 21 (#336)
This PR is to fix #335
2023-12-12 19:16:41 +01:00
LangChain4j 8e4254fc20
make OpenAI tokenizer more precise (#346)
This PR is a rework of `OpenAiTokenizer`.
Added `OpenAiTokenizerIT` with lots of tests to ensure that
`OpenAiTokenizer` calculates token usage very close to OpenAI.
In most cases calculation is 1:1, in some corner cases the difference is
within 5%.
2023-12-12 16:45:16 +01:00
deep-learning-dynamo 054a36f59f minor fixes 2023-12-11 11:16:46 +01:00
Scott d08d58c35a
spring-boot-starter add azure openai support (#339)
Add azure support for spring-boot-starter
2023-12-11 11:13:27 +01:00
LangChain4j 303b2ab7b5
OpenAI: Support parallel tool calling (#338)
This PR introduces a support for [parallel tool
calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling)
in OpenAI integration.
2023-12-08 17:29:56 +01:00
Julien Dubois 09ab6a1dda
Migration of the AzureOpenAiChatModel to use the Azure OpenAI SDK (#328)
This PR fixes https://github.com/langchain4j/langchain4j/issues/325

- [x] Migrate AzureOpenAiChatModel
- [x] Migrate AzureOpenAiEmbeddingModel
- [x] Migrate AzureOpenAiLanguageModel
- [x] Migrate AzureOpenAiStreamingChatModel
- [x] Migrate AzureOpenAiStreamingLanguageModel
- [x] Add a full suite of tests
2023-12-08 10:51:26 +01:00
deep-learning-dynamo 0d2f743ebc Weaviate: reformat 2023-12-08 10:44:50 +01:00
deep-learning-dynamo b587845b59 Weaviate: added back IT using cloud instance 2023-12-08 10:44:34 +01:00
deep-learning-dynamo c8b3e9b48a LocalAI: added doc links 2023-12-08 10:34:33 +01:00
Eddú Meléndez Gonzales a886eee15a
Use Testcontainers for Weaviate IT (#332)
Run `semitechnologies/weaviate` image using `GenericContainer` and
allow rapid feeback when using Weaviate. Relax `apiKey` constraint
to allow empty value for testing purposes.
2023-12-08 10:33:56 +01:00
shalk(xiao kun) b2f358c926
enable langchain4j-graal build in workflow (#333) 2023-12-08 10:30:36 +01:00
Eddú Meléndez Gonzales b92c4cf138
Use Testcontainers to run LocalAI (#331)
Currently, IT in LocalAI module depends on a instance running.
This commit introduces the use of Testcontainers using
`GenericContainer`.

Also, due to the size of the image and the models. The image is
cached after the first run, improving next executions.
2023-12-08 09:22:18 +01:00
jiangsier-xyz c89da68d4c
Enhanced QWen Model Features and Tokenizer Implementation (#317)
1. Added support for new QWen model features: repetitionPenalty,
temperature, stops, and incrementalOutput.
2. Implemented a new QwenTokenizer class.
3. Refactored code to utilize Lombok builder instead of manual builder
implementation.
2023-12-05 10:52:05 +01:00
Eddú Meléndez Gonzales 00db7557ce
Use Testcontainers in Ollama IT (#315)
Currently, integration tests in Ollama module are disabled because
it needs a Ollama instance running in order to execute them.
Testcontainers provides this infrastructure not only by running
the ollama container but also by automating the pull model step.

This commit, use the Singleton Container approach to reuse the single
instance across multiple IT. Also, pull step is only executed when the
image is `ollama/ollama`.

The behavior on this is:
1st execution:
1. Pull `ollama/ollama` image
2. Start the container based on `ollama/ollama` image
3. Download the `orca-mini` model
4. Create an image based on the current state (with the model in it)
5. Declare the container ready to use
6. Run test

Next executions:
1. Look for the local image created in the 1st execution
2. Start the container based on the local image
3. Declare the container ready to use
4. Run test

1st execution is expected to take longer because of the model (3GB).
Next execution are way more faster.
2023-12-05 10:31:02 +01:00
Eddú Meléndez Gonzales 3168433cb1
Enable Milvus IT by using Testcontainers (#314)
Currently, Milvus IT is disables because it requires a manual step
to run the compose file. Adding Testcontainers, the infrastructure
is in place to run the tests.
2023-12-04 17:54:54 +01:00
Eddú Meléndez Gonzales 2c835a5d2e
Use Testcontainers in Chroma IT (#313)
Use `GenericContainer` to run `ghcr.io/chroma-core/chroma` along with
tests. No manual steps are required to execute them.
2023-12-04 17:50:34 +01:00
Eddú Meléndez Gonzales ea857e6043
Use ElasticsearchContainer in Elasticsearch IT (#312)
Current test execution depends on a running elasticserach instance,
which depends on a manual execution of docker command. This commit
introduces testcontainers as in other modules to run such instance
along with tests, improving DevEx.
2023-12-04 17:46:59 +01:00
deep-learning-dynamo c694d2836c Use Testcontainers annotation (#310) 2023-12-04 17:40:35 +01:00
Eddú Meléndez Gonzales 3676b6d752
Use Testcontainers annotation (#310)
`@Container` is used along with `@Testcontainers` for initialization.
The current test has `PostgreSQLContainer` annotated with `@Container`
and it is manually initialized.
2023-12-04 17:39:17 +01:00
deep-learning-dynamo c3893897cf Fix PG Vector Index creation statement incorrect (#302) 2023-12-04 16:16:18 +01:00
Pascal Vantrepote 1a9f45ddb1
Fix PG Vector Index creation statement incorrect (#302)
Statement has been corrected:

```
                final String indexName = table + "_ivfflat_index";
                connection.createStatement().executeUpdate(String.format(
                        "CREATE INDEX IF NOT EXISTS %s ON %s " +
                                "USING ivfflat (embedding vector_cosine_ops) " +
                                "WITH (lists = %s)",
                        indexName, table, ensureGreaterThanZero(indexListSize, "indexListSize")));
```
2023-12-04 16:13:49 +01:00
Georgios Andrianakis e7bb4bcc15
Add note about Quarkus specific examples (#329) 2023-12-04 15:13:18 +01:00
Svante Kumlien d9fdf179f1
#299 Add null check for ToolsParameters in tokenCountEstimation (#303)
Add null check when estimating the number of tokens in the
ToolParameters.
The parameters are always null for a Tool with no parameters.
2023-11-25 11:09:48 +01:00
sboeckelmann 11e7364686
pass OpenSearchClient directly to OpenSearchEmbeddingStore (#309)
see https://github.com/langchain4j/langchain4j/issues/308
2023-11-25 11:04:29 +01:00
deep-learning-dynamo f98c04028a cleanup 2023-11-24 13:09:51 +01:00
deep-learning-dynamo c671ebebdb Token usage calculation bug (#280): slight refactoring + added a test 2023-11-24 13:01:07 +01:00
jiangsier-xyz 7cfa1a5dfc
Fix a token usage statistical issue in DefaultAiServices (#280)
The statistical logic on token usage is consistent with AiServiceStreamingResponseHandler.

And more:
When it comes to rolling messages in
MessageWindowChatMemory/TokenWindowChatMemory, LinkedList offers
superior performance. ArrayList moves all the elements when the first
element is deleted.
2023-11-24 12:48:45 +01:00
deep-learning-dynamo 06ada5310d disabled jdk17 build temporarily 2023-11-24 12:25:05 +01:00
LangChain4j ba7fabaa50
graal: cleanup (#297) 2023-11-19 12:59:24 +01:00
janglada 949bc25f63
Graal Integration for Local JS and Python Execution (#263)
This PR introduces GraalVM integration to enable local execution of
JavaScript and Python scripts by Langchain4j agents.
Major updates include:

-  New langchain4j-graal module for encapsulating integration logic.
-  Necessary infrastructure for invoking GraalVM and executing scripts.
-  Unit tests to validate the integration.
2023-11-19 09:19:48 +01:00
deep-learning-dynamo 903b3fb1ac reducing duplication of *EmbeddingStoreIT 2023-11-18 21:28:32 +01:00
deep-learning-dynamo bd802c352d reducing duplication of *EmbeddingStoreIT 2023-11-18 21:12:34 +01:00
deep-learning-dynamo 6aed16ab81 reducing duplication of *EmbeddingStoreIT 2023-11-18 20:17:59 +01:00
deep-learning-dynamo 09022d4a32 reducing duplication of *EmbeddingStoreIT 2023-11-18 20:15:46 +01:00
deep-learning-dynamo e0dc387cef reducing duplication of *EmbeddingStoreIT 2023-11-18 20:09:45 +01:00
deep-learning-dynamo 7c5cade3c0 reducing duplication of *EmbeddingStoreIT 2023-11-18 20:02:21 +01:00
deep-learning-dynamo e467beb64a reducing duplication of *EmbeddingStoreIT 2023-11-18 19:20:26 +01:00
deep-learning-dynamo 00c6068de3 reducing duplication of *EmbeddingStoreIT 2023-11-18 18:29:44 +01:00
deep-learning-dynamo 16f60dbef9 reducing duplication of *EmbeddingStoreIT 2023-11-18 16:23:29 +01:00
deep-learning-dynamo 9897d65a54 cleanup 2023-11-18 16:23:26 +01:00
LangChain4j ff998ac82d
build most modules with jdk 8 (#295)
Since we target java 8, CI build was updated to run most modules using
java 8, then modules requiring java 11 separately with java 11
2023-11-18 15:07:11 +01:00
deep-learning-dynamo 61e6a4bef0 added another variation of apache 2 license naming 2023-11-18 11:44:38 +01:00
aphethean1 09629a4111
Feature/elastic search restclient constructor (#291)
This PR addresses issue
https://github.com/langchain4j/langchain4j/issues/290
2023-11-18 11:24:12 +01:00
Eddú Meléndez Gonzales 111c213c06
Cleanup Testcontainers deps (#292)
* Update testcontainers version to 1.19.2
* Remove duplicated entries in dependencyManagement section
* Import testcontainers-bom
2023-11-18 10:20:16 +01:00
Aashish 2fb4d33530
Update README.md (#281)
Modified readme to make commiters name a clickable link
2023-11-15 00:01:10 +01:00
LangChain4j 968588f574
released 0.24.0 2023-11-12 19:11:30 +01:00
deep-learning-dynamo 21dfc8b317 released 0.24.0 2023-11-12 18:58:31 +01:00
deep-learning-dynamo 5e1bc74901 benedictstrube: Adding Memory Id to Tool Method Call 2023-11-12 10:07:10 +01:00
ZYinNJU 864eeeeb05
add bedrock bom (#278)
Hi! It seems like new `langchain4j-bedrock` module is not included in
`langchain4j-bom`, so I add it.
2023-11-12 08:59:12 +01:00
Jansen Ang 8398ccb8a6
fix: add properties for s3 loader integration tests to fix failing tests when credentials are absent (#275) 2023-11-10 17:52:27 +01:00