-
Notifications
You must be signed in to change notification settings - Fork 21
Devcrocod/langchain4j #476
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
Conversation
langchain4j.json
Outdated
], | ||
"link": "https://github.com/langchain4j/langchain4j", | ||
"init": [ | ||
"when (\"$model\") {\n\"bedrock\" -> USE { dependencies(\"dev.langchain4j:langchain4j-bedrock:$v\") }\n\"anthropic\" -> USE { dependencies(\"dev.langchain4j:langchain4j-anthropic:$v\") }\n\"azure\" -> USE { dependencies(\"dev.langchain4j:langchain4j-azure-open-ai:$v\") }\n\"googleai\" -> USE { dependencies(\"dev.langchain4j:langchain4j-google-ai-gemini:$v\") }\n\"vertexai\" -> USE { dependencies(\"dev.langchain4j:langchain4j-vertex-ai-gemini:$v\") }\n\"huggingface\" -> USE { dependencies(\"dev.langchain4j:langchain4j-hugging-face:$v\") }\n\"ollama\" -> USE { dependencies(\"dev.langchain4j:langchain4j-ollama:$v\") }\n\"openai\" -> USE { dependencies(\"dev.langchain4j:langchain4j-open-ai:$v\") }\n\"openaiofficial\" -> USE { dependencies(\"dev.langchain4j:langchain4j-open-ai-official:$v\") }\nelse -> error(\"Not recognized dependency '$model'. Use follow models: `bedrock`, `anthropic`, `azure`, `googleai`, `vertexai`, `huggingface`, `ollama`, `openai`, `openaiofficial`\")\n}\nUSE { import(\"dev.langchain4j.model.$model.*\") }" |
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.
Probably define a map?
val modelToArtifact = mapOf ("bedrock" to "bedrock", "openaiofficial" to "open-ai-official", ...)
In this case there'll be just one USE call.
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.
But even better to maintain these models in a separate integration library
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.
Do you mean creating a separate descriptor for each artifact?
I’d prefer not to do that, as it would significantly increase the number of descriptors
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.
No, I mean putting this logic into an artifact (a single one). It could be placed in our internal maven repo. In this case you may add tests for the integration, add additional features easily and so on, so it's a more reliable approach. Descriptor then will stay the same but without this init code.
Integration classes accept options:
https://github.com/Kotlin/dataframe/blob/79900825169933d8b644c709a3d6601a29bf9fa6/dataframe-jupyter/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt#L64
So you may access model name from there.
Lets-plot integration underwent the same transformation
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.
Alright, I understand.
Nevertheless, I’m not going to do it))
Unfortunately, at the moment I can’t guarantee long-term support for langchain4j, so I don’t think it’s worth creating a new entity, even if it simplifies integration with jupyter. However, if a stable version is released and Kotlin support becomes reliable, then we can easily add such an artifact — and the descriptor for users will remain the same
Description
add langchain4j descriptor
parameter
model
defines a specific dependency:Type of change
Checklist for new descriptors (remove if not applicable):
description
field accurately describes the library and that thelink
points to the current repository.properties
field contains all versions of Maven dependecies used in thedependencies
section.dependencies
section use version variables correctly.renderers
section has appropriate rendering rules.