Skip to content
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

Chat request builders #62

Merged
merged 5 commits into from
Jan 11, 2025
Merged

Chat request builders #62

merged 5 commits into from
Jan 11, 2025

Conversation

kpavlov
Copy link
Owner

@kpavlov kpavlov commented Jan 11, 2025

Introduced ChatRequestBuilder and chatRequest extensions to simplify constructing and configuring ChatRequests. Added corresponding async methods, tests, and updated examples to enhance usability and ensure consistent behavior.

Introduced a new samples module to demonstrate the usage of the LangChain4j-Kotlin library. Includes a ChatModel example and updates the root pom.xml to include the module. Updated dependencies and configurations to support Kotlin and the newly added artifacts.

Upgraded langchain4j dependencies to 1.0.0-alpha1 and replaced outdated builder syntax with concise Kotlin DSL in code examples. These changes improve clarity, maintain modernity, and ensure compatibility with the latest API.

Introduce a new OpenAiChatModelExample.kt showcasing asynchronous chat with OpenAI's GPT-4-based model. Updated pom.xml to include required dependencies, renamed ChatModel.kt to ChatModelExample.kt, and added logging configuration via simplelogger.properties. Enhanced README with updated sample references.

Konstantin Pavlov added 4 commits January 11, 2025 12:29
Introduced `ChatRequestBuilder` and `chatRequest` extensions to simplify constructing and configuring ChatRequests. Added corresponding async methods, tests, and updated examples to enhance usability and ensure consistent behavior.
Introduced a new `samples` module to demonstrate the usage of the LangChain4j-Kotlin library. Includes a `ChatModel` example and updates the root `pom.xml` to include the module. Updated dependencies and configurations to support Kotlin and the newly added artifacts.
Upgraded `langchain4j` dependencies to `1.0.0-alpha1` and replaced outdated builder syntax with concise Kotlin DSL in code examples. These changes improve clarity, maintain modernity, and ensure compatibility with the latest API.
Introduce a new `OpenAiChatModelExample.kt` showcasing asynchronous chat with OpenAI's GPT-4-based model. Updated `pom.xml` to include required dependencies, renamed `ChatModel.kt` to `ChatModelExample.kt`, and added logging configuration via `simplelogger.properties`. Enhanced README with updated sample references.
Copy link

codacy-production bot commented Jan 11, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.05% (target: -1.00%) 80.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (57a1a0d) 176 142 80.68%
Head commit (59f1add) 191 (+15) 154 (+12) 80.63% (-0.05%)

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 (#62) 15 12 80.00%

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

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.52%. Comparing base (57a1a0d) to head (59f1add).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...kotlin/model/chat/request/ChatRequestExtensions.kt 78.57% 3 Missing ⚠️
...j/kotlin/model/chat/ChatLanguageModelExtensions.kt 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   75.56%   75.52%   -0.05%     
==========================================
  Files          14       15       +1     
  Lines         176      192      +16     
  Branches       15       15              
==========================================
+ Hits          133      145      +12     
- Misses         34       38       +4     
  Partials        9        9              

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

Included a Kotlin code snippet demonstrating how to use the `chatAsync` function with a `ChatRequestBuilder`. This improves clarity and provides developers with a concrete example for better understanding and implementation.
@kpavlov kpavlov marked this pull request as ready for review January 11, 2025 12:40
@kpavlov kpavlov merged commit 4ad0b2b into main Jan 11, 2025
4 of 7 checks passed
@kpavlov kpavlov deleted the chat-request-builders branch January 11, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant