Skip to content
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

(minor) search memoization + context #2732

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

pablodanswer
Copy link
Contributor

Description

[Provide a brief description of the changes in this PR]

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Accepted Risk

[Any know risks or failure modes to point out to reviewers]

Related Issue(s)

[If applicable, link to the issue(s) this PR addresses]

Checklist:

  • All of the automated tests pass
  • All PR comments are addressed and marked resolved
  • If there are migrations, they have been rebased to latest main
  • If there are new dependencies, they are added to the requirements
  • If there are new environment variables, they are added to all of the deployment methods
  • If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
  • Docker images build and basic functionalities work
  • Author has done a final read through of the PR right before merge

Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2024 1:19am

@pablodanswer pablodanswer changed the title add markdown blocks to search (minor) memoization + context Oct 9, 2024
@pablodanswer pablodanswer changed the title (minor) memoization + context (minor) search memoization + context Oct 9, 2024
@pablodanswer pablodanswer marked this pull request as ready for review October 9, 2024 01:20
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR introduces minor enhancements to multi-tenancy support and markdown rendering optimization in the DAnswer project.

  • Modified get_session in backend/danswer/db/engine.py to retrieve tenant ID from current_tenant_id context variable before creating a database session
  • Implemented memoization in web/src/components/chat_search/MinimalMarkdown.tsx for markdownComponents object, dependent on the content prop
  • Added useMemo hook in MinimalMarkdown component to potentially improve rendering performance
  • Ensured correct tenant schema is set for each database session in multi-tenant scenarios
  • Updated markdownComponents to include memoized versions of Link and Paragraph components

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

() => ({
a: MemoizedLink,
p: MemoizedParagraph,
code: ({ node, inline, className, children, ...props }: any) => {
Copy link

Choose a reason for hiding this comment

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

style: The 'inline' and '...props' parameters are unused. Consider removing them if not needed

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.

1 participant