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

feat: add FastAPI lifespan and healthcheck endpoint #144

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

paul-paliychuk
Copy link
Collaborator

@paul-paliychuk paul-paliychuk commented Sep 22, 2024

Important

Add FastAPI lifespan for graphiti initialization, a /healthcheck endpoint, and initialize_graphiti function for index setup.

  • FastAPI Lifespan: Added lifespan async context manager in main.py for graphiti initialization.
  • Endpoints: Replaced root endpoint with /healthcheck in main.py, returning JSON status.
  • Graphiti Initialization: Added initialize_graphiti() in zep_graphiti.py for index and constraint setup.

This description was created by Ellipsis for f651132. It will automatically update as commits are pushed.

@ellipsis-dev ellipsis-dev bot changed the title ... feat: add FastAPI lifespan and healthcheck endpoint Sep 22, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to cd3906d in 14 seconds

More details
  • Looked at 57 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. server/graph_service/zep_graphiti.py:85
  • Draft comment:
    The initialize_graphiti and get_graphiti functions have repetitive code for creating a ZepGraphiti client. Consider refactoring to avoid this repetition and adhere to the DRY principle.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The code in initialize_graphiti and get_graphiti is very similar, violating the DRY principle. They both create a ZepGraphiti client with the same parameters. This should be refactored to avoid repetition.
2. server/graph_service/main.py:1
  • Draft comment:
    Ensure a copyright notice is present at the top of this file and other Python files in the project.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_pOUGiWDGYAwGShI5


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

server/graph_service/zep_graphiti.py Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on f651132 in 15 seconds

More details
  • Looked at 28 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. server/graph_service/main.py:17
  • Draft comment:
    Ensure that Graphiti is properly closed after each request to prevent resource leaks. The comment suggests this is handled per-request, but it's not evident in the code.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The lifespan function initializes Graphiti but does not handle its closure. This could lead to resource leaks if Graphiti is not closed properly after each request. The comment suggests that closure is handled per-request, but this is not evident in the code provided.
2. server/graph_service/main.py:14
  • Draft comment:
    The function initialize_graphiti is performing multiple tasks related to index setup. Consider breaking it down into smaller functions to adhere to the Single Responsibility Principle.
  • Reason this comment was not posted:
    Confidence changes required: 80%
    The code in graphiti.py and main.py is mostly well-structured, but there are some issues to address.
3. graphiti_core/graphiti.py:158
  • Draft comment:
    The comment block for the close method is extensive. Consider making it more concise while retaining essential information.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in graphiti.py and main.py is mostly well-structured, but there are some issues to address.

Workflow ID: wflow_xijkjjhsyULfuLi7


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@paul-paliychuk paul-paliychuk merged commit 2fc1b00 into main Sep 23, 2024
6 checks passed
@paul-paliychuk paul-paliychuk deleted the svc-healthcheck branch September 23, 2024 14:12
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants