[PR #12042] [CLOSED] Add Citation support for indexes starting at [1] #110150

Closed
opened 2026-05-18 09:40:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/12042
Author: @yazon
Created: 3/25/2025
Status: Closed

Base: devHead: display-perplexity-sources


📝 Commits (1)

  • 151e2b3 Handle displaying citations for both, starting from either [0] or [1]

📊 Changes

1 file changed (+22 additions, -5 deletions)

View changed files

📝 src/lib/utils/index.ts (+22 -5)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for validating the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
    • feat: Introduces a new feature or enhancement to the codebase

Changelog Entry

Description

  • I added support to display citations properly when they start from [1]. Previously, the code assumed that citations start from [0], but for example Perplexity Sonar returns citations starting from [1]. The code now handles both formats. Without this change, citations would be misaligned.

Changed

  • Updated index.ts to properly handle the source numbers.

Additional Information

Screenshots or Videos

https://github.com/user-attachments/assets/8683d32d-ae56-4594-97ad-fc0c6993e8fb


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/12042 **Author:** [@yazon](https://github.com/yazon) **Created:** 3/25/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `display-perplexity-sources` --- ### 📝 Commits (1) - [`151e2b3`](https://github.com/open-webui/open-webui/commit/151e2b383bfa6f6bf8e2446358dfece597232bd0) Handle displaying citations for both, starting from either [0] or [1] ### 📊 Changes **1 file changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/utils/index.ts` (+22 -5) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests for validating the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following: - **feat**: Introduces a new feature or enhancement to the codebase # Changelog Entry ### Description - I added support to display citations properly when they start from [1]. Previously, the code assumed that citations start from [0], but for example Perplexity Sonar returns citations starting from [1]. The code now handles both formats. Without this change, citations would be misaligned. ### Changed - Updated index.ts to properly handle the source numbers. --- ### Additional Information - Tested with Perplexity Sonar Pipe v2.0 where citations are emitted: https://openwebui.com/f/yazon/perplexity_sonar_api_with_citations - This is a follow up PR of https://github.com/open-webui/open-webui/pull/11216 ### Screenshots or Videos https://github.com/user-attachments/assets/8683d32d-ae56-4594-97ad-fc0c6993e8fb --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-18 09:40:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#110150