Skip to content
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

Migrate ollama to jackson #1072

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Martin7-1
Copy link
Contributor

Issue

#1042

Change

Migrate Ollama module from Gson to Jackson. But we still need to migrate langchain4j-core and openai4j too.

image

Note that there are three things confused me(these issues exist in original ollama module):

  1. I observe that some tests with inputTokenCount Assertion (such as assertThat(tokenUsage.inputTokenCount()).isEqualTo(35)) failed because of the differencet count of input tokens. I don't know whether it's because Ollama's update. Now I correct it
  2. should_propagate_failure_to_handler_onError in Streaming{xxx}ModelIT failed in my local because NullPointerException do not have any message. Is it a problem in my local environment?
  3. Somtimes if I run tests individually, all tests will pass. But if I run them in the same time(such as using command line rather than IDE), they will failed due to some strange reasons(e.g. input token usage will be null). I think Maybe it's a network problem or Testcontainers's problem.

I'm not sure if these problems are due to my local environment, so if you have any suggestions or solutions, please let me know!

General checklist

  • There are no breaking changes
  • 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 and main modules, and they are all green

Checklist for adding new model integration

  • I have added my new module in the BOM

Checklist for adding new embedding store integration

  • I have added a {NameOfIntegration}EmbeddingStoreIT that extends from either EmbeddingStoreIT or EmbeddingStoreWithFilteringIT
  • I have added my new module in the BOM

Checklist for changing existing embedding store integration

  • I have manually verified that the {NameOfIntegration}EmbeddingStore works correctly with the data persisted using the latest released version of LangChain4j

@langchain4j
Copy link
Owner

Hi @Martin7-1 thanks a lot! I will try to review it asap!

@langchain4j langchain4j added the P2 High priority label May 10, 2024
@langchain4j
Copy link
Owner

Hi, thanks a lot!
This PR should wait till we release the first migration from Gson to Jackson (Anthropic module) and see that it actually works.
We can then proceed with this PR and migrating other modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 High priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants