Skip to content

Conversation

@aralyekta
Copy link
Collaborator

@aralyekta aralyekta commented Jul 30, 2025

Summary by CodeRabbit

  • New Features

    • Added documentation for new API endpoints to list, retrieve, and delete conversation sessions.
    • Enhanced semantic search API documentation with support for filtering by labels and displaying associated labels in results.
  • Improvements

    • Updated "Ask Question" endpoint documentation to support an optional external user ID for session tracking, including new error response examples.
  • Documentation

    • Updated navigation to include new session-related API endpoints for easier access.

@coderabbitai
Copy link

coderabbitai bot commented Jul 30, 2025

Walkthrough

This update introduces new and enhanced API documentation for session management and semantic search features. It adds documentation for listing, retrieving, and deleting conversation sessions, updates the "Ask Question" and semantic search endpoints with new optional parameters, and adjusts the navigation configuration to include the new endpoints.

Changes

Cohort / File(s) Change Summary
Session Management Endpoints
api-reference/endpoints/list-sessions.mdx, api-reference/endpoints/get-session.mdx, api-reference/endpoints/delete-session.mdx
Added API documentation for listing, retrieving, and deleting conversation sessions, including request/response schemas, parameters, and error examples.
Ask Question Endpoint Update
api-reference/endpoints/ask-question.mdx
Added optional external_user_id parameter, updated session handling logic, and included a new 400 error example for user ID mismatch.
Semantic Search Endpoint Update
api-reference/endpoints/semantic-search.mdx
Added optional labels array parameter for filtering, included labels in the response schema, and clarified the link field behavior.
Navigation Configuration
mint.json
Added references to the new session management endpoints in the API documentation navigation.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API

    %% List Sessions
    Client->>API: POST /{guru_slug}/sessions/ (with page_num, search_query, external_user_id)
    API-->>Client: Sessions grouped by time period, has_more flag

    %% Get Session
    Client->>API: POST /sessions/{session_id}/conversation/
    API-->>Client: Full conversation history for session_id

    %% Delete Session
    Client->>API: DELETE /sessions/{session_id}/delete/
    API-->>Client: Success or error message

    %% Ask Question (with external_user_id)
    Client->>API: POST /{guru_slug}/answer/ (with optional external_user_id)
    alt external_user_id matches session
        API-->>Client: Answer response
    else external_user_id mismatch
        API-->>Client: 400 error (S-902)
    end

    %% Semantic Search (with labels)
    Client->>API: POST /{guru_slug}/semantic-search/ (with optional labels)
    API-->>Client: Sources filtered by labels, each with labels array
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

  • Improve ask question docs #31: Both PRs update the API documentation for the POST /{guru_slug}/answer/ "Ask Question" endpoint by adding new optional body parameters to enhance request handling and session management.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (8)
api-reference/endpoints/ask-question.mdx (2)

34-36: Clarify optionality & expected format of external_user_id

Consider adding either required={false} or an explicit note that the value must be a string ≤ 256 chars (or whatever your limit is). This keeps the docs self-contained and helps client teams validate inputs.


132-137: Add an example request demonstrating the mismatch error

You’ve documented the 400 response but not the request shape that triggers it.
Including a minimal JSON request with a conflicting external_user_id will make the scenario crystal-clear.

api-reference/endpoints/semantic-search.mdx (2)

21-24: State element type for labels array

Readers will wonder whether labels are free-form strings, UUIDs, or IDs. Add something like items="string" or a short sentence: “Each entry must be a non-empty string label name”.


34-38: Move labels field description next to the existing ones for consistency

The bullet list is now slightly out of order (icon_url is shown before labels). Swapping them keeps the response schema tidy and predictable.

api-reference/endpoints/list-sessions.mdx (2)

17-19: Document maximum page size or expose a page_size parameter

page_num is documented, but without a way to control page size clients cannot anticipate result volume or optimise pagination.


31-66: Provide schema details for last_week and older arrays as well

Only the today group contains an expandable schema. Re-using the same expandable (or factoring it into a reusable component) for the other two keeps the docs symmetric and avoids reader confusion.

api-reference/endpoints/delete-session.mdx (1)

25-43: Consider using HTTP 204 for successful deletion

REST conventions typically return 204 No Content for a DELETE when nothing is returned beyond a confirmation. If you intentionally return a JSON payload, note the rationale so integrators know to expect a body.

api-reference/endpoints/get-session.mdx (1)

88-224: Group success & error examples with <CodeGroup> for cleaner UX.

Presenting six standalone code blocks clutters the page. Mintlify supports:

<CodeGroup>
  <CodeGroup.Item title="200 – OK">
```json
{ ... }

</CodeGroup.Item>

<CodeGroup.Item title="400 – Bad Request">

{ "msg": "Binge ID is required" }

</CodeGroup.Item>


This keeps the examples collapsible and aligned with the rest of the API docs.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between ba7bbea40eafd0599e60a3c68f777539590d62ae and cd56f8b8d000d22d637356c9f16f875132bcbd06.

</details>

<details>
<summary>📒 Files selected for processing (6)</summary>

* `api-reference/endpoints/ask-question.mdx` (2 hunks)
* `api-reference/endpoints/delete-session.mdx` (1 hunks)
* `api-reference/endpoints/get-session.mdx` (1 hunks)
* `api-reference/endpoints/list-sessions.mdx` (1 hunks)
* `api-reference/endpoints/semantic-search.mdx` (3 hunks)
* `mint.json` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>📓 Path-based instructions (3)</summary>

<details>
<summary>**/*.mdx</summary>


**📄 CodeRabbit Inference Engine (CLAUDE.md)**

> `**/*.mdx`: Use MDX format for all documentation files
> Use Mintlify components like <Card>, <CardGroup>, <CodeGroup> for rich content
> Include practical examples and code snippets in documentation
> Use images from /images/ directory for visual guides

Files:
- `api-reference/endpoints/delete-session.mdx`
- `api-reference/endpoints/list-sessions.mdx`
- `api-reference/endpoints/ask-question.mdx`
- `api-reference/endpoints/get-session.mdx`
- `api-reference/endpoints/semantic-search.mdx`

</details>
<details>
<summary>api-reference/endpoints/**/*.mdx</summary>


**📄 CodeRabbit Inference Engine (CLAUDE.md)**

> API endpoint docs follow the structure in /api-reference/endpoints/

Files:
- `api-reference/endpoints/delete-session.mdx`
- `api-reference/endpoints/list-sessions.mdx`
- `api-reference/endpoints/ask-question.mdx`
- `api-reference/endpoints/get-session.mdx`
- `api-reference/endpoints/semantic-search.mdx`

</details>
<details>
<summary>mint.json</summary>


**📄 CodeRabbit Inference Engine (CLAUDE.md)**

> `mint.json`: Navigation structure is defined in mint.json under the navigation key
> mint.json contains all site configuration, navigation, and settings

Files:
- `mint.json`

</details>

</details><details>
<summary>🧠 Learnings (4)</summary>

<details>
<summary>api-reference/endpoints/delete-session.mdx (1)</summary>

Learnt from: CR
PR: Gurubase/gurubase-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-19T21:27:14.098Z
Learning: Applies to api-reference/endpoints/**/*.mdx : API endpoint docs follow the structure in /api-reference/endpoints/

</details>
<details>
<summary>mint.json (3)</summary>

Learnt from: CR
PR: Gurubase/gurubase-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-19T21:27:14.098Z
Learning: Applies to mint.json : mint.json contains all site configuration, navigation, and settings

Learnt from: CR
PR: Gurubase/gurubase-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-19T21:27:14.098Z
Learning: Applies to mint.json : Navigation structure is defined in mint.json under the navigation key

Learnt from: CR
PR: Gurubase/gurubase-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-19T21:27:14.098Z
Learning: Applies to api-reference/endpoints/**/*.mdx : API endpoint docs follow the structure in /api-reference/endpoints/

</details>
<details>
<summary>api-reference/endpoints/get-session.mdx (1)</summary>

Learnt from: CR
PR: Gurubase/gurubase-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-19T21:27:14.098Z
Learning: Applies to api-reference/endpoints/**/*.mdx : API endpoint docs follow the structure in /api-reference/endpoints/

</details>
<details>
<summary>api-reference/endpoints/semantic-search.mdx (1)</summary>

Learnt from: CR
PR: Gurubase/gurubase-docs#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-19T21:27:14.098Z
Learning: Applies to api-reference/endpoints/**/*.mdx : API endpoint docs follow the structure in /api-reference/endpoints/

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (2)</summary><blockquote>

<details>
<summary>mint.json (1)</summary>

`118-121`: **Verified: `get-session.mdx` Exists**

The file `api-reference/endpoints/get-session.mdx` is present, so the navigation link won’t break.

</details>
<details>
<summary>api-reference/endpoints/get-session.mdx (1)</summary>

`1-5`: **Confirm HTTP verb for session conversation endpoint**

- File: api-reference/endpoints/get-session.mdx  
- Front-matter currently reads:
  ```yaml
  title: 'Get Session'
  api: 'POST /sessions/{session_id}/conversation/'
  • Since this operation “retrieves” a session, it likely should be a GET request. If the backend really expects GET, update to:
    -api: 'POST /sessions/{session_id}/conversation/'
    +api: 'GET /sessions/{session_id}/conversation/'

Please verify the actual route/controller implementation (and any tests or nav entries) to confirm which HTTP verb is required, then adjust the docs accordingly.

@fatihbaltaci fatihbaltaci merged commit 5d0d778 into master Jul 31, 2025
3 checks passed
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.

3 participants