Last year, நான் சிறிது கழித்து தொடங்கினேன்சுற்றிகாங்கிரஸ்4Jஇது ஒரு வேகமாக வளர்ந்த திட்டம், மற்றும் நான் பதிவிறக்கங்களை தெரிந்து கொள்ள விரும்பினேன். I also wanted to check how to integrate a Model Context Protocol server in LangChain4J.
பதிப்பு 1 Beta
நான் 2024 இல் என் இறுதி பதிவை எழுதி, அப்போது கிடைத்த புதிய பதிவைப் பயன்படுத்தினேன், v0.35. LangChain4J கடந்த டிசம்பர் மாதம் 1.0 க்கு தனது பயணத்தை தொடங்கினார்.
Date |
Release |
---|---|
September 25th, 2024 |
0.35.0 |
December 22th, 2024 |
1.0.0-alpha1 |
February 10th, 2025 |
1.0.0-beta1 |
March 13th, 2025 |
1.0.0-beta2 |
April 12th, 2025 |
1.0.0-beta3 |
ஜூலை 25, 2024
0 0 35
டிசம்பர் 22, 2024
1.0.1 அலெக்ஸி
பிப்ரவரி 10, 2025
பதிவிறக்கம் 1.0 Beta1
மார்ச் 13, 2025
பதிவிறக்கம் 1.0-Beta2
ஜூலை 12, 2025
பதிவிறக்கம் 1.0-Beta3
LangChain4J பின்வருமாறுசமாதானம்இந்த மாதிரி think different type விளம்பரங்கள் தான் add industriesla இப்போ Hot...
v0.35 |
v1.0.0-beta3 |
---|---|
val s = Sinks.many() |
val s = Sinks.many() |
பல்வேறு வகைகள் (
ஒலிப்பதிவுகள் (
இடைவெளி <String>()
ChatBot.talk(m.sessionId, m.text) இல் தொடர்பு கொள்ளவும்
பின்னூட்டம் (s::tryEmitNext)
மின்சாரம் : மின்சாரம் : மின்சாரம்
முழுமையாக
சரவணன் சரவணன்
முதலீடு (
இன்டர்நெட் டீசர் (
இன்டர்நெட் ( .asFlow()
)
பல்வேறு வகைகள் (
ஒலிப்பதிவுகள் (
இடைவெளி <String>()
ChatBot.talk(m.sessionId, m.text) இல் தொடர்பு கொள்ளவும்
இன்டர்நெட் (s::tryEmitNext)
மின்சாரம் : மின்சாரம் : மின்சாரம்
முழுமையாக பதிலளிக்க
சரவணன் சரவணன்
முதலீடு (
இன்டர்நெட் டீசர் (
இன்டர்நெட் ( .asFlow()
)
Reactor Integration திட்டம்
LangChain4J ஒரு Project Reactor இணைப்பை வழங்குகிறது; நான் என் முந்தைய இசைகளில் அதை இழந்துவிட்டேன்.a lot.
நான் பயன்படுத்துகிறேன்AiServices
, எனவே நான் முன்னர் Runtime இல் செயல்படுத்தப்படும் LangChain4J இன் ஒரு அணுகுமுறை அமைத்தேன்:
interface ChatBot {
fun talk(@MemoryId sessionId: String, @UserMessage message: String): TokenStream
}
பின்வருமாறு dependence என்று கூறுவோம்:
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-reactor</artifactId>
<version>1.0.0-beta3</version>
</dependency>
இப்போது நாம் A-ல் இருந்து Return Type மாற்ற முடியும்.Flux<String>
2 aTokenStream
இதோ புதுப்பிக்கப்பட்ட பதிவு:
interface ChatBot {
fun talk(@MemoryId sessionId: String, @UserMessage message: String): Flux<String>
}
அது படைத்தல்sink
இதன் பின்னணியில், கீழே உள்ள குறியீடுகளை எளிதாக்கலாம்:
val flux = chatBot.talk(m.sessionId, m.text)
ServerResponse.ok().bodyAndAwait(flux.asFlow())
நினைவில் கொள்ளுங்கள், இரண்டு நாட்கள் டெபாசிங் எளிதாக நீங்கள் பதிவிறக்க இரண்டு மணி நேரம் செலவழிக்க முடியும்!
மாதிரி Context Protocol Server
இந்த இடத்தில், நான் என் LangChain4J பயன்பாட்டில் ஒரு <abbr title="Model Context Protocol">MCP</abbr> சேர்க்க விரும்புகிறேன்.
Retrieval-Augmented Generation உற்பத்தி
ஆங்கிலத்தில் இதை Single Orgasm, Multiple Orgasm என்றும் கூறுகிறார்கள்.3) Like in some countries such as Dubai, is there a possibility in India too, that there will be no income tax, someday?பதில்: எண்பதுகளில் வருமான வரி ஒழிக்கப்படும் என்றும் கூறுகிறார்கள்.3) Like in some countries such as Dubai, is there a possibility in India too, that there will be no income tax, someday?பதில்: எண்பதுகளில் வருமான வரி ஒழிக்கப்படும் என்றும் கூறுகிறார்கள்.
ஒரு முதியவன் பாதாளங்களைத் தாண்டும் தன் மந்திரக்கோலால் சாய்த்தபடியிருக்கிறான் நாட்சத்திரங்களை. .............................................................................................................................................................................. இது எத்தனையாவது [...]
மாதிரி Context Protocol
LLMs நிலையான அம்சத்தை செயல்படுத்த புதிய வழி MCP ஆகும்.
MCP ஒரு திறந்த திட்டமாகும், பயன்பாடுகள் LLMs க்கான உரையாடல்களை வழங்குகிறது எப்படி. நினைக்க MCP ஒரு USB-C க்கு ஒரு USB-C பயன்பாடுகள் பயன்பாடுகள் போன்ற. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.
-- Model Context Protocol மூலம் தொடங்குங்கள்
MCP ஒரு திறந்த திட்டமாகும், பயன்பாடுகள் LLMs க்கான உரையாடல்களை வழங்குகிறது எப்படி. நினைக்க MCP ஒரு USB-C க்கு ஒரு USB-C பயன்பாடுகள் பயன்பாடுகள் போன்ற. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.
-- Model Context Protocol மூலம் தொடங்குங்கள்
MCP RAG மீது இரண்டு நன்மைகள் உள்ளன:
-
Data processed by a RAG is tailored for a model. If one wants to use a new model, one must re-execute the parsing phase. MCP standardizes the interactions between a client and a server, making them technology-independent.
-
RAG allows the reading of data. MCP allows any API call to either access data dynamically or execute actions!
MCP நிர்வாகம்2 மாற்று பயணிகள்Client-Server தொடர்பான தகவல்கள் :
- Stdio: Client starts a subprocess, and communication takes place over standard in and standard out.
- HTTP Server-Sent நிகழ்வுகள்
Architecture தீர்வு
இந்த மாதிரி think different type விளம்பரங்கள் தான் add industriesla இப்போ Hot...இங்கேநல்லா இருக்கு.ஆனால் நான் தேர்வு செய்தேன்.GitHub MCP சேவையகம்ஏனெனில் LangChain4J டாக்டர் அதைச் சொல்கிறது.
GitHub MCP சேவையகம்ஸ்டுடியோஒரு முதியவன் பாதாளங்களைத் தாண்டும் தன் மந்திரக்கோலால் சாய்த்தபடியிருக்கிறான் நாட்சத்திரங்களை. .............................................................................................................................................................................. இது எத்தனையாவது [...]
சில விசாரணைகள் நடந்த பின்னர், நான் கண்டுபிடித்தமென்பொருள் Proxyஇது நீங்கள் stdio இருந்து HTTP அல்லது HTTP இருந்து stdio இல் இடையே மாற்ற அனுமதிக்கிறது. அது ஒரு Docker படமாகவும் கிடைக்கிறது. நாங்கள் இரண்டு சேவையகமும், proxy இடையே பின்வருமாறு இணைக்க முடியும்Dockerfile
:
FROM ghcr.io/sparfenyuk/mcp-proxy:latest
ENV VERSION=0.2.0
ENV ARCHIVE_NAME=github-mcp-server_Linux_x86_64.tar.gz
RUN wget https://github.com/github/github-mcp-server/releases/download/v$VERSION/$ARCHIVE_NAME -O /tmp/$ARCHIVE_NAME \ #1
&& tar -xzvf /tmp/$ARCHIVE_NAME -C /opt \ #2
&& rm /tmp/$ARCHIVE_NAME #3
RUN chmod +x /opt/github-mcp-server #4
- பதிவிறக்க Archive
- extract அதை
- Archive வெளியிடவும்
- Binary Executable செய்யவும்
நாம் புரிந்துகொள்ள முடியாது என்பதைCMD
இந்த மாதிரி think different type விளம்பரங்கள் தான் add industriesla இப்போ Hot...docker-compose.yaml
:
services:
mcp-server:
build:
context: github-mcp-server
env_file:
- .env #1
command:
- --pass-environment #2
- --sse-port=8080 #3
- --sse-host=0.0.0.0 #4
- -- #5
- /opt/github-mcp-server #6
- --toolsets
- all
- stdio
- நாம் ஒரு GITHUB_PERSONAL_ACCESS_TOKEN Environment variable with a valid token to authenticate on GitHub தேவைப்படுகிறது
- அனைத்து மாற்றங்களையும் subprocess இல் சேர்க்கவும்
- செவியுறுத்தல் Port
- எல்லோருக்கும் IP
- Proxy "connects" to the stdio MCP server after the dash
- சேவையகத்தின் அனைத்து அம்சங்களும் திறக்கப்படும்
ஓவியம் வழங்கும்/sse
8080 க்கு மேற்பட்ட
Solution குறியீடு
கதையைப் படித்துப் படித்துப் படித்துப் படித்துப் படித்துப் படித்துப் படித்துப் படித்துப் படித்துப் பாருங்கள்.LangChain4J MCP பற்றிய தகவல்கள்அதற்குப் பின்னூட்டத்தில், அவர் கூறியதாவது:
bean {
val transport = HttpMcpTransport.Builder()
.sseUrl(ref<ApplicationProperties>().mcp.url) //1
.logRequests(true) //2
.logResponses(true) //2
.build()
val mcpClient = DefaultMcpClient.Builder()
.transport(transport)
.build()
mcpClient.listTools().forEach { println(it) } //3
McpToolProvider.builder()
.mcpClients(listOf(mcpClient))
.build()
}
bean {
coRouter {
val chatBot = AiServices
.builder(ChatBot::class.java)
.streamingChatLanguageModel(ref<StreamingChatLanguageModel>())
.chatMemoryProvider { MessageWindowChatMemory.withMaxMessages(40) }
.contentRetriever(EmbeddingStoreContentRetriever.from(ref<EmbeddingStore<TextSegment>>()))
.toolProvider(ref<McpToolProvider>()) //4
.build()
POST("/")(PromptHandler(chatBot)::handle)
}
}
- I added a ConfigurationProperty class to parameterize the SSE URL ஐ சேர்க்கவும்
- MCP Protocol ஒரு வழியை வழங்குகிறது, பதிப்புகளை வாடிக்கையாளரிடம் திரும்ப அனுப்ப
- தேவையில்லை, ஆனால் அது வாடிக்கையாளர் சேவையகத்திற்கு இணைக்க மற்றும் வழங்கப்பட்ட கருவிகளை பட்டியலிட முடியும் என்று உறுதி செய்ய உதவுகிறது
- மேலே படைக்கப்பட்ட MCP tool provider இல் plug in in the AiServices
இந்த நேரத்தில், மாதிரி MCP சேவையகத்திற்கு பதிவுசெய்யப்பட்ட எந்த கருவிகளையும் ஒப்பிடும் ஒரு தேவை அனுப்ப வேண்டும்.
curl -N -H 'Content-Type: application/json' localhost:8080 -d '{ "sessionId": "1", "text": "What are my top three most popular GitHub repos?" }'
நான் பல முறை முயற்சித்தேன், நான் இந்த வரிகளில் பதில் கிடைத்தது:
Unfortunately, the provided text does not contain any information about your top three most popular GitHub repositories. The text appears to be a blog post or a personal website, and it mentions some of your projects and experiences with GitHub, but it does not provide any metrics or statistics on the popularity of your repositories.
If you want to know more about the popularity of your GitHub repositories, I would recommend checking out GitHub's own analytics tools, such as GitHub Insights or the Repository Insights API. These tools can provide information about the number of followers, stars, and forks for each repository, as well as other metrics like engagement and activity.
ஆங்கிலத்தில் இதை Single Orgasm, Multiple Orgasm என்றும் கூறுகிறார்கள்.
தீர்வு சரிசெய்ய
ஒரு முதியவன் பாதாளங்களைத் தாண்டும் தன் மந்திரக்கோலால் சாய்த்தபடியிருக்கிறான் நாட்சத்திரங்களை. .............................................................................................................................................................................. இது எத்தனையாவது [...]
இந்த மாதிரி think different type விளம்பரங்கள் தான் add industriesla இப்போ Hot...github-mcp-server
இதன் பின்னணியில், HTTP இல் இருந்து Stdio இல் குறியீடு மாற்றப்பட்டது.இது தவறுகளை சரி செய்யவில்லை.
I was about to give up when I decided to come back to the roots.நான் திரும்பி வந்தேன்.Sample from Documentation - பதிவிறக்கம்இது என்னுடைய ஹா ஹா நிமிடம்.
இந்த மாதிரி think different type விளம்பரங்கள் தான் add industriesla இப்போ Hot...
curl -N -H 'Content-Type: application/json' localhost:8080 -d '{ "sessionId": "1", "text": "What are my top three most popular GitHub repos?" }'
Now, OpenAI correctly maps the request to the correct tool and returns the answer I was expecting: இப்போது OpenAI correctly maps the request to the correct tool and returns the answer I was expecting:
Here are my findings regarding your top three most popular GitHub repositories:
1. **[opentelemetry-tracing](https://github.com/nfrankel/opentelemetry-tracing)**
- **Description**: Demo for end-to-end tracing via OpenTelemetry.
- **Stars**: 68
- **Forks**: 25
- **Open Issues**: 10
2. **[kaadin](https://github.com/nfrankel/kaadin)**
- **Description**: Kotlin DSL for Vaadin.
- **Stars**: 44
- **Forks**: 12
- **Open Issues**: 3
3. **[jvm-controller](https://github.com/nfrankel/jvm-controller)**
- **Description**: Example on how to write a Kubernetes controller in Java.
- **Stars**: 33
- **Forks**: 10
- **Open Issues**: 0
These repositories demonstrate a range of your interests and contributions in the areas of observability, Kotlin development, and Kubernetes.%
ஏனெனில் நாம் ஒரு சான்றிதழ் டாக்னியை MCP சேவையகத்திற்கு அனுப்புகிறோம், இது அதை GitHub API-க்கு அனுப்புகிறது, இவர் எந்த பயனர் அழைப்பை செய்கிறார் என்பதை அறிவார்.my reposஒரு முதியவன் பாதாளங்களைத் தாண்டும் தன் மந்திரக்கோலால் சாய்த்தபடியிருக்கிறான் நாட்சத்திரங்களை. .............................................................................................................................................................................. இது எத்தனையாவது [...]
மேலும் regular questions,ஐ.ஜி, find the most popular repositories on GitHub, are relevant to web applications, as they do not have implicit context-the user.
முடிவு
இந்த பதிவின் முக்கிய அம்சம் ஒரு LangChain4J பயன்பாட்டில் ஒரு MCP சேவையகத்தின் இணைப்பு ஆகும்.
முன்பே ஏற்றப்பட்ட (preloaded) Multi-Turbo மற்றும் Ultra Game Mode ஆகியவை உள்ளன.mcp-proxy
அதற்கு மேல் நேரம் ஆனால் உடலுக்கு நல்லது இல்லை, முடிந்த வரை இரவு தூங்கும் முன் cell phone use செய்ய வேண்டாம் .
ஒரு முதியவன் பாதாளங்களைத் தாண்டும் தன் மந்திரக்கோலால் சாய்த்தபடியிருக்கிறான் நாட்சத்திரங்களை. .............................................................................................................................................................................. இது எத்தனையாவது [...]
இந்த பதிவுக்கு முழுமையான source code கிடைக்கும்.GitHub இல்.
To go further:
- Model Context Protocol ஐப் பயன்படுத்துங்கள்
- அற்புதமான MCP சேவையாளர்கள் மற்றும் வாடிக்கையாளர்கள் கண்டுபிடிக்க
- LangChain4J - வடிவமைப்பு kontekst protocol (MCP)
முதலில் வெளியிடப்பட்டது A Java Geek on April 27, 2025
ஒரு Java Geek