DocUA commited on
Commit
3c799d8
·
1 Parent(s): 22b9505

fix: Add call_spiritual_api method to AIClientManager

Browse files

- Added call_spiritual_api method for spiritual/emotional analysis
- Routes to SpiritualDistressAnalyzer agent configuration
- Fixes 'AIClientManager' object has no attribute 'call_spiritual_api' error

Files changed (1) hide show
  1. src/core/ai_client.py +23 -0
src/core/ai_client.py CHANGED
@@ -399,6 +399,29 @@ class AIClientManager:
399
  def get_all_clients_info(self) -> Dict[str, Dict]:
400
  """Comprehensive client ecosystem status"""
401
  return {name: self.get_client_info(name) for name in self._clients}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
 
403
  # Factory function for easy client creation
404
  def create_ai_client(agent_name: str) -> UniversalAIClient:
 
399
  def get_all_clients_info(self) -> Dict[str, Dict]:
400
  """Comprehensive client ecosystem status"""
401
  return {name: self.get_client_info(name) for name in self._clients}
402
+
403
+ def call_spiritual_api(self, system_prompt: str, user_prompt: str,
404
+ temperature: float = 0.7) -> str:
405
+ """
406
+ Call AI API for spiritual/emotional analysis.
407
+
408
+ Uses the spiritual analyzer agent configuration.
409
+
410
+ Args:
411
+ system_prompt: System prompt for the AI
412
+ user_prompt: User prompt/message to analyze
413
+ temperature: Temperature for response generation
414
+
415
+ Returns:
416
+ AI response as string
417
+ """
418
+ return self.generate_response(
419
+ system_prompt=system_prompt,
420
+ user_prompt=user_prompt,
421
+ temperature=temperature,
422
+ call_type="spiritual_analysis",
423
+ agent_name="SpiritualDistressAnalyzer"
424
+ )
425
 
426
  # Factory function for easy client creation
427
  def create_ai_client(agent_name: str) -> UniversalAIClient: