-
Notifications
You must be signed in to change notification settings - Fork 102
Add support for conversational search #716
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
base: main
Are you sure you want to change the base?
Conversation
|
Warning Rate limit exceeded@curquiza has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 45 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdds a new chats module implementing chat-workspace data models, builder-style settings and prompts, a query builder, client CRUD-like methods for workspaces and settings, optional reqwest-gated streaming for chat completions, networking helpers, tests exercising workspace lifecycle, and a crate-private reqwest accessor; exports module in Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Client as Client<Http>
participant API as Meilisearch API
Dev->>Client: list_chat_workspaces()
Client->>API: GET /chats
API-->>Client: ChatWorkspacesResults
Client-->>Dev: ChatWorkspacesResults
Dev->>Client: get_chat_workspace(uid)
Client->>API: GET /chats/{uid}
API-->>Client: ChatWorkspace
Client-->>Dev: ChatWorkspace
Dev->>Client: get_chat_workspace_settings(uid)
Client->>API: GET /chats/{uid}/settings
API-->>Client: ChatWorkspaceSettings
Client-->>Dev: ChatWorkspaceSettings
Dev->>Client: update_chat_workspace_settings(uid, settings)
Client->>API: PATCH /chats/{uid}/settings (JSON)
API-->>Client: ChatWorkspaceSettings
Client-->>Dev: ChatWorkspaceSettings
Dev->>Client: reset_chat_workspace_settings(uid)
Client->>API: DELETE /chats/{uid}/settings
API-->>Client: ChatWorkspaceSettings
Client-->>Dev: ChatWorkspaceSettings
sequenceDiagram
autonumber
actor Dev as Developer
participant Client as Client<reqwest> (feature)
participant API as Meilisearch API
Dev->>Client: stream_chat_completion(uid, body)
Client->>API: POST /chats/{uid}/chat/completions\nAccept: text/event-stream
Note over API,Client: Server streams JSON chunks (streamed response)
API-->>Client: Streaming response (reqwest::Response)
Client-->>Dev: reqwest::Response (stream)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #716 +/- ##
==========================================
+ Coverage 85.90% 86.16% +0.25%
==========================================
Files 19 20 +1
Lines 6079 6395 +316
==========================================
+ Hits 5222 5510 +288
- Misses 857 885 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/chats.rs (1)
144-147: Consider acceptingimpl Into<ChatPrompts>for consistency.The
set_promptsmethod takesChatPromptsby value, while other setters useimpl Into<String>. For consistency and flexibility, consider acceptingimpl Into<ChatPrompts>or cloning a reference.Apply this diff:
- pub fn set_prompts(&mut self, prompts: ChatPrompts) -> &mut Self { - self.prompts = Some(prompts); + pub fn set_prompts(&mut self, prompts: impl Into<ChatPrompts>) -> &mut Self { + self.prompts = Some(prompts.into()); self }Then implement:
impl From<ChatPrompts> for ChatPrompts { fn from(p: ChatPrompts) -> Self { p } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/chats.rs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/chats.rs (3)
src/reqwest.rs (3)
new(24-51)new(148-155)qualified_version(131-135)src/client.rs (3)
new(53-65)None(1283-1283)None(1362-1362)src/request.rs (2)
body(49-56)parse_response(110-146)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: integration-tests
🔇 Additional comments (5)
src/chats.rs (5)
12-47: LGTM! Well-designed data models.The structs properly use serde attributes for JSON serialization. The
ChatPrompts.extrafield withflattenallows provider-specific extensions while maintaining type safety for known fields.
49-79: LGTM! Clean builder pattern.The implementation follows Rust builder conventions with
must_useand method chaining support.
150-184: LGTM! Well-designed query builder.The query builder properly manages the client reference with lifetimes and excludes it from serialization. The builder pattern is correctly implemented.
186-268: LGTM! Solid CRUD implementation.The methods follow REST conventions and use
AsRef<str>for flexible string parameters. The HTTP method choices align with RESTful design.
336-413: LGTM! Comprehensive integration test.The test thoroughly exercises the chats API lifecycle:
- Settings CRUD operations
- Workspace retrieval
- Query builder with pagination
- API key masking verification (lines 380-385)
The test structure is clear and covers the key use cases.
|
@coderabbitai generate docstrings |
✅ Actions performedInitiated docstring generation; will generate only if new commits exist. |
|
Note Docstrings generation - SUCCESS |
Docstrings generation was requested by @kumarUjjawal. * #716 (comment) The following files were modified: * `src/chats.rs` * `src/reqwest.rs`
curquiza
left a comment
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.
bors merge
|
Canceled. |
curquiza
left a comment
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.
bors merge
716: Add support for conversational search r=curquiza a=kumarUjjawal # Pull Request ## Related issue Fixes #696 ## What does this PR do? ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Chat workspaces management: list (with pagination), retrieve, and view/update/reset workspace settings. * Configurable prompts included in workspace settings with builder-style configuration. * Optional streaming API for real-time chat completions. * **Documentation** * Added introductory documentation for the new chats module. * **Tests** * Integration test covering full chat workspace lifecycle (list, retrieve, configure prompts, update/reset). * **Chores** * Added a crate-private accessor for the HTTP client used by the optional reqwest integration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Kumar Ujjawal <ujjawalpathak6@gmail.com> Co-authored-by: Clémentine <clementine@meilisearch.com>
|
Build failed: |
curquiza
left a comment
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.
bors merge
Pull Request
Related issue
Fixes #696
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!
Summary by CodeRabbit
New Features
Documentation
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.