nikhmr1235 commited on
Commit
938ad4a
·
verified ·
1 Parent(s): 13a6c4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -6,6 +6,8 @@ from dotenv import load_dotenv
6
  from fastapi import FastAPI, Request, HTTPException, Header, status
7
  from pydantic import BaseModel, Field
8
 
 
 
9
  # Load environment variables from .env file
10
  load_dotenv()
11
 
@@ -139,6 +141,14 @@ async def github_webhook(
139
  print(f"Repository Clone URL: {repository_clone_url}")
140
  print(f"PR Title: {pr_title}")
141
  print(f"pr_repo_name: {pr_repo_name} ")
 
 
 
 
 
 
 
 
142
 
143
 
144
  @app.get("/")
 
6
  from fastapi import FastAPI, Request, HTTPException, Header, status
7
  from pydantic import BaseModel, Field
8
 
9
+ from langgraph_pr_review_bot import graph
10
+
11
  # Load environment variables from .env file
12
  load_dotenv()
13
 
 
141
  print(f"Repository Clone URL: {repository_clone_url}")
142
  print(f"PR Title: {pr_title}")
143
  print(f"pr_repo_name: {pr_repo_name} ")
144
+
145
+ initial_state_data = {
146
+ "pr_id": pr_id,
147
+ "repo_name": pr_repo_name,
148
+ }
149
+ initial_state = PRReviewState(**initial_state_data)
150
+ output = graph.invoke(initial_state, config)
151
+ print(f"completed graph execution with result:{output['last_error']}")
152
 
153
 
154
  @app.get("/")