@@ -23,14 +23,14 @@ class PRReviewOutput(BaseModel):
2323 description = "The inline review comments to create on changed lines." )
2424
2525
26- agent = Agent (
26+ _agent = Agent (
2727 name = "Code Review Writer Agent" ,
2828 instructions = PR_CODE_REVIEW_WRITER_SYSTEM_PROMPT ,
2929 output_type = PRReviewOutput
3030)
3131
3232
33- def construct_user_prompt (
33+ def _construct_user_prompt (
3434 sat_summary : str ,
3535 pr_files_context : PullRequestFilesContext ,
3636 structual_questions : Any ,
@@ -64,12 +64,12 @@ def construct_user_prompt(
6464 ),
6565 },
6666 "planned_questions" : {
67- "structural" : to_jsonable (structual_questions ),
68- "convention" : to_jsonable (convention_questions ),
67+ "structural" : _to_jsonable (structual_questions ),
68+ "convention" : _to_jsonable (convention_questions ),
6969 },
7070 "evidence" : {
71- "structural" : to_jsonable (structual_evidence ),
72- "convention" : to_jsonable (conventional_evidence ),
71+ "structural" : _to_jsonable (structual_evidence ),
72+ "convention" : _to_jsonable (conventional_evidence ),
7373 },
7474 }
7575 context_json = json .dumps (prompt_context , ensure_ascii = False , indent = 2 )
@@ -90,7 +90,7 @@ async def generate_code_review_comments(
9090 conventional_evidence ,
9191 pr_ctx : PRReviewContext ,
9292) -> PRReviewOutput :
93- prompt = construct_user_prompt (
93+ prompt = _construct_user_prompt (
9494 sat_summary ,
9595 pr_files_context ,
9696 structual_questions ,
@@ -100,17 +100,17 @@ async def generate_code_review_comments(
100100 pr_ctx ,
101101 )
102102 with trace ("CODE_REVIEW_COMMENTS" ):
103- result = await Runner .run (agent , input = prompt , context = pr_ctx )
103+ result = await Runner .run (_agent , input = prompt , context = pr_ctx )
104104 return result .final_output_as (PRReviewOutput )
105105
106106
107- def to_jsonable (value : Any ) -> Any :
107+ def _to_jsonable (value : Any ) -> Any :
108108 if hasattr (value , "model_dump" ):
109109 return value .model_dump (mode = "json" )
110110 if isinstance (value , list ):
111- return [to_jsonable (item ) for item in value ]
111+ return [_to_jsonable (item ) for item in value ]
112112 if isinstance (value , tuple ):
113- return [to_jsonable (item ) for item in value ]
113+ return [_to_jsonable (item ) for item in value ]
114114 if isinstance (value , dict ):
115- return {key : to_jsonable (item ) for key , item in value .items ()}
115+ return {key : _to_jsonable (item ) for key , item in value .items ()}
116116 return value
0 commit comments