Update app.py
Browse files
app.py
CHANGED
@@ -291,8 +291,7 @@ two senior most Judges of the Supreme Court, the Union Minister of
|
|
291 |
Law & Justice, two eminent persons to be nominated by a committee
|
292 |
of the Prime Minister of India, the Chief Justice of India, and the
|
293 |
Leader of the Opposition in the House of the People, or if there is no
|
294 |
-
Leader of the Opposition, then the Leader of the single largest
|
295 |
-
Opposition Party in the House of the People. Secretary (Justice) will
|
296 |
be the Convenor of the Commission.
|
297 |
GRIEVANCES AGAINST JUDICIARY
|
298 |
Department of Justice receives online/off line grievances from public
|
@@ -339,45 +338,35 @@ faq_tool=Tool(
|
|
339 |
func=retrieve_faq,
|
340 |
description="Provides Answers to commonly asked questions related to query keyword(s)"
|
341 |
)
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
If the information is not available in the document, clearly state that and do not make any assumptions.
|
353 |
-
Respond to user queries and engage in conversation to resolve their query.
|
354 |
-
|
355 |
-
Example task: "What is the punishment for theft according to the IPC?"
|
356 |
-
Example response: "According to Section 379 of the IPC, the punishment for theft is imprisonment of either description for a term which may extend to three years, or with fine, or with both."
|
357 |
|
358 |
-
|
|
|
|
|
|
|
|
|
359 |
|
360 |
-
|
361 |
-
|
362 |
-
|
|
|
363 |
""",
|
364 |
-
input_variables=["history", "query"]
|
365 |
)
|
366 |
|
367 |
-
llm = HuggingFaceEndpoint(
|
368 |
-
repo_id="mistralai/Mistral-Nemo-Instruct-2407",
|
369 |
-
task="text-generation",
|
370 |
-
timeout=10
|
371 |
-
)
|
372 |
-
|
373 |
-
|
374 |
-
llm_chain = LLMChain(prompt=prompt, llm=llm)
|
375 |
-
|
376 |
agent_tools = [ipc_tool, crpc_tool, doj_tool, faq_tool]
|
377 |
|
378 |
agent = initialize_agent(
|
379 |
tools=agent_tools,
|
380 |
-
llm=
|
381 |
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
|
382 |
verbose=True,
|
383 |
return_intermediate_steps=True,
|
|
|
291 |
Law & Justice, two eminent persons to be nominated by a committee
|
292 |
of the Prime Minister of India, the Chief Justice of India, and the
|
293 |
Leader of the Opposition in the House of the People, or if there is no
|
294 |
+
Leader of the Opposition, then the Leader of the single largest Opposition Party in the House of the People. Secretary (Justice) will
|
|
|
295 |
be the Convenor of the Commission.
|
296 |
GRIEVANCES AGAINST JUDICIARY
|
297 |
Department of Justice receives online/off line grievances from public
|
|
|
338 |
func=retrieve_faq,
|
339 |
description="Provides Answers to commonly asked questions related to query keyword(s)"
|
340 |
)
|
341 |
+
# Language model setup using Google Gemini
|
342 |
+
llm = ChatGoogleGenerativeAI(
|
343 |
+
model="gemini-1.5-pro",
|
344 |
+
temperature=1,
|
345 |
+
max_tokens=None,
|
346 |
+
timeout=None,
|
347 |
+
max_retries=2,
|
348 |
+
prompt_template="""
|
349 |
+
You are JobAI.You process user input and generate human-like responses to assist with job searching and application processes. Tasks include:
|
350 |
+
(provide links where ever required)
|
|
|
|
|
|
|
|
|
|
|
351 |
|
352 |
+
- Searching for job openings based on user criteria
|
353 |
+
- Providing job descriptions and requirements
|
354 |
+
- Analyzing user resumes and offering suggestions for improvement
|
355 |
+
- Generating cover letters tailored to specific job openings
|
356 |
+
- Offering interview preparation assistance
|
357 |
|
358 |
+
Respond to user queries and engage in conversation to guide them through the job application process. Utilize context and understanding to provide accurate and helpful responses
|
359 |
+
{{history}}
|
360 |
+
User Query: {{query}}
|
361 |
+
|
362 |
""",
|
|
|
363 |
)
|
364 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
agent_tools = [ipc_tool, crpc_tool, doj_tool, faq_tool]
|
366 |
|
367 |
agent = initialize_agent(
|
368 |
tools=agent_tools,
|
369 |
+
llm=llm,
|
370 |
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
|
371 |
verbose=True,
|
372 |
return_intermediate_steps=True,
|