Skip to content

Conversation

Malaydewangan09
Copy link
Contributor

Adds support for DuckDuckGo as a web search engine.

@Martin7-1 Martin7-1 added P3 Medium priority theme: web search engine Issues/PRs related to web search engine labels Sep 1, 2025
@Malaydewangan09 Malaydewangan09 force-pushed the feat/duckduckgo-search-engine branch from 051778e to 7795d85 Compare September 1, 2025 06:45
@Martin7-1
Copy link
Collaborator

@Malaydewangan09 Thanks for your contribution! There are some failed tests, could you please check?

@Malaydewangan09
Copy link
Contributor Author

Malaydewangan09 commented Sep 2, 2025

Hey, @Martin7-1 👋 yes, I’ll check this.
Thanks!

@Malaydewangan09 Malaydewangan09 force-pushed the feat/duckduckgo-search-engine branch from 7795d85 to 67874f2 Compare September 2, 2025 19:28
@Malaydewangan09
Copy link
Contributor Author

Malaydewangan09 commented Sep 5, 2025

Seems, more like a rate liming issue with DuckDuckGo 👀
I’ll have a look at this again!

@anna-geller
Copy link

@Malaydewangan09, is this PR still a draft or ready to be reviewed by maintainers? Do you still see rate-limiting issues?

@Malaydewangan09 Malaydewangan09 force-pushed the feat/duckduckgo-search-engine branch 2 times, most recently from 6fa7943 to 530d07e Compare October 10, 2025 10:57
@Martin7-1
Copy link
Collaborator

@Malaydewangan09 Hi! Thanks for your contribution. Could you please rebase master branch?

@Malaydewangan09 Malaydewangan09 force-pushed the feat/duckduckgo-search-engine branch from 530d07e to 3e9de5e Compare October 10, 2025 11:13
@Malaydewangan09
Copy link
Contributor Author

Malaydewangan09 commented Oct 10, 2025

Hey @Martin7-1, it's done, but I see spotless error in other modules too 🤔 Should I apply these?
Thanks!

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.4:check (default-cli) on project langchain4j-community-core: The following files had format violations:
[ERROR]     src/test/java/dev/langchain4j/community/chain/RetrievalQAChainTest.java
[ERROR]         @@ -84,10 +84,10 @@
[ERROR]          ········String·expectedUserMessage·=
[ERROR]          ················"""
[ERROR]          ················query
[ERROR]         -················
[ERROR]         +
[ERROR]          ················Answer·using·the·following·information:
[ERROR]          ················Segment·1
[ERROR]         -················
[ERROR]         +
[ERROR]          ················Segment·2""";
[ERROR]          ········assertThat(messagesCaptor.getValue()).isEqualTo(expectedUserMessage);
[ERROR]          ····}
[ERROR] Run 'mvn spotless:apply' to fix these violations.

@Martin7-1
Copy link
Collaborator

Martin7-1 commented Oct 11, 2025

Hey @Martin7-1, it's done, but I see spotless error in other modules too 🤔 Should I apply these? Thanks!

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.4:check (default-cli) on project langchain4j-community-core: The following files had format violations:
[ERROR]     src/test/java/dev/langchain4j/community/chain/RetrievalQAChainTest.java
[ERROR]         @@ -84,10 +84,10 @@
[ERROR]          ········String·expectedUserMessage·=
[ERROR]          ················"""
[ERROR]          ················query
[ERROR]         -················
[ERROR]         +
[ERROR]          ················Answer·using·the·following·information:
[ERROR]          ················Segment·1
[ERROR]         -················
[ERROR]         +
[ERROR]          ················Segment·2""";
[ERROR]          ········assertThat(messagesCaptor.getValue()).isEqualTo(expectedUserMessage);
[ERROR]          ····}
[ERROR] Run 'mvn spotless:apply' to fix these violations.

Don't worry about it :) Looks like Github Action successfully passed spotless check. I'll review the PR asap.

@Malaydewangan09
Copy link
Contributor Author

Malaydewangan09 commented Oct 11, 2025

Its still red after adding small retry though 🤔
Works fine, when I launch multiple runs for these tests locally.
On it!

@Martin7-1
Copy link
Collaborator

Its still red after adding small retry though 🤔 Works fine, when I launch multiple runs for these tests locally. On it!

Great! Please ping me if you find ways to solve it.

@Malaydewangan09
Copy link
Contributor Author

Malaydewangan09 commented Oct 11, 2025

@Martin7-1, updated the tests to be more resilient and also took some inspiration from python DuckDuckGo wrapper used in langchain! 🤞

@Martin7-1
Copy link
Collaborator

Hmm...Looks like it stiil failed

@Malaydewangan09
Copy link
Contributor Author

Malaydewangan09 commented Oct 12, 2025

Humm, looks like a connection timeout now 🤔
Tried running parallel tests on my machine seems good there. Added an extra step to check for network availability in tests!

Copy link
Collaborator

@Martin7-1 Martin7-1 left a comment

Choose a reason for hiding this comment

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

@Malaydewangan09 I can passed all tests in my local env, looks like the GitHub Action may have some network problem :)

Great job! Thank you!

@Martin7-1 Martin7-1 marked this pull request as ready for review October 12, 2025 07:59
@Martin7-1
Copy link
Collaborator

Please add documents in langchain4j main repo. Thank you!

@Malaydewangan09
Copy link
Contributor Author

Yeah, seems like that.
I'll add the docs in the main repo, thanks!

@Martin7-1 Martin7-1 merged commit dcb523b into langchain4j:main Oct 12, 2025
5 checks passed
@Malaydewangan09 Malaydewangan09 deleted the feat/duckduckgo-search-engine branch October 12, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Medium priority theme: web search engine Issues/PRs related to web search engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Support for DuckDuckGo Web Search Engine

3 participants