letschatty 0.4.331__tar.gz → 0.4.333__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {letschatty-0.4.331 → letschatty-0.4.333}/PKG-INFO +1 -1
- {letschatty-0.4.331 → letschatty-0.4.333}/pyproject.toml +1 -1
- letschatty-0.4.333/src/letschatty/models/ai_microservices/__init__.py +10 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/ai_microservices/expected_output.py +29 -2
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/ai_microservices/lambda_events.py +137 -28
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/ai_microservices/lambda_invokation_types.py +3 -1
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/ai_microservices/n8n_ai_agents_payload.py +3 -1
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/__init__.py +2 -1
- letschatty-0.4.333/src/letschatty/models/analytics/events/chat_based_events/ai_agent_execution_event.py +71 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/company_based_events/asset_events.py +0 -3
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/event_type_to_classes.py +0 -4
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/event_types.py +45 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/ai_agents_decision_output.py +1 -1
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_agent_in_chat.py +4 -1
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_mode.py +2 -2
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/get_chat_with_prompt_response.py +1 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/pre_qualify_config.py +14 -2
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/automation.py +18 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/data_base/collection_interface.py +101 -29
- letschatty-0.4.333/src/letschatty/models/data_base/mongo_connection.py +118 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_document.py +2 -4
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_media.py +3 -4
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/custom_exceptions/custom_exceptions.py +14 -1
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/smart_follow_up_context_builder_v2.py +5 -2
- letschatty-0.4.333/src/letschatty/services/chatty_assets/__init__.py +14 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/asset_service.py +260 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/assets_collections.py +137 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chatty_assets/base_container.py +3 -2
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chatty_assets/base_container_with_collection.py +35 -26
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/__init__.py +38 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/ai_agent_collection.py +19 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/ai_agent_in_chat_collection.py +32 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/ai_component_collection.py +21 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/chain_of_thought_collection.py +30 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/chat_collection.py +21 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/contact_point_collection.py +21 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/fast_answer_collection.py +21 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/filter_criteria_collection.py +18 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/flow_collection.py +20 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/product_collection.py +20 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/sale_collection.py +20 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/source_collection.py +21 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/tag_collection.py +19 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/topic_collection.py +21 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/collections/user_collection.py +20 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/example_usage.py +44 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/__init__.py +37 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/ai_agent_in_chat_service.py +73 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/ai_agent_service.py +23 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/chain_of_thought_service.py +70 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/chat_service.py +25 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/contact_point_service.py +29 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/fast_answer_service.py +32 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/filter_criteria_service.py +30 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/flow_service.py +25 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/product_service.py +30 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/sale_service.py +25 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/source_service.py +28 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/tag_service.py +32 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/topic_service.py +31 -0
- letschatty-0.4.333/src/letschatty/services/chatty_assets/services/user_service.py +32 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/continuous_conversation_service/continuous_conversation_helper.py +11 -0
- letschatty-0.4.333/src/letschatty/services/events/__init__.py +6 -0
- letschatty-0.4.333/src/letschatty/services/events/events_manager.py +219 -0
- letschatty-0.4.333/src/letschatty/services/factories/analytics/ai_agent_event_factory.py +161 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/analytics/events_factory.py +63 -1
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/lambda_ai_orchestrartor/lambda_events_factory.py +25 -8
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/messages_helpers/get_caption_or_body_or_preview.py +6 -4
- letschatty-0.4.331/src/letschatty/models/ai_microservices/__init__.py +0 -10
- letschatty-0.4.331/src/letschatty/models/data_base/mongo_connection.py +0 -35
- letschatty-0.4.331/src/letschatty/services/chatty_assets/__init__.py +0 -2
- letschatty-0.4.331/src/letschatty/services/chatty_assets/asset_service.py +0 -83
- letschatty-0.4.331/src/letschatty/services/events/events_manager.py +0 -2
- {letschatty-0.4.331 → letschatty-0.4.333}/LICENSE +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/README.md +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/ai_microservices/openai_payloads.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/base.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/ai_agent_chat.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/business_area.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/chat_based_event.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/chat_context.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/chat_funnel.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/chat_status.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/contact_point.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/continuous_conversation.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/highlight.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/message.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/messages_intent_context.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/product_chat.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/quality_scoring.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/sale.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/tag_chat.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/chat_based_events/workflow.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/company_based_events/company_events.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/company_based_events/user_events.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/metrics/__init_.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/metrics/daily_contact_points.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/metrics/daily_new_chats.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/metrics/daily_sent_templates_grouped.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/metrics/sales_roadmap.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/metrics/sent_templates.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/smart_messages/friendly_code_for_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/smart_messages/topic.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/smart_messages/topic_message.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/google_ad_utm_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/helpers.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/other_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/pure_ad.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/pure_ad_utm_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/source_base.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/template_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/topic_default_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/utm_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/utms/referer_info.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/utms/utm_query_params.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/sources/whatsapp_default_source.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/auth/jwt.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/ai_agent_component.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/chatty_asset_model.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/helpers.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/related_asset_usage_example.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/singleton.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/update_model_interface.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/base_models/validate_timestamps_and_id.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/channels/channel.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/assets_assigned_to_chat.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/chat.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/chat_status_modifications.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/chat_with_assets.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/client.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/continuous_conversation.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/filter_parameters.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/flow_link_state.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/highlight.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/preview.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/quality_scoring.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/scheduled_messages.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/temporary_chat.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/chat/time_left.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/CRM/business_area.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/CRM/funnel.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/ai_agent_message_draft.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/chain_of_thought_in_chat.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/chat_example.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/chat_example_test.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_agent.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_agent_config_for_automation.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/context_item.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/faq.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/follow_up_strategy.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/knowleadge_base_components.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/n8n_agents_info.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/n8n_schema_incoming_message_output.json +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/ai_agents_v2/n8n_schema_smart_follow_up_output.json +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/assignment/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/assignment/assignment_assets.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/chat_assets.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/chatty_fast_answers/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/chatty_fast_answers/chatty_fast_answer.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/company_assets.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/contact_point.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/filter_criteria.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/flow.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/launch/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/launch/launch.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/launch/scheduled_communication.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/launch/subscription.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/media/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/media/file.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/product.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/sale.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/tag.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/users/agent_chats_snapshot.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/users/user.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/users/user_asset_permission.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/workflow_execution.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/company_chats_snapshot.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/company_messaging_settgins.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/conversation_topic.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/empresa.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/form_field.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/insight.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/notifications/notification.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/copilot/links.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/data_base/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/execution/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/execution/execution.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/execution/executor.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/forms/company/auth0_company_registration_form.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/forms/company/meta_register.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/audio.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/base/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/base/chatty_message_json.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/base/message_base.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/base/message_draft.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/button.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/central_notification.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/contact.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/document.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/image.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/interactive.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/location.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/reaction.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_audio.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_button.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_central.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_contacts.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_image.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_interactive.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_location.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_reaction.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_sticker.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_text.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_video.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_context/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_context/chatty_context.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_referal/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/schema/chatty_referal/chatty_referal.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/sticker.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/text.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/chatty_messages/video.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/message_templates/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/message_templates/chatty_template_campaign.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/message_templates/filled_data_from_frontend.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/message_templates/payload_for_sending_template.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/message_templates/raw_meta_template.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/message_templates/recipient_of_template_campaign.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/message_templates/required_for_frontend_templates.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/meta_base_notification_json.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/meta_error_json.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/meta_inexistent_json.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/meta_message_json.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/meta_status_json.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/meta_unknown_json.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/button_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/contacts_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/interactive_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/location_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/multimedia_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/order_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/reaction_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/system_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/content_messages/text_content.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/values/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/values/value_errors.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/values/value_messages.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/messages/meta_message_model/schema/values/value_statuses.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/custom_exceptions/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/definitions.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/CRUD_operations.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/channel_types.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/chats_actions.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/country.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/deletion_type.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/executor_types.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/identifier.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/message_status_types.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/message_types.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/phone_number.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/serializer_type.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/source_types.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/utils/types/typealiases.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/context_builder_v2.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/cot_follow_up_examples.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/followup_schema.json +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/smart_follow_up_service_v2.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/tool_descriptions/assign_chat_to_ai_agent_itself.json +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/tool_descriptions/human_handover.json +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_agents/tool_descriptions.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/ai_components_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chat/chat_extractors.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chat/chat_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chat/client_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chat/conversation_topics_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chatty_assets/documentation_diagram.png +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/chatty_assets/readme.md +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/concurrent/concurrent.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/contact_points/contact_point_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/analytics/contact_point_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/analytics/smart_messages/topics_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/analytics/sources/helpers.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/analytics/sources/source_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/chats/chat_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/chatty_fast_answers/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/chatty_fast_answers/chatty_fast_answers_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/clients/client_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/company/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/company/empresa_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/central_notification_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/chatty_message_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/child_db_message_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/child_request_message.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/from_template_hot_fix.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/message_templates/template_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/messages/message_templates/test.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/meta_notifications/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/meta_notifications/meta_notification_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/factories/product_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/filter_criteria_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/messages_helpers/__init__.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/scheduled_messages_service/scheduled_messages_helpers.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/template_campaigns/template_campaign_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/users/agent_service.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/users/user_factory.py +0 -0
- {letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/services/validators/analytics_validator.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "letschatty"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.333" # Or whichever is your latest version
|
|
4
4
|
description = "Models and custom classes to work across the Chattyverse"
|
|
5
5
|
authors = ["Axel <axel@letschatty.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from .expected_output import ExpectedOutputQualityTest, ExpectedOutputSmartTag
|
|
2
|
+
from .lambda_events import (
|
|
3
|
+
IncomingMessageAIDecision, QualityTestCallbackEvent, SmartTaggingCallbackEvent,
|
|
4
|
+
QualityTestInteractionCallbackEvent, QualityTestEvent,
|
|
5
|
+
AllQualityTestEvent, SmartTaggingEvent, QualityTestEventData, AllQualityTestEventData,ChatData,
|
|
6
|
+
ComparisonAnalysisCallbackMetadata, InteractionCallbackMetadata, SmartTaggingCallbackMetadata,
|
|
7
|
+
SmartTaggingPromptEvent
|
|
8
|
+
)
|
|
9
|
+
from .lambda_invokation_types import InvokationType, LambdaAiEvent
|
|
10
|
+
from .openai_payloads import OpenaiPayload, N8nPayload
|
{letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/ai_microservices/expected_output.py
RENAMED
|
@@ -6,9 +6,10 @@ from typing import List, Optional, Literal
|
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
|
|
8
8
|
from letschatty.models.utils.types.message_types import MessageType
|
|
9
|
-
from ...models.company.assets.ai_agents_v2.ai_agents_decision_output import ChainOfThoughtInChatRequest, IncomingMessageAIDecision, IncomingMessageDecisionAction
|
|
9
|
+
from ...models.company.assets.ai_agents_v2.ai_agents_decision_output import ChainOfThoughtInChatRequest, IncomingMessageAIDecision, IncomingMessageDecisionAction, SmartFollowUpDecision, SmartFollowUpDecisionAction
|
|
10
10
|
from ...models.company.assets.automation import Automation
|
|
11
11
|
from ...models.company.form_field import CollectedData
|
|
12
|
+
from ...models.chat.chat import Area
|
|
12
13
|
|
|
13
14
|
class ExpectedOutputQualityTest(BaseModel):
|
|
14
15
|
accuracy: float = Field(description="The accuracy of the comparison analysis")
|
|
@@ -194,4 +195,30 @@ class ExpectedOutputIncomingMessage(BaseModel):
|
|
|
194
195
|
|
|
195
196
|
|
|
196
197
|
class ExpectedOutputSmartFollowUp(BaseModel):
|
|
197
|
-
action:
|
|
198
|
+
action: SmartFollowUpDecisionAction
|
|
199
|
+
messages: List[str] = Field(description="Array of message strings to send to the customer. Required for send/suggest actions, optional for escalate action, empty array for skip/remove/postpone actions.")
|
|
200
|
+
chain_of_thought: ChainOfThoughtInChatRequest = Field(description="REQUIRED: Your reasoning process and response decision explanation")
|
|
201
|
+
next_call_time: Optional[datetime] = Field(default=None, description="The next call time for the smart follow up (required for postpone_delta_time action)")
|
|
202
|
+
reason: Optional[str] = Field(default=None, description="Reason for the decision (especially for postpone/postponed actions)")
|
|
203
|
+
area: Optional[Area] = Field(default=None, description="The area to move the chat after the decision")
|
|
204
|
+
|
|
205
|
+
def to_smart_follow_up_decision_output(self) -> SmartFollowUpDecision:
|
|
206
|
+
messages_drafts = [
|
|
207
|
+
MessageDraft(
|
|
208
|
+
type=MessageType.TEXT,
|
|
209
|
+
content=ChattyContentText(body=message),
|
|
210
|
+
is_incoming_message=False
|
|
211
|
+
)
|
|
212
|
+
for message in self.messages
|
|
213
|
+
]
|
|
214
|
+
smart_follow_up_decision = SmartFollowUpDecision(
|
|
215
|
+
action=self.action,
|
|
216
|
+
next_call_time=self.next_call_time,
|
|
217
|
+
messages=messages_drafts,
|
|
218
|
+
chain_of_thought=self.chain_of_thought,
|
|
219
|
+
reason=self.reason,
|
|
220
|
+
area=self.area
|
|
221
|
+
)
|
|
222
|
+
return smart_follow_up_decision
|
|
223
|
+
|
|
224
|
+
|
{letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/ai_microservices/lambda_events.py
RENAMED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
from letschatty.models.company.assets.ai_agents_v2.chatty_ai_agent_in_chat import HumanInterventionReason
|
|
1
2
|
from letschatty.models.company.assets.chat_assets import ChainOfThoughtInChatTrigger
|
|
2
3
|
from pydantic import BaseModel, Field, model_validator
|
|
3
|
-
from typing import Dict, Any, List, Optional
|
|
4
|
+
from typing import Dict, Any, List, Optional, TYPE_CHECKING
|
|
4
5
|
|
|
5
6
|
from letschatty.models.base_models.ai_agent_component import AiAgentComponentType
|
|
6
7
|
from letschatty.models.utils.types.identifier import StrObjectId
|
|
7
8
|
from .lambda_invokation_types import InvokationType, LambdaAiEvent
|
|
8
|
-
from .expected_output import ExpectedOutputIncomingMessage, ExpectedOutputSmartTag, ExpectedOutputQualityTest,
|
|
9
|
-
from ...models.company.assets.ai_agents_v2.ai_agents_decision_output import IncomingMessageDecisionAction
|
|
10
|
-
from ...models.company.assets.ai_agents_v2.chatty_ai_agent_in_chat import HumanInterventionReason
|
|
9
|
+
from .expected_output import ExpectedOutputIncomingMessage, ExpectedOutputSmartFollowUp, ExpectedOutputSmartTag, ExpectedOutputQualityTest, IncomingMessageAIDecision
|
|
10
|
+
from ...models.company.assets.ai_agents_v2.ai_agents_decision_output import IncomingMessageDecisionAction, SmartFollowUpDecision
|
|
11
11
|
|
|
12
12
|
class SmartTaggingCallbackMetadata(BaseModel):
|
|
13
13
|
chat_id: StrObjectId
|
|
14
14
|
company_id: StrObjectId
|
|
15
|
+
trigger: ChainOfThoughtInChatTrigger
|
|
15
16
|
|
|
16
17
|
class ComparisonAnalysisCallbackMetadata(BaseModel):
|
|
17
18
|
test_case_id: StrObjectId
|
|
@@ -23,21 +24,8 @@ class InteractionCallbackMetadata(BaseModel):
|
|
|
23
24
|
ai_agent_id: StrObjectId
|
|
24
25
|
company_id: StrObjectId
|
|
25
26
|
interaction_index: int
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
chat_id: StrObjectId
|
|
29
|
-
company_id: StrObjectId
|
|
30
|
-
ai_agent_id: StrObjectId
|
|
31
|
-
cot_id: StrObjectId
|
|
32
|
-
trigger: str
|
|
33
|
-
# Trigger info is in: incoming_message_ids for user_message,
|
|
34
|
-
# triggered_by_user_id for manual_trigger, smart_follow_up_id for follow_up
|
|
35
|
-
triggered_by_user_id: Optional[StrObjectId] = None
|
|
36
|
-
|
|
37
|
-
class IncomingMessageCallbackEvent(LambdaAiEvent):
|
|
38
|
-
type: InvokationType = InvokationType.INCOMING_MESSAGE_CALLBACK
|
|
39
|
-
data: IncomingMessageAIDecision
|
|
40
|
-
callback_metadata: IncomingMessageCallbackMetadata
|
|
27
|
+
trigger: ChainOfThoughtInChatTrigger
|
|
28
|
+
chain_of_thought_id: StrObjectId
|
|
41
29
|
|
|
42
30
|
class QualityTestCallbackEvent(LambdaAiEvent):
|
|
43
31
|
type: InvokationType = InvokationType.SINGLE_QUALITY_TEST_CALLBACK
|
|
@@ -55,6 +43,50 @@ class QualityTestInteractionCallbackEvent(LambdaAiEvent):
|
|
|
55
43
|
data["data"]["chain_of_thought"]["chatty_ai_agent_id"] = data["callback_metadata"]["ai_agent_id"]
|
|
56
44
|
return data
|
|
57
45
|
|
|
46
|
+
@model_validator(mode="before")
|
|
47
|
+
@classmethod
|
|
48
|
+
def set_chain_of_thought_id(cls, values: Dict[str, Any]):
|
|
49
|
+
"""
|
|
50
|
+
Get the chain_of_thought_id from callback_metadata and set it in data.chain_of_thought.id
|
|
51
|
+
|
|
52
|
+
Handles both cases:
|
|
53
|
+
- data is a JSON string (needs parsing)
|
|
54
|
+
- data is already a dict
|
|
55
|
+
"""
|
|
56
|
+
import json
|
|
57
|
+
|
|
58
|
+
data = values.get("data")
|
|
59
|
+
callback_metadata = values.get("callback_metadata")
|
|
60
|
+
|
|
61
|
+
if not data or not callback_metadata:
|
|
62
|
+
return values
|
|
63
|
+
|
|
64
|
+
# Get chain_of_thought_id from callback_metadata (could be dict or object)
|
|
65
|
+
if isinstance(callback_metadata, dict):
|
|
66
|
+
chain_of_thought_id = callback_metadata.get("chain_of_thought_id")
|
|
67
|
+
else:
|
|
68
|
+
chain_of_thought_id = getattr(callback_metadata, "chain_of_thought_id", None)
|
|
69
|
+
|
|
70
|
+
if not chain_of_thought_id:
|
|
71
|
+
return values
|
|
72
|
+
|
|
73
|
+
# Parse data if it's a JSON string
|
|
74
|
+
if isinstance(data, str):
|
|
75
|
+
try:
|
|
76
|
+
data = json.loads(data)
|
|
77
|
+
values["data"] = data
|
|
78
|
+
except (json.JSONDecodeError, TypeError):
|
|
79
|
+
return values
|
|
80
|
+
|
|
81
|
+
# If data is a dict, set the id in chain_of_thought
|
|
82
|
+
if isinstance(data, dict):
|
|
83
|
+
chain_of_thought = data.get("chain_of_thought")
|
|
84
|
+
if isinstance(chain_of_thought, dict):
|
|
85
|
+
chain_of_thought["id"] = chain_of_thought_id
|
|
86
|
+
|
|
87
|
+
return values
|
|
88
|
+
|
|
89
|
+
|
|
58
90
|
class SmartTaggingCallbackEvent(LambdaAiEvent):
|
|
59
91
|
type: InvokationType = InvokationType.SMART_TAGGING_CALLBACK
|
|
60
92
|
data: ExpectedOutputSmartTag
|
|
@@ -136,11 +168,9 @@ class DoubleCheckerCallbackMetadata(BaseModel):
|
|
|
136
168
|
company_id: StrObjectId
|
|
137
169
|
ai_agent_id: StrObjectId
|
|
138
170
|
incoming_messages_ids: List[str]
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
# triggered_by_user_id for manual_trigger, smart_follow_up_id for follow_up
|
|
143
|
-
triggered_by_user_id: Optional[StrObjectId] = None
|
|
171
|
+
trigger: ChainOfThoughtInChatTrigger
|
|
172
|
+
chain_of_thought_id: StrObjectId
|
|
173
|
+
|
|
144
174
|
|
|
145
175
|
class DoubleCheckerForIncomingMessagesAnswerEvent(LambdaAiEvent):
|
|
146
176
|
type: InvokationType = InvokationType.DOUBLE_CHECKER_FOR_INCOMING_MESSAGES_ANSWER
|
|
@@ -148,13 +178,73 @@ class DoubleCheckerForIncomingMessagesAnswerEvent(LambdaAiEvent):
|
|
|
148
178
|
|
|
149
179
|
class DoubleCheckerForIncomingMessagesAnswerCallbackEvent(LambdaAiEvent):
|
|
150
180
|
type: InvokationType = InvokationType.DOUBLE_CHECKER_FOR_INCOMING_MESSAGES_ANSWER_CALLBACK
|
|
151
|
-
data:
|
|
181
|
+
data: ExpectedOutputIncomingMessage
|
|
152
182
|
callback_metadata: DoubleCheckerCallbackMetadata
|
|
153
183
|
|
|
154
|
-
|
|
184
|
+
@model_validator(mode="before")
|
|
185
|
+
@classmethod
|
|
186
|
+
def set_chain_of_thought_id(cls, values: Dict[str, Any]):
|
|
187
|
+
"""
|
|
188
|
+
Get the chain_of_thought_id from callback_metadata and set it in data.chain_of_thought.id
|
|
189
|
+
|
|
190
|
+
Handles both cases:
|
|
191
|
+
- data is a JSON string (needs parsing)
|
|
192
|
+
- data is already a dict
|
|
193
|
+
"""
|
|
194
|
+
import json
|
|
195
|
+
|
|
196
|
+
data = values.get("data")
|
|
197
|
+
callback_metadata = values.get("callback_metadata")
|
|
198
|
+
|
|
199
|
+
if not data or not callback_metadata:
|
|
200
|
+
return values
|
|
201
|
+
|
|
202
|
+
# Get chain_of_thought_id from callback_metadata (could be dict or object)
|
|
203
|
+
if isinstance(callback_metadata, dict):
|
|
204
|
+
chain_of_thought_id = callback_metadata.get("chain_of_thought_id")
|
|
205
|
+
else:
|
|
206
|
+
chain_of_thought_id = getattr(callback_metadata, "chain_of_thought_id", None)
|
|
207
|
+
|
|
208
|
+
if not chain_of_thought_id:
|
|
209
|
+
return values
|
|
210
|
+
|
|
211
|
+
# Parse data if it's a JSON string
|
|
212
|
+
if isinstance(data, str):
|
|
213
|
+
try:
|
|
214
|
+
data = json.loads(data)
|
|
215
|
+
values["data"] = data
|
|
216
|
+
except (json.JSONDecodeError, TypeError):
|
|
217
|
+
return values
|
|
218
|
+
|
|
219
|
+
# If data is a dict, set the id in chain_of_thought
|
|
220
|
+
if isinstance(data, dict):
|
|
221
|
+
chain_of_thought = data.get("chain_of_thought")
|
|
222
|
+
if isinstance(chain_of_thought, dict):
|
|
223
|
+
chain_of_thought["id"] = chain_of_thought_id
|
|
224
|
+
|
|
225
|
+
return values
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
# Smart Follow-Up Decision Output Events
|
|
230
|
+
|
|
231
|
+
class SmartFollowUpDecisionOutputData(BaseModel):
|
|
232
|
+
"""Data for smart follow-up decision output"""
|
|
155
233
|
chat_id: StrObjectId
|
|
156
234
|
company_id: StrObjectId
|
|
157
235
|
ai_agent_id: StrObjectId
|
|
236
|
+
smart_follow_up_output: ExpectedOutputSmartFollowUp
|
|
237
|
+
smart_follow_up_id: Optional[StrObjectId] = None
|
|
238
|
+
|
|
239
|
+
class SmartFollowUpDecisionOutputEvent(LambdaAiEvent):
|
|
240
|
+
"""
|
|
241
|
+
Event for smart follow-up decision output.
|
|
242
|
+
|
|
243
|
+
Similar to incoming message decision but for follow-ups.
|
|
244
|
+
Bypasses double checker and sends directly to API.
|
|
245
|
+
"""
|
|
246
|
+
type: InvokationType = InvokationType.SMART_FOLLOW_UP_DECISION_OUTPUT
|
|
247
|
+
data: SmartFollowUpDecisionOutputData
|
|
158
248
|
|
|
159
249
|
|
|
160
250
|
# New AI Agent Context Building Events (for new architecture)
|
|
@@ -189,7 +279,7 @@ class GetChatWithPromptForFollowUpEventData(BaseModel):
|
|
|
189
279
|
"""Data for get chat with prompt for follow-up event"""
|
|
190
280
|
chat_id: StrObjectId
|
|
191
281
|
company_id: StrObjectId
|
|
192
|
-
smart_follow_up_id: StrObjectId
|
|
282
|
+
smart_follow_up_id: Optional[StrObjectId] = Field(default=None, description="Smart follow-up ID")
|
|
193
283
|
# Trigger information
|
|
194
284
|
trigger: ChainOfThoughtInChatTrigger
|
|
195
285
|
# trigger_id is derived from: smart_follow_up_id
|
|
@@ -309,7 +399,8 @@ class EscalateAIAgentInChatEventData(BaseModel):
|
|
|
309
399
|
"""Data for escalating an AI agent (requiring human intervention)"""
|
|
310
400
|
chat_id: StrObjectId
|
|
311
401
|
company_id: StrObjectId
|
|
312
|
-
reason:
|
|
402
|
+
reason: HumanInterventionReason = Field(description="Reason for escalation", default=HumanInterventionReason.SOMETHING_WENT_WRONG)
|
|
403
|
+
message: Optional[str] = Field(default="El agente de IA requiere de tu intervención", description="The message to display to the user if any")
|
|
313
404
|
|
|
314
405
|
|
|
315
406
|
class EscalateAIAgentInChatEvent(LambdaAiEvent):
|
|
@@ -341,6 +432,24 @@ class UnescalateAIAgentInChatEvent(LambdaAiEvent):
|
|
|
341
432
|
data: UnescalateAIAgentInChatEventData
|
|
342
433
|
|
|
343
434
|
|
|
435
|
+
|
|
436
|
+
class GetChainOfThoughtsByChatIdEventData(BaseModel):
|
|
437
|
+
"""Data for getting chain of thoughts by chat ID"""
|
|
438
|
+
chat_id: StrObjectId
|
|
439
|
+
company_id: StrObjectId
|
|
440
|
+
skip: int = Field(default=0, description="Number of results to skip for pagination")
|
|
441
|
+
limit: int = Field(default=10, description="Number of results to return")
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
class GetChainOfThoughtsByChatIdEvent(LambdaAiEvent):
|
|
445
|
+
"""
|
|
446
|
+
Event to get chain of thoughts for a chat.
|
|
447
|
+
|
|
448
|
+
Returns a list of chain of thoughts associated with the given chat ID,
|
|
449
|
+
sorted by created_at (newest first), with pagination support via skip.
|
|
450
|
+
"""
|
|
451
|
+
type: InvokationType = InvokationType.GET_CHAIN_OF_THOUGHTS_BY_CHAT_ID
|
|
452
|
+
data: GetChainOfThoughtsByChatIdEventData
|
|
344
453
|
# Launch Events
|
|
345
454
|
|
|
346
455
|
class LaunchCommunicationEventData(BaseModel):
|
|
@@ -11,13 +11,14 @@ class InvokationType(StrEnum):
|
|
|
11
11
|
SMART_TAGGING_PROMPT = "smart_tagging_prompt"
|
|
12
12
|
QUALITY_TEST_INTERACTION = "quality_test_interaction"
|
|
13
13
|
# Callback-specific types
|
|
14
|
-
INCOMING_MESSAGE_CALLBACK = "incoming_message_callback"
|
|
15
14
|
SINGLE_QUALITY_TEST_CALLBACK = "single_quality_test_callback"
|
|
16
15
|
SMART_TAGGING_CALLBACK = "smart_tagging_callback"
|
|
17
16
|
QUALITY_TESTS_FOR_UPDATED_AI_COMPONENT = "quality_tests_for_updated_ai_component"
|
|
18
17
|
FIX_BUGGED_AI_AGENTS_CALLS_IN_CHATS = "fix_bugged_ai_agents_calls_in_chats"
|
|
19
18
|
DOUBLE_CHECKER_FOR_INCOMING_MESSAGES_ANSWER = "double_checker_for_incoming_messages_answer"
|
|
20
19
|
DOUBLE_CHECKER_FOR_INCOMING_MESSAGES_ANSWER_CALLBACK = "double_checker_for_incoming_messages_answer_callback"
|
|
20
|
+
# Decision output events
|
|
21
|
+
SMART_FOLLOW_UP_DECISION_OUTPUT = "smart_follow_up_decision_output"
|
|
21
22
|
# AI Agent context building events (new architecture)
|
|
22
23
|
GET_CHAT_WITH_PROMPT_INCOMING_MESSAGE = "get_chat_with_prompt_incoming_message"
|
|
23
24
|
GET_CHAT_WITH_PROMPT_FOLLOW_UP = "get_chat_with_prompt_follow_up"
|
|
@@ -30,6 +31,7 @@ class InvokationType(StrEnum):
|
|
|
30
31
|
UPDATE_AI_AGENT_MODE_IN_CHAT = "update_ai_agent_mode_in_chat"
|
|
31
32
|
ESCALATE_AI_AGENT_IN_CHAT = "escalate_ai_agent_in_chat"
|
|
32
33
|
UNESCALATE_AI_AGENT_IN_CHAT = "unescalate_ai_agent_in_chat"
|
|
34
|
+
GET_CHAIN_OF_THOUGHTS_BY_CHAT_ID = "get_chain_of_thoughts_by_chat_id"
|
|
33
35
|
# Launch events
|
|
34
36
|
LAUNCH_COMMUNICATION = "launch_communication"
|
|
35
37
|
LAUNCH_WELCOME_KIT = "launch_welcome_kit"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from letschatty.models.company.assets.chat_assets import ChainOfThoughtInChatTrigger
|
|
1
2
|
from pydantic import BaseModel, Field
|
|
2
3
|
from letschatty.models import StrObjectId
|
|
3
4
|
from letschatty.models.company.assets.ai_agents_v2.chatty_ai_agent import N8NWorkspaceAgentType
|
|
@@ -10,4 +11,5 @@ class SmartFollowUpN8NPayload(BaseModel):
|
|
|
10
11
|
class ManualTriggerN8NPayload(BaseModel):
|
|
11
12
|
chat_id: StrObjectId = Field(description="The id of the chat")
|
|
12
13
|
company_id: StrObjectId = Field(description="The id of the company")
|
|
13
|
-
n8n_agent_type: N8NWorkspaceAgentType = Field(description="The type of agent to redirect the message to")
|
|
14
|
+
n8n_agent_type: N8NWorkspaceAgentType = Field(description="The type of agent to redirect the message to")
|
|
15
|
+
trigger: ChainOfThoughtInChatTrigger = Field(default=ChainOfThoughtInChatTrigger.MANUAL_TRIGGER)
|
{letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/__init__.py
RENAMED
|
@@ -28,4 +28,5 @@ from ...messages.chatty_messages import ChattyMessage
|
|
|
28
28
|
from ...company.CRM.funnel import Funnel, FunnelStage
|
|
29
29
|
from ...utils.types import Status
|
|
30
30
|
from .chat_based_events.chat_based_event import CustomerEventData
|
|
31
|
-
from .chat_based_events.ai_agent_chat import ChattyAIChatEvent, ChattyAIChatData
|
|
31
|
+
from .chat_based_events.ai_agent_chat import ChattyAIChatEvent, ChattyAIChatData
|
|
32
|
+
from .chat_based_events.ai_agent_execution_event import AIAgentExecutionEvent, AIAgentExecutionEventData
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""AI Agent Execution Events - Track AI agent lifecycle and decision-making"""
|
|
2
|
+
|
|
3
|
+
from ..base import Event, EventData
|
|
4
|
+
from ..event_types import EventType
|
|
5
|
+
from .chat_based_event import CustomerEventData
|
|
6
|
+
from typing import ClassVar, Optional, Dict, Any
|
|
7
|
+
from ....utils.types.identifier import StrObjectId
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AIAgentExecutionEventData(CustomerEventData):
|
|
11
|
+
"""Data for AI agent execution events"""
|
|
12
|
+
ai_agent_id: StrObjectId
|
|
13
|
+
chain_of_thought_id: StrObjectId
|
|
14
|
+
trigger: str # USER_MESSAGE, FOLLOW_UP, MANUAL_TRIGGER, RETRY
|
|
15
|
+
decision_type: Optional[str] = None # send, suggest, escalate, skip
|
|
16
|
+
error_message: Optional[str] = None
|
|
17
|
+
duration_ms: Optional[int] = None
|
|
18
|
+
user_rating: Optional[int] = None # 1-5 stars
|
|
19
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AIAgentExecutionEvent(Event):
|
|
23
|
+
"""
|
|
24
|
+
Events for AI agent execution lifecycle.
|
|
25
|
+
|
|
26
|
+
This event type covers the entire AI agent decision-making process,
|
|
27
|
+
from trigger to final decision, including all intermediate steps.
|
|
28
|
+
"""
|
|
29
|
+
data: AIAgentExecutionEventData
|
|
30
|
+
|
|
31
|
+
VALID_TYPES: ClassVar[set] = {
|
|
32
|
+
# Trigger events
|
|
33
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_TRIGGER_USER_MESSAGE,
|
|
34
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_TRIGGER_FOLLOW_UP,
|
|
35
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_TRIGGER_MANUAL,
|
|
36
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_TRIGGER_RETRY,
|
|
37
|
+
|
|
38
|
+
# State events
|
|
39
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_STATE_PROCESSING_STARTED,
|
|
40
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_STATE_CALL_STARTED,
|
|
41
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_STATE_ESCALATED,
|
|
42
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_STATE_UNESCALATED,
|
|
43
|
+
|
|
44
|
+
# Call events
|
|
45
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALL_GET_CHAT_WITH_PROMPT,
|
|
46
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALL_TAGGER,
|
|
47
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALL_DOUBLE_CHECKER,
|
|
48
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALL_DEBUGGER,
|
|
49
|
+
|
|
50
|
+
# Callback events
|
|
51
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALLBACK_GET_CHAT_WITH_PROMPT,
|
|
52
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALLBACK_TAGGER,
|
|
53
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALLBACK_DOUBLE_CHECKER,
|
|
54
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_CALLBACK_OUTPUT_RECEIVED,
|
|
55
|
+
|
|
56
|
+
# Decision events
|
|
57
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_DECISION_SEND,
|
|
58
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_DECISION_SUGGEST,
|
|
59
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_DECISION_ESCALATE,
|
|
60
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_DECISION_SKIP,
|
|
61
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_DECISION_SENT_TO_API,
|
|
62
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_DECISION_COMPLETED,
|
|
63
|
+
|
|
64
|
+
# Error events
|
|
65
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_ERROR_CALL_FAILED,
|
|
66
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_ERROR_CALL_CANCELLED,
|
|
67
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_ERROR_VALIDATION_FAILED,
|
|
68
|
+
|
|
69
|
+
# Rating events
|
|
70
|
+
EventType.CHATTY_AI_AGENT_IN_CHAT_RATING_RECEIVED,
|
|
71
|
+
}
|
|
@@ -70,9 +70,6 @@ class AssetEvent(Event):
|
|
|
70
70
|
EventType.FILTER_CRITERIA_CREATED,
|
|
71
71
|
EventType.FILTER_CRITERIA_UPDATED,
|
|
72
72
|
EventType.FILTER_CRITERIA_DELETED,
|
|
73
|
-
EventType.FORM_FIELD_CREATED,
|
|
74
|
-
EventType.FORM_FIELD_UPDATED,
|
|
75
|
-
EventType.FORM_FIELD_DELETED,
|
|
76
73
|
EventType.COMPANY_CREATED,
|
|
77
74
|
EventType.COMPANY_UPDATED,
|
|
78
75
|
EventType.COMPANY_DELETED
|
|
@@ -86,10 +86,6 @@ EVENT_TO_TYPE_CLASSES = {
|
|
|
86
86
|
EventType.WORKFLOW_CREATED : AssetEvent,
|
|
87
87
|
EventType.WORKFLOW_UPDATED : AssetEvent,
|
|
88
88
|
EventType.WORKFLOW_DELETED : AssetEvent,
|
|
89
|
-
#FORM FIELDS
|
|
90
|
-
EventType.FORM_FIELD_CREATED : AssetEvent,
|
|
91
|
-
EventType.FORM_FIELD_UPDATED : AssetEvent,
|
|
92
|
-
EventType.FORM_FIELD_DELETED : AssetEvent,
|
|
93
89
|
#AGENTS
|
|
94
90
|
EventType.USER_CREATED : UserEvent,
|
|
95
91
|
EventType.USER_UPDATED : UserEvent,
|
{letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/analytics/events/event_types.py
RENAMED
|
@@ -12,6 +12,51 @@ class EventType(StrEnum):
|
|
|
12
12
|
AI_AGENT_ASSIGNED_TO_CHAT = "chat.chatty_ai_agent.assigned_to_chat"
|
|
13
13
|
AI_AGENT_REMOVED_FROM_CHAT = "chat.chatty_ai_agent.removed_from_chat"
|
|
14
14
|
AI_AGENT_UPDATED_ON_CHAT = "chat.chatty_ai_agent.updated_on_chat"
|
|
15
|
+
|
|
16
|
+
#CHATTY AI AGENT EXECUTION EVENTS - 3-level hierarchy for execution tracking
|
|
17
|
+
# Pattern: chatty_ai_agent_in_chat.{operation}.{detail}
|
|
18
|
+
# Note: Execution events are already chat-scoped via CustomerEventData
|
|
19
|
+
|
|
20
|
+
# TRIGGER EVENTS - What initiates AI agent processing
|
|
21
|
+
CHATTY_AI_AGENT_IN_CHAT_TRIGGER_USER_MESSAGE = "chatty_ai_agent_in_chat.trigger.user_message"
|
|
22
|
+
CHATTY_AI_AGENT_IN_CHAT_TRIGGER_FOLLOW_UP = "chatty_ai_agent_in_chat.trigger.follow_up"
|
|
23
|
+
CHATTY_AI_AGENT_IN_CHAT_TRIGGER_MANUAL = "chatty_ai_agent_in_chat.trigger.manual"
|
|
24
|
+
CHATTY_AI_AGENT_IN_CHAT_TRIGGER_RETRY = "chatty_ai_agent_in_chat.trigger.retry"
|
|
25
|
+
|
|
26
|
+
# STATE EVENTS - AI agent state changes
|
|
27
|
+
CHATTY_AI_AGENT_IN_CHAT_STATE_PROCESSING_STARTED = "chatty_ai_agent_in_chat.state.processing_started"
|
|
28
|
+
CHATTY_AI_AGENT_IN_CHAT_STATE_CALL_STARTED = "chatty_ai_agent_in_chat.state.call_started"
|
|
29
|
+
CHATTY_AI_AGENT_IN_CHAT_STATE_ESCALATED = "chatty_ai_agent_in_chat.state.escalated"
|
|
30
|
+
CHATTY_AI_AGENT_IN_CHAT_STATE_UNESCALATED = "chatty_ai_agent_in_chat.state.unescalated"
|
|
31
|
+
|
|
32
|
+
# CALL EVENTS - Outbound calls to services
|
|
33
|
+
CHATTY_AI_AGENT_IN_CHAT_CALL_GET_CHAT_WITH_PROMPT = "chatty_ai_agent_in_chat.call.get_chat_with_prompt"
|
|
34
|
+
CHATTY_AI_AGENT_IN_CHAT_CALL_TAGGER = "chatty_ai_agent_in_chat.call.tagger"
|
|
35
|
+
CHATTY_AI_AGENT_IN_CHAT_CALL_DOUBLE_CHECKER = "chatty_ai_agent_in_chat.call.double_checker"
|
|
36
|
+
CHATTY_AI_AGENT_IN_CHAT_CALL_DEBUGGER = "chatty_ai_agent_in_chat.call.debugger"
|
|
37
|
+
|
|
38
|
+
# CALLBACK EVENTS - Responses received from services
|
|
39
|
+
CHATTY_AI_AGENT_IN_CHAT_CALLBACK_GET_CHAT_WITH_PROMPT = "chatty_ai_agent_in_chat.callback.get_chat_with_prompt"
|
|
40
|
+
CHATTY_AI_AGENT_IN_CHAT_CALLBACK_TAGGER = "chatty_ai_agent_in_chat.callback.tagger"
|
|
41
|
+
CHATTY_AI_AGENT_IN_CHAT_CALLBACK_DOUBLE_CHECKER = "chatty_ai_agent_in_chat.callback.double_checker"
|
|
42
|
+
CHATTY_AI_AGENT_IN_CHAT_CALLBACK_OUTPUT_RECEIVED = "chatty_ai_agent_in_chat.callback.output_received"
|
|
43
|
+
|
|
44
|
+
# DECISION EVENTS - AI agent decisions and actions
|
|
45
|
+
CHATTY_AI_AGENT_IN_CHAT_DECISION_SEND = "chatty_ai_agent_in_chat.decision.send"
|
|
46
|
+
CHATTY_AI_AGENT_IN_CHAT_DECISION_SUGGEST = "chatty_ai_agent_in_chat.decision.suggest"
|
|
47
|
+
CHATTY_AI_AGENT_IN_CHAT_DECISION_ESCALATE = "chatty_ai_agent_in_chat.decision.escalate"
|
|
48
|
+
CHATTY_AI_AGENT_IN_CHAT_DECISION_SKIP = "chatty_ai_agent_in_chat.decision.skip"
|
|
49
|
+
CHATTY_AI_AGENT_IN_CHAT_DECISION_SENT_TO_API = "chatty_ai_agent_in_chat.decision.sent_to_api"
|
|
50
|
+
CHATTY_AI_AGENT_IN_CHAT_DECISION_COMPLETED = "chatty_ai_agent_in_chat.decision.completed"
|
|
51
|
+
|
|
52
|
+
# ERROR EVENTS - Failures and cancellations
|
|
53
|
+
CHATTY_AI_AGENT_IN_CHAT_ERROR_CALL_FAILED = "chatty_ai_agent_in_chat.error.call_failed"
|
|
54
|
+
CHATTY_AI_AGENT_IN_CHAT_ERROR_CALL_CANCELLED = "chatty_ai_agent_in_chat.error.call_cancelled"
|
|
55
|
+
CHATTY_AI_AGENT_IN_CHAT_ERROR_VALIDATION_FAILED = "chatty_ai_agent_in_chat.error.validation_failed"
|
|
56
|
+
|
|
57
|
+
# RATING EVENTS - User feedback
|
|
58
|
+
CHATTY_AI_AGENT_IN_CHAT_RATING_RECEIVED = "chatty_ai_agent_in_chat.rating.received"
|
|
59
|
+
|
|
15
60
|
#PRODUCTS
|
|
16
61
|
PRODUCT_ASSIGNED = "chat.product.assigned"
|
|
17
62
|
PRODUCT_REMOVED = "chat.product.removed"
|
|
@@ -55,7 +55,7 @@ class SmartFollowUpDecision(BaseModel):
|
|
|
55
55
|
SmartFollowUpDecisionAction.POSTPONE_DELTA_TIME]:
|
|
56
56
|
# Postpone actions don't require messages
|
|
57
57
|
if self.messages is not None and len(self.messages) > 0:
|
|
58
|
-
raise ValueError("Messages are not allowed when action is postpone
|
|
58
|
+
raise ValueError("Messages are not allowed when action is postpone")
|
|
59
59
|
else:
|
|
60
60
|
raise ValueError(f"Invalid action: {self.action}")
|
|
61
61
|
|
|
@@ -123,6 +123,10 @@ class ChattyAIAgentInChat(CompanyAssetModel):
|
|
|
123
123
|
default=None,
|
|
124
124
|
description="If the trigger is a user message, this will be the id of the incoming message"
|
|
125
125
|
)
|
|
126
|
+
last_reset_message_id: Optional[str] = Field(
|
|
127
|
+
default=None,
|
|
128
|
+
description="Last reset control trigger message id handled for this chat"
|
|
129
|
+
)
|
|
126
130
|
|
|
127
131
|
# Assignment metadata
|
|
128
132
|
assigned_at: datetime = Field(default_factory=lambda: datetime.now(ZoneInfo("UTC")))
|
|
@@ -352,4 +356,3 @@ class ChattyAIAgentInChat(CompanyAssetModel):
|
|
|
352
356
|
"""Cancel data collection"""
|
|
353
357
|
self.data_collection_status = DataCollectionStatus.CANCELLED
|
|
354
358
|
self.updated_at = datetime.now(ZoneInfo("UTC"))
|
|
355
|
-
|
|
@@ -16,7 +16,7 @@ class ChattyAIMode(StrEnum):
|
|
|
16
16
|
return {
|
|
17
17
|
cls.AUTONOMOUS: "El agente de IA tendrá la autonomía de conversar en tiempo real con el usuario, respetando sus instrucciones y las reglas establecidas.",
|
|
18
18
|
cls.SUGGESTIONS: "El agente de IA sugerirá sólo hará sugerencias de respuestas y seguimientos, pero no enviará mensajes ni interactuará de forma directa con el usuario.",
|
|
19
|
-
cls.COPILOT: "El agente de IA
|
|
19
|
+
cls.COPILOT: "El agente de IA responderá automáticamente cuando tenga alta confianza y la consulta esté dentro del alcance; si no, sugerirá o escalará para revisión humana.",
|
|
20
20
|
cls.OFF: "El agente de IA estará inactivo. No responderá al usuario ni hará sugerencias."
|
|
21
21
|
}[mode]
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ class ChattyAIMode(StrEnum):
|
|
|
26
26
|
mode_description = {
|
|
27
27
|
cls.AUTONOMOUS: "Only answer based on the context and rules provided. Do not improvise or make up information. If you can't handle the question, escalate to a human.",
|
|
28
28
|
cls.SUGGESTIONS: "You're only going to be making suggestions, all your messages will be reviewd by a human and you should add the reasoning to your chain of thought. If the user message is not worth answering, you can use the 'skip' action in your output. If the user message is worth answering, you NEED to use the 'suggest' action in your output. ",
|
|
29
|
-
cls.COPILOT: "You're in
|
|
29
|
+
cls.COPILOT: "You're in COPILOT mode. Use your confidence to decide the action: send when the request is within scope and you are confident, suggest when you're unsure or a human touch is needed (complex negotiation, frustration, high-value, or missing info), and escalate if it's required by control triggers. Always include a confidence score (0-100).",
|
|
30
30
|
cls.OFF: ""
|
|
31
31
|
}[mode]
|
|
32
32
|
return intro + "\n\n" + mode_description
|
|
@@ -25,6 +25,7 @@ class GetChatWithPromptResponse(BaseModel):
|
|
|
25
25
|
"messages": self.messages,
|
|
26
26
|
"n8n_agent_type": self.chatty_ai_agent.n8n_workspace_agent_type.value if self.chatty_ai_agent else None,
|
|
27
27
|
"n8n_agent_type_parameters": self.chatty_ai_agent.n8n_workspace_agent_type_parameteres.model_dump() if self.chatty_ai_agent else None,
|
|
28
|
+
"ai_agent_id": self.chatty_ai_agent.id if self.chatty_ai_agent else None,
|
|
28
29
|
"phone_number": self.chat.client.get_waid() if self.chat else None,
|
|
29
30
|
"chain_of_thought_id": self.chain_of_thought_id,
|
|
30
31
|
"trigger_id": self.trigger_id
|
|
@@ -5,11 +5,17 @@ Defines the data collection, acceptance criteria, and destination actions
|
|
|
5
5
|
for qualifying/disqualifying users.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
from letschatty.models.company.assets.automation import Automation
|
|
8
9
|
from pydantic import BaseModel, Field
|
|
9
10
|
from typing import Optional, List
|
|
10
11
|
from enum import StrEnum
|
|
11
12
|
from letschatty.models.utils.types.identifier import StrObjectId
|
|
12
13
|
|
|
14
|
+
class PostToExternalApiConfig(BaseModel):
|
|
15
|
+
"""Placeholder provisorio"""
|
|
16
|
+
url: str = Field(description="The URL to post to")
|
|
17
|
+
method: str = Field(description="The HTTP method to use")
|
|
18
|
+
api_key: str
|
|
13
19
|
|
|
14
20
|
class PreQualifyDestination(StrEnum):
|
|
15
21
|
"""
|
|
@@ -19,8 +25,11 @@ class PreQualifyDestination(StrEnum):
|
|
|
19
25
|
CALENDAR_SCHEDULER = "calendar_scheduler" # Allow AI agent to schedule meetings
|
|
20
26
|
ESCALATE = "escalate" # Escalate to human
|
|
21
27
|
CUSTOM_MESSAGE = "custom_message" # Send a custom message
|
|
28
|
+
AUTO_ASSIGN_HUMAN_AGENT = "auto_assign_human_agent" #
|
|
22
29
|
CONTINUE = "continue" # Continue normal AI agent flow
|
|
23
|
-
NONE = "none" # Do nothing
|
|
30
|
+
NONE = "none" # Do nothing (no-op)
|
|
31
|
+
ARCHIVE = "archive"
|
|
32
|
+
POST_TO_EXTERNAL_API = "post_to_external_api"
|
|
24
33
|
|
|
25
34
|
|
|
26
35
|
class PreQualifyFormField(BaseModel):
|
|
@@ -68,6 +77,10 @@ class PreQualifyConfig(BaseModel):
|
|
|
68
77
|
default=None,
|
|
69
78
|
description="Custom message to send when user does NOT qualify (if destination is custom_message or escalate)"
|
|
70
79
|
)
|
|
80
|
+
post_to_external_api : Optional[PostToExternalApiConfig] = Field(
|
|
81
|
+
default=None,
|
|
82
|
+
description="Configuration for posting to an external API"
|
|
83
|
+
)
|
|
71
84
|
|
|
72
85
|
@property
|
|
73
86
|
def has_form_fields(self) -> bool:
|
|
@@ -108,4 +121,3 @@ class PreQualifyConfig(BaseModel):
|
|
|
108
121
|
original_len = len(self.form_fields)
|
|
109
122
|
self.form_fields = [f for f in self.form_fields if f.field_key != field_key]
|
|
110
123
|
return len(self.form_fields) < original_len
|
|
111
|
-
|
{letschatty-0.4.331 → letschatty-0.4.333}/src/letschatty/models/company/assets/automation.py
RENAMED
|
@@ -17,6 +17,24 @@ class Automation(BaseModel):
|
|
|
17
17
|
chain_of_thought : Optional[str] = Field(default=None)
|
|
18
18
|
# client_info: Optional[ClientInfo] = Field(default=None) me gustaría que levante el mail y/o otros atributos
|
|
19
19
|
|
|
20
|
+
@property
|
|
21
|
+
def has_automation(self) -> bool:
|
|
22
|
+
"""
|
|
23
|
+
Check if there's an actual automation defined (tags, products, or flow).
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
bool: True if there's at least one tag, product, or flow defined
|
|
27
|
+
"""
|
|
28
|
+
return (
|
|
29
|
+
len(self.tags) > 0 or
|
|
30
|
+
len(self.products) > 0 or
|
|
31
|
+
len(self.flow) > 0 or
|
|
32
|
+
self.quality_score is not None or
|
|
33
|
+
self.chatty_ai_agent_config is not None or
|
|
34
|
+
self.area is not None or
|
|
35
|
+
self.highlight_description is not None
|
|
36
|
+
)
|
|
37
|
+
|
|
20
38
|
@model_validator(mode='after')
|
|
21
39
|
def check_agent_id(self):
|
|
22
40
|
if self.area == Area.WITH_AGENT and not self.agent_id:
|