Jayashree Sridhar
commited on
Commit
·
d10818d
1
Parent(s):
17cf6ab
included process func in crew_config.py
Browse files- crew_config.py +24 -1
crew_config.py
CHANGED
|
@@ -70,4 +70,27 @@ class PersonalCoachCrew:
|
|
| 70 |
tools=[
|
| 71 |
self.llm_tools.summarize_conversation,
|
| 72 |
]
|
| 73 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
tools=[
|
| 71 |
self.llm_tools.summarize_conversation,
|
| 72 |
]
|
| 73 |
+
)
|
| 74 |
+
def process(self, inputs: dict):
|
| 75 |
+
"""
|
| 76 |
+
Orchestrates conversation:
|
| 77 |
+
1. conversation_handler gets initial message
|
| 78 |
+
2. wisdom_advisor enriches/advises
|
| 79 |
+
3. validator checks response
|
| 80 |
+
4. (optionally) interaction_manager tweaks flow/summary
|
| 81 |
+
Returns dict with 'final_response' (name matches app.py usage)
|
| 82 |
+
"""
|
| 83 |
+
# 1. Empathetic dialog
|
| 84 |
+
conversation_response = self.conversation_handler.run(inputs)
|
| 85 |
+
# 2. Wisdom/advice
|
| 86 |
+
wisdom_response = self.wisdom_advisor.run(inputs)
|
| 87 |
+
# (You may mix/compose these based on your agent logic)
|
| 88 |
+
combined_response = f"{conversation_response}\n{wisdom_response}"
|
| 89 |
+
# 3. Validate response
|
| 90 |
+
validator_result = self.response_validator.run({'response': combined_response})
|
| 91 |
+
|
| 92 |
+
# You may want to use a more sophisticated process (context, better merging, etc)
|
| 93 |
+
# For MVP, just return this:
|
| 94 |
+
return {
|
| 95 |
+
"final_response": combined_response
|
| 96 |
+
}
|