Skip to content

Commit a04188a

Browse files
committed
🩹 Add black format
1 parent 6ca43e0 commit a04188a

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/vuegen/report.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,9 @@ def __init__(
565565
# but we'll include it here if needed for values from a config file
566566
self.request_body = request_body or {}
567567

568-
def make_api_request(self, dynamic_request_body: Optional[dict] = None) -> Optional[dict]:
568+
def make_api_request(
569+
self, dynamic_request_body: Optional[dict] = None
570+
) -> Optional[dict]:
569571
"""
570572
Sends an HTTP request to the specified API and returns the JSON response.
571573
It allows overriding the request body dynamically.
@@ -581,7 +583,11 @@ def make_api_request(self, dynamic_request_body: Optional[dict] = None) -> Optio
581583
response : Optional[dict]
582584
The JSON response from the API, or None if the request fails.
583585
"""
584-
request_body_to_send = dynamic_request_body if dynamic_request_body is not None else self.request_body
586+
request_body_to_send = (
587+
dynamic_request_body
588+
if dynamic_request_body is not None
589+
else self.request_body
590+
)
585591
try:
586592
self.logger.info(f"Making {self.method} request to API: {self.api_url}")
587593
self.logger.debug(f"Headers: {self.headers}")
@@ -593,7 +599,11 @@ def make_api_request(self, dynamic_request_body: Optional[dict] = None) -> Optio
593599
headers=self.headers,
594600
params=self.params,
595601
# Validate the request body based on the method
596-
json=request_body_to_send if self.method in ["POST", "PUT", "PATCH"] and request_body_to_send else None,
602+
json=(
603+
request_body_to_send
604+
if self.method in ["POST", "PUT", "PATCH"] and request_body_to_send
605+
else None
606+
),
597607
)
598608
response.raise_for_status()
599609
self.logger.info(
@@ -643,7 +653,7 @@ def __init__(
643653
title=title,
644654
logger=logger,
645655
api_url=api_url,
646-
method = "POST",
656+
method="POST",
647657
caption=None,
648658
headers=headers,
649659
params=params,

src/vuegen/streamlit_reportview.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def _generate_apicall_content(self, apicall) -> List[str]:
859859
f"Successfully generated content for APICall '{apicall.title}' using method '{apicall.method}'"
860860
)
861861
return apicall_content
862-
862+
863863
def _generate_chatbot_content(self, chatbot) -> List[str]:
864864
"""
865865
Generate content for a ChatBot component, supporting both standard and Ollama-style APIs.
@@ -883,7 +883,7 @@ def _generate_chatbot_content(self, chatbot) -> List[str]:
883883
)
884884
)
885885

886-
# --- Shared code blocks (as strings) ---
886+
# --- Shared code blocks (as strings) ---
887887
init_messages_block = """
888888
# Init session state
889889
if 'messages' not in st.session_state:

0 commit comments

Comments
 (0)