conversational-ai-flow
30
总安装量
3
周安装量
#12399
全站排名
安装命令
npx skills add https://github.com/dengineproblem/agents-monorepo --skill conversational-ai-flow
Agent 安装分布
github-copilot
3
amp
2
claude-code
2
kimi-cli
2
gemini-cli
2
Skill 文档
Conversational AI Flow Expert
ÐкÑпеÑÑ Ð¿Ð¾ пÑоекÑиÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¸ ÑеализаÑии поÑоков ÑазговоÑного ÐÐ.
ÐÑновнÑе пÑинÑÐ¸Ð¿Ñ Ð´Ð¸Ð·Ð°Ð¹Ð½Ð°
УпÑавление ÑоÑÑоÑнием
class ConversationState:
def __init__(self):
self.current_intent = None
self.entities = {}
self.conversation_history = []
self.flow_position = "start"
self.confidence_threshold = 0.7
def update_context(self, user_input, intent, entities):
self.conversation_history.append({
"user_input": user_input,
"intent": intent,
"entities": entities
})
self.entities.update(entities)
self.current_intent = intent
ÐаÑÑеÑÐ½Ñ Ð°ÑÑ Ð¸ÑекÑÑÑÑ Ð¿Ð¾Ñоков
ÐаÑÑÑÑÑизаÑÐ¸Ñ Ð½Ð° оÑнове намеÑений
flows:
booking_flow:
entry_conditions:
- intent: "book_appointment"
steps:
- name: "collect_datetime"
prompt: "When would you like to schedule?"
validation: "datetime_validator"
- name: "confirm_booking"
prompt: "Confirm booking on {datetime}?"
actions: ["create_booking", "send_confirmation"]
fallback_flow:
triggers: ["low_confidence", "unknown_intent"]
strategy: "clarification_questions"
ÐаÑÑеÑн Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ ÑлоÑов
def slot_filling_handler(state, required_slots):
missing_slots = [s for s in required_slots if s not in state.entities]
if missing_slots:
return generate_slot_prompt(missing_slots[0], state)
return proceed_to_next_step(state)
ÐбÑабоÑка оÑибок и воÑÑÑановление
ÐÑогÑеÑÑивное ÑаÑкÑÑÑие
class ErrorRecovery:
def handle_misunderstanding(self, state, attempt_count):
strategies = {
1: "I didn't quite catch that. Could you rephrase?",
2: "Let me try differently. Are you looking to: [options]?",
3: "Let me connect you with a human agent."
}
return strategies.get(attempt_count, strategies[3])
ÐенеÑаÑÐ¸Ñ Ð¾ÑвеÑов
ÐонÑекÑÑÑалÑнÑе ÑаблонÑ
class ResponseGenerator:
templates = {
"confirmation": [
"Got it! {summary}. Is that correct?",
"Let me confirm: {summary}. Does this look right?"
],
"progress": [
"Great! We've got {completed}. Next, {next_step}.",
"Perfect! Just need {remaining} and we're done."
]
}
ÐÑлÑÑимодалÑнÑе оÑвеÑÑ
{
"response_type": "rich",
"text": "Here are your options:",
"components": [
{
"type": "quick_replies",
"options": [
{"title": "Schedule Appointment", "payload": "intent:book"},
{"title": "Check Status", "payload": "intent:status"}
]
}
]
}
ÐналиÑика и опÑимизаÑиÑ
def track_flow_metrics(conversation_id, metrics):
return {
"completion_rate": metrics.completed / metrics.started,
"average_turns": metrics.total_turns / metrics.conversations,
"fallback_rate": metrics.fallbacks / metrics.total_turns,
"abandonment_points": identify_drop_off_points(conversation_id)
}
ÐÑÑÑие пÑакÑики
- ÐпÑеделиÑе ÑеÑкÑÑ Ð»Ð¸ÑноÑÑÑ Ð¸ Ñон боÑа
- ÐÑедвоÑÑ Ð¸ÑайÑе поÑÑебноÑÑи полÑзоваÑелей
- ÐÑполÑзÑйÑе ÑезÑме Ð´Ð»Ñ Ð´Ð»Ð¸Ð½Ð½ÑÑ Ð´Ð¸Ð°Ð»Ð¾Ð³Ð¾Ð²
- ТеÑÑиÑÑйÑе вÑе пÑÑи и edge cases
- ÐониÑоÑÑÑе ÑеалÑнÑе ÑазговоÑÑ Ð´Ð»Ñ ÑлÑÑÑениÑ