-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Get PDFs to jump to their pages again #1283
Conversation
@@ -37,7 +37,7 @@ class ChatApproach(Approach, ABC): | |||
Make sure the last question ends with ">>". | |||
""" | |||
|
|||
query_prompt_template = """Below is a history of the conversation so far, and a new question asked by the user that needs to be answered by searching in a knowledge. | |||
query_prompt_template = """Below is a history of the conversation so far, and a new question asked by the user that needs to be answered by searching in a knowledge base. |
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.
This was caught by a reader of my blog post today-https://blog.pamelafox.org/2024/02/rag-techniques-cleaning-user-questions.html
Doubt it affects anything as GPTs dont mind lil errors.
return ( | ||
<li className={styles.tListItem}> | ||
<li className={styles.tListItem} key={ind}> |
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.
We were getting a bunch of React errors locally from missing key= values. An index isnt the best thing to use but it should be okay for our situation.
export const SupportingContent = ({ supportingContent }: Props) => { | ||
const textItems = Array.isArray(supportingContent) ? supportingContent : supportingContent.text; | ||
const imageItems = !Array.isArray(supportingContent) ? supportingContent?.images : []; | ||
return ( | ||
<ul className={styles.supportingContentNavList}> | ||
{textItems.map(c => { | ||
{textItems.map((c, ind) => { |
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.
Ditto, this was just fixing index. And I moved the HTML inside the class as I couldn't deal with writing the correct Typescript for the separate component. :)
@@ -34,12 +34,19 @@ export const AnalysisPanel = ({ answer, activeTab, activeCitation, citationHeigh | |||
const fetchCitation = async () => { | |||
const token = client ? await getToken(client) : undefined; | |||
if (activeCitation) { | |||
// Get hash from the URL as it may contain #page=N |
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.
This makes sense since we download the full object url. Appreciate your fix
Purpose
Fixes #1245
This PR has a few fixes, but the biggest one is a fix for regression introduced by #1160 which replaced citation URLs with blob URLs. My fix remembers the hash and adds it to the blob URL after, which seems to work correctly in Edge. I couldn't find any documentation as to whether blob URLs formally support hash fragments, but they seem to!
Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test