Skip to content

Conversation

kpavlov
Copy link
Owner

@kpavlov kpavlov commented May 1, 2025

Switch to Explicit API mode

@kpavlov kpavlov requested a review from Copilot May 1, 2025 06:57
@kpavlov kpavlov added the enhancement New feature or request label May 1, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR converts various API elements to use Kotlin’s explicit API mode by explicitly marking classes, functions, and type aliases as public or internal as appropriate. Key changes include updating test classes to internal visibility, adding public modifiers to public API components, and aligning extension functions and adapter classes with the explicit API requirements.

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ServiceWithSystemMessageProviderTest.kt Changed test class to internal and added a Mockito annotation for clarity.
ServiceWithPromptTemplatesTest.kt Updated test class visibility to internal.
SimpleTemplateRendererTest.kt Updated test class visibility to internal.
MetadataExtensionsTest.kt Updated test class visibility to internal.
ServiceWithFlowTest.kt Changed test class visibility to internal and ensured proper Mockito usage.
TestEnvironment.kt Marked the object as internal.
Documents.kt Added public modifier to the API function.
TemplateSystemMessageProvider.kt Made the class, functions, and constructors public.
SystemMessageProvider.kt Made the interface and its members public.
RenderablePromptTemplate.kt Marked the class and its primary property as public.
PromptTemplateSource.kt Marked the interface method as public.
PromptTemplate.kt Added public modifiers to the interface and implementation functions.
ChatRequestExtensions.kt Updated functions with public modifiers in request builders and related extensions.
StreamingChatLanguageModelExtensions.kt Added public modifiers to extension functions and nested data classes.
ChatLanguageModelExtensions.kt Updated extension functions to be public.
TokenStreamToStringFlowAdapter.kt Added public modifiers to the class and its methods.
TokenStreamToReplyFlowAdapter.kt Added public modifiers and refined the type parameter check.
TypeAliases.kt Marked type aliases as public.
Configuration.kt Updated the object and its members to be public.
Files not reviewed (1)
  • langchain4j-kotlin/pom.xml: Language not supported

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.02% (target: -1.00%) 94.44%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (970793a) 262 251 95.80%
Head commit (ea63b66) 261 (-1) 250 (-1) 95.79% (-0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#124) 36 34 94.44%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link

codecov bot commented May 1, 2025

Codecov Report

Attention: Patch coverage is 86.11111% with 5 lines in your changes missing coverage. Please review.

Project coverage is 89.69%. Comparing base (970793a) to head (ea63b66).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...j/kotlin/adapters/TokenStreamToReplyFlowAdapter.kt 40.00% 0 Missing and 3 partials ⚠️
...kotlin/model/chat/request/ChatRequestExtensions.kt 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
- Coverage   89.73%   89.69%   -0.04%     
==========================================
  Files          17       17              
  Lines         263      262       -1     
  Branches       33       32       -1     
==========================================
- Hits          236      235       -1     
  Misses         12       12              
  Partials       15       15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kpavlov kpavlov marked this pull request as ready for review May 1, 2025 07:24
@kpavlov kpavlov merged commit 5b37f04 into main May 1, 2025
5 of 7 checks passed
@kpavlov kpavlov deleted the explicit-api branch May 1, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant