-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add Spring Boot Project Starter for Google Gemini API model - ChatLangauge, Streaming model and Embedding Model #74
Open
Suhas-Koheda
wants to merge
48
commits into
langchain4j:main
Choose a base branch
from
Suhas-Koheda:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
89fa967
Base Commit for Google Gemini AI Model
Suhas-Koheda cb8544f
Added Configuration files for Google Gemini AI - ChatModel
Suhas-Koheda 3a8765c
Added Configuration files for Google Gemini AI - ChatModel
Suhas-Koheda 0dfbc0d
Check
Suhas-Koheda 8335e67
Adding Streaming Google AI Chat Model and Removing Lombok uses
Suhas-Koheda 84bc5e3
Adding application.properties.local for easy usage
Suhas-Koheda 6d7c4cf
Ignore all the .idea folders in subfolders
Suhas-Koheda 300cfa2
Ignore all the .idea folders in subfolders
Suhas-Koheda 9618410
Ignore all the .idea folders in subfolders
Suhas-Koheda 7ee36c6
Changing pom.xml headers
Suhas-Koheda f696e82
Resolving API_KEY to apikey
Suhas-Koheda 4b8f2ec
Resolving API_KEY to apikey
Suhas-Koheda 9453ced
Resolving API_KEY to apikey
Suhas-Koheda 4f267ff
Change Response Format to User Defined Props
Suhas-Koheda affefe3
Change Response Format to User Defined Props
Suhas-Koheda 76053d9
Write test to check working of ChatLangaugeModel and StreamingCHatLan…
Suhas-Koheda 6ee971e
Complete Test for Chat Language Model
Suhas-Koheda 637cd0e
Complete Test for Chat Language Model
Suhas-Koheda 3e5fca5
Implement test for Streaming Chat Language Model
Suhas-Koheda cfc5cae
Delete langchain4j-google-ai-gemini-spring-boot-starter/src/main/reso…
Suhas-Koheda 66c828e
Changing Java Version in pom.xml from 21 to 17 to support maven (mvn)…
Suhas-Koheda 11d7989
Merge remote-tracking branch 'refs/remotes/origin/main'
Suhas-Koheda ec1275b
Changing Java version back to 21 :) in pom.xml
Suhas-Koheda 0fd6868
Resolving other issues except Embedding model
Suhas-Koheda 070a71e
Adding env variable to main.yaml and release.yaml
Suhas-Koheda 7aa79cb
Merge branch 'langchain4j:main' into main
Suhas-Koheda 889aa2f
Update release.yaml to add Google AI Gemini API Key
Suhas-Koheda db889db
Update main.yaml to add Google AI Gemini API Key
Suhas-Koheda b626e12
Merge branch 'main' of https://github.com/Suhas-Koheda/langchain4j-sp…
Suhas-Koheda 4ae025a
Changing the version of dependencies to project version
Suhas-Koheda 9aad39f
adding GeminiSafetyProperties and GeminiSafetySettings to googleGemin…
Suhas-Koheda 3c32174
Add tests for chatlanguagemodel with updated properties
Suhas-Koheda c4ba686
Adding Embedding model configuration and test for Embedding model
Suhas-Koheda ef71908
Merge branch 'langchain4j:main' into main
Suhas-Koheda b0a8f9a
Resolving issues in spring boot starter for google ai gemini
Suhas-Koheda 89694f5
Update main.yaml for google ai gemini key
Suhas-Koheda 907424b
Update release.yaml for google ai gemini key
Suhas-Koheda 6159165
refactoring resources
Suhas-Koheda 4a27ef1
Merge remote-tracking branch 'refs/remotes/origin/main'
Suhas-Koheda 7554b25
Changing the safteySetting and toolConfig and writing test
Suhas-Koheda 4afe606
Merge branch 'langchain4j:main' into main
Suhas-Koheda 69660a4
Resolving silly mistake
Suhas-Koheda 3107cb9
Resolving issues
Suhas-Koheda 56d7546
Changing bean properties
Suhas-Koheda ed5afe0
cosmetics
langchain4j 9b52b6e
Merge branch 'langchain4j:main' into main
Suhas-Koheda 9c167d1
Adding NPE check for Safety Setting and Tool Config
Suhas-Koheda 816652c
Changing safetySettings to map of harm category and harm threshold
Suhas-Koheda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these settings supposed to have only a single key-value pair?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safety settings builder takes the map of geminiharmcategory as key and geminiharmblockthreshold as value
No it can take any number of values
It changes them into list
But for a single model thre would be only one harmcategory and blockthreshold right?
If that's not the case we can write such that the harmcategory and blockthreshold takes comma separated values and we manually convert then into map in the autoconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@langchain4j
this can be done if there are multiple GeminiHarmCategory and GeminiHarmBlockThreshold
and the test cases run properly too
the code is ready to be commited
thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ddobrin, could you please help with the review?
It seems to me that current logic in
checkSafetySettingForNull
is not correct. If settings are not specified,defaultMap.put(HARM_CATEGORY_CIVIC_INTEGRITY,HARM_BLOCK_THRESHOLD_UNSPECIFIED);
is set (is it correct?). Also,chatModelProperties
can have only a single setting...@Suhas-Koheda I guess
ChatModelProperties
should have aMap<GeminiHarmCategory, GeminiHarmBlockThreshold> safetySettings
instead ofGeminiSafetySetting safetySetting
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or
List<GeminiSafetySetting> safetySettings
, the same way as it is in theBaseGeminiChatModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this can be done so that while setting in the properties file it will be in a more understanable way
yeah ill change it!