Spaces:
Running
Running
Update eb_agent_module.py
Browse files- eb_agent_module.py +0 -13
eb_agent_module.py
CHANGED
@@ -102,19 +102,6 @@ else:
|
|
102 |
if not GENAI_AVAILABLE:
|
103 |
logging.warning("Google GenAI library not available.")
|
104 |
|
105 |
-
# --- Custom PandasAI Middleware for Better Integration ---
|
106 |
-
class EmployerBrandingMiddleware(BaseMiddleware):
|
107 |
-
"""Custom middleware to enhance PandasAI responses with HR context"""
|
108 |
-
|
109 |
-
def run(self, code: str, **kwargs) -> str:
|
110 |
-
"""Add HR-friendly context to generated code"""
|
111 |
-
# Add comments to make code more understandable
|
112 |
-
enhanced_code = f"""
|
113 |
-
# HR Analytics Query Processing
|
114 |
-
# This code analyzes your LinkedIn employer branding data
|
115 |
-
{code}
|
116 |
-
"""
|
117 |
-
return enhanced_code
|
118 |
|
119 |
# --- Utility function to get DataFrame schema representation ---
|
120 |
def get_df_schema_representation(df: pd.DataFrame, df_name: str) -> str:
|
|
|
102 |
if not GENAI_AVAILABLE:
|
103 |
logging.warning("Google GenAI library not available.")
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
# --- Utility function to get DataFrame schema representation ---
|
107 |
def get_df_schema_representation(df: pd.DataFrame, df_name: str) -> str:
|