Jayashree Sridhar
commited on
Commit
·
d39c478
1
Parent(s):
d0f6de1
added model_config for pydantic error
Browse files
agents/tools/knowledge_tools.py
CHANGED
|
@@ -8,6 +8,7 @@ from crewai.tools import BaseTool
|
|
| 8 |
class SearchKnowledgeTool(BaseTool):
|
| 9 |
name: str = "search_knowledge"
|
| 10 |
description: str = "Search self-help or spiritual wisdom."
|
|
|
|
| 11 |
#_kp: KnowledgeBase = PrivateAttr()
|
| 12 |
def __init__(self, config=None):
|
| 13 |
super().__init__()
|
|
@@ -19,6 +20,7 @@ class SearchKnowledgeTool(BaseTool):
|
|
| 19 |
class ExtractWisdomTool(BaseTool):
|
| 20 |
name: str = "extract_wisdom"
|
| 21 |
description: str = "Extract most relevant wisdom for a given query."
|
|
|
|
| 22 |
def __init__(self, config=None):
|
| 23 |
super().__init__()
|
| 24 |
def _run(self, search_results: list, user_context: dict):
|
|
@@ -27,6 +29,7 @@ class ExtractWisdomTool(BaseTool):
|
|
| 27 |
class SuggestPracticesTool(BaseTool):
|
| 28 |
name: str = "suggest_practices"
|
| 29 |
description: str = "Recommend meditations or self-care practices."
|
|
|
|
| 30 |
def __init__(self, config=None):
|
| 31 |
super().__init__()
|
| 32 |
def _run(self, emotional_state: str, cultural_context: str = None):
|
|
|
|
| 8 |
class SearchKnowledgeTool(BaseTool):
|
| 9 |
name: str = "search_knowledge"
|
| 10 |
description: str = "Search self-help or spiritual wisdom."
|
| 11 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 12 |
#_kp: KnowledgeBase = PrivateAttr()
|
| 13 |
def __init__(self, config=None):
|
| 14 |
super().__init__()
|
|
|
|
| 20 |
class ExtractWisdomTool(BaseTool):
|
| 21 |
name: str = "extract_wisdom"
|
| 22 |
description: str = "Extract most relevant wisdom for a given query."
|
| 23 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 24 |
def __init__(self, config=None):
|
| 25 |
super().__init__()
|
| 26 |
def _run(self, search_results: list, user_context: dict):
|
|
|
|
| 29 |
class SuggestPracticesTool(BaseTool):
|
| 30 |
name: str = "suggest_practices"
|
| 31 |
description: str = "Recommend meditations or self-care practices."
|
| 32 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 33 |
def __init__(self, config=None):
|
| 34 |
super().__init__()
|
| 35 |
def _run(self, emotional_state: str, cultural_context: str = None):
|
agents/tools/llm_tools.py
CHANGED
|
@@ -8,6 +8,7 @@ from crewai.tools import BaseTool
|
|
| 8 |
class MistralChatTool(BaseTool):
|
| 9 |
name: str = "mistral_chat"
|
| 10 |
description: str = "Generate an empathetic AI chat response."
|
|
|
|
| 11 |
#_model: TinyGPT2Model = PrivateAttr()
|
| 12 |
def __init__(self, config=None):
|
| 13 |
super().__init__()
|
|
@@ -19,6 +20,7 @@ class MistralChatTool(BaseTool):
|
|
| 19 |
class GenerateAdviceTool(BaseTool):
|
| 20 |
name: str = "generate_advice"
|
| 21 |
description: str = "Generate personalized advice."
|
|
|
|
| 22 |
#_model: TinyGPT2Model = PrivateAttr()
|
| 23 |
def __init__(self, config=None):
|
| 24 |
super().__init__()
|
|
@@ -30,6 +32,7 @@ class GenerateAdviceTool(BaseTool):
|
|
| 30 |
class SummarizeConversationTool(BaseTool):
|
| 31 |
name: str = "summarize_conversation"
|
| 32 |
description: str = "Summarize chat with insights and next steps."
|
|
|
|
| 33 |
#_model: TinyGPT2Model = PrivateAttr()
|
| 34 |
def __init__(self, config=None):
|
| 35 |
super().__init__()
|
|
|
|
| 8 |
class MistralChatTool(BaseTool):
|
| 9 |
name: str = "mistral_chat"
|
| 10 |
description: str = "Generate an empathetic AI chat response."
|
| 11 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 12 |
#_model: TinyGPT2Model = PrivateAttr()
|
| 13 |
def __init__(self, config=None):
|
| 14 |
super().__init__()
|
|
|
|
| 20 |
class GenerateAdviceTool(BaseTool):
|
| 21 |
name: str = "generate_advice"
|
| 22 |
description: str = "Generate personalized advice."
|
| 23 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 24 |
#_model: TinyGPT2Model = PrivateAttr()
|
| 25 |
def __init__(self, config=None):
|
| 26 |
super().__init__()
|
|
|
|
| 32 |
class SummarizeConversationTool(BaseTool):
|
| 33 |
name: str = "summarize_conversation"
|
| 34 |
description: str = "Summarize chat with insights and next steps."
|
| 35 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 36 |
#_model: TinyGPT2Model = PrivateAttr()
|
| 37 |
def __init__(self, config=None):
|
| 38 |
super().__init__()
|
agents/tools/validation_tools.py
CHANGED
|
@@ -407,6 +407,7 @@ class ValidationResult:
|
|
| 407 |
class ValidateResponseTool(BaseTool):
|
| 408 |
name: str = "validate_response"
|
| 409 |
description: str = "Validates safety and helpfulness."
|
|
|
|
| 410 |
#_config: object = PrivateAttr()
|
| 411 |
def __init__(self, config=None, **data):
|
| 412 |
super().__init__(**data)
|
|
|
|
| 407 |
class ValidateResponseTool(BaseTool):
|
| 408 |
name: str = "validate_response"
|
| 409 |
description: str = "Validates safety and helpfulness."
|
| 410 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 411 |
#_config: object = PrivateAttr()
|
| 412 |
def __init__(self, config=None, **data):
|
| 413 |
super().__init__(**data)
|
agents/tools/voice_tools.py
CHANGED
|
@@ -52,6 +52,7 @@ class MultilingualVoiceProcessor:
|
|
| 52 |
class TranscribeAudioTool(BaseTool):
|
| 53 |
name: str = "transcribe_audio"
|
| 54 |
description: str = "Transcribe audio to text and detect language."
|
|
|
|
| 55 |
#_vp: MultilingualVoiceProcessor = PrivateAttr()
|
| 56 |
def __init__(self, config=None):
|
| 57 |
super().__init__()
|
|
@@ -63,6 +64,7 @@ class TranscribeAudioTool(BaseTool):
|
|
| 63 |
class DetectEmotionTool(BaseTool):
|
| 64 |
name: str = "detect_emotion"
|
| 65 |
description: str = "Detect the emotional state from text."
|
|
|
|
| 66 |
def __init__(self, config=None):
|
| 67 |
super().__init__()
|
| 68 |
def _run(self, text: str):
|
|
@@ -77,6 +79,7 @@ class DetectEmotionTool(BaseTool):
|
|
| 77 |
class GenerateReflectiveQuestionsTool(BaseTool):
|
| 78 |
name: str = "generate_reflective_questions"
|
| 79 |
description: str = "Generate reflective questions."
|
|
|
|
| 80 |
def __init__(self, config=None):
|
| 81 |
super().__init__()
|
| 82 |
def _run(self, context: dict):
|
|
|
|
| 52 |
class TranscribeAudioTool(BaseTool):
|
| 53 |
name: str = "transcribe_audio"
|
| 54 |
description: str = "Transcribe audio to text and detect language."
|
| 55 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 56 |
#_vp: MultilingualVoiceProcessor = PrivateAttr()
|
| 57 |
def __init__(self, config=None):
|
| 58 |
super().__init__()
|
|
|
|
| 64 |
class DetectEmotionTool(BaseTool):
|
| 65 |
name: str = "detect_emotion"
|
| 66 |
description: str = "Detect the emotional state from text."
|
| 67 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 68 |
def __init__(self, config=None):
|
| 69 |
super().__init__()
|
| 70 |
def _run(self, text: str):
|
|
|
|
| 79 |
class GenerateReflectiveQuestionsTool(BaseTool):
|
| 80 |
name: str = "generate_reflective_questions"
|
| 81 |
description: str = "Generate reflective questions."
|
| 82 |
+
model_config = {"arbitrary_types_allowed": True}
|
| 83 |
def __init__(self, config=None):
|
| 84 |
super().__init__()
|
| 85 |
def _run(self, context: dict):
|