Dave67350 commited on
Commit
2c82790
·
verified ·
1 Parent(s): d2fbb8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -17,9 +17,18 @@ class AIRegulationModel:
17
  model_id=model_id
18
  )
19
 
20
- def get_regulation_info(self, query):
21
- response = self.model.generate(prompt=query) # Fix here!
22
- return response if isinstance(response, str) else response.get("generated_text", "No response generated.")
 
 
 
 
 
 
 
 
 
23
 
24
  # Initialize the AI Regulation Tool
25
  ai_regulation_tool = AIRegulationModel()
 
17
  model_id=model_id
18
  )
19
 
20
+ @tool
21
+ def ai_regulation_query_tool(query: str) -> str:
22
+ """Queries an AI model for information on AI regulation.
23
+
24
+ Args:
25
+ query (str): The input question related to AI regulations.
26
+
27
+ Returns:
28
+ str: A relevant response from the AI regulation model.
29
+ """
30
+ return ai_regulation_tool.get_regulation_info(query)
31
+
32
 
33
  # Initialize the AI Regulation Tool
34
  ai_regulation_tool = AIRegulationModel()