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.
🔄 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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/12042
Author: @yazon
Created: 3/25/2025
Status: ❌ Closed
Base:
dev← Head:display-perplexity-sources📝 Commits (1)
151e2b3Handle 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:
devbranch.Changelog Entry
Description
Changed
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.