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

feat: add OllamaChatModel and its corresponding integration test #323

Merged
merged 14 commits into from Dec 18, 2023

Conversation

fintanmm
Copy link
Contributor

A new implementation of ChatLanguageModel, OllamaChatModel, is added to handle interactions with the Ollama AI and has an associated integration test. This includes necessary configurations and methods for message generation. This increases the project's modularity and provides a more convenient and encapsulated way of interfacing with the Ollama AI.

A new implementation of ChatLanguageModel, OllamaChatModel, is added to handle interactions with the
Ollama AI and has an associated integration test. This includes necessary configurations and methods
for message generation. This increases the project's modularity and provides a more convenient and
encapsulated way of interfacing with the Ollama AI.
Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fintanmm thanks a lot!

Added a validation to ensure that modelName in OllamaLanguageModel, OllamaChatModel, and OllamaEmbeddingModel classes is not blank. This change will prevent situations where a model is created with an empty or null modelName, which would likely cause errors during execution. Validation is done using the ensureNotBlank utility method from ValidationUtils.
…hich can be used to guide the AI's responses.
…ge class represents a chat message. The ChatRequest class represents a request to the Ollama. The ChatResponse class represents a response from the Ollama. The Role enum represents the role of a chat message sender. It also provides a method to convert from ChatMessageType to Role.
Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fintanmm great job, thank you! There are just a few things that should be addressed and we can merge.

@langchain4j langchain4j marked this pull request as ready for review December 18, 2023 17:01
Copy link
Owner

@langchain4j langchain4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fintanmm awesome, thank you!

@langchain4j langchain4j merged commit 38049a1 into langchain4j:main Dec 18, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants