letschatty 0.4.344__tar.gz → 0.4.345__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.
Files changed (288) hide show
  1. {letschatty-0.4.344 → letschatty-0.4.345}/PKG-INFO +1 -1
  2. {letschatty-0.4.344 → letschatty-0.4.345}/pyproject.toml +1 -1
  3. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/ai_microservices/lambda_events.py +4 -17
  4. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/__init__.py +1 -0
  5. letschatty-0.4.345/src/letschatty/models/analytics/events/chat_based_events/chat_client.py +19 -0
  6. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/event_type_to_classes.py +1 -0
  7. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/event_types.py +2 -0
  8. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/chat.py +2 -11
  9. letschatty-0.4.345/src/letschatty/models/company/__init__.py +4 -0
  10. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/chain_of_thought_in_chat.py +3 -5
  11. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_agent_in_chat.py +34 -2
  12. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/chat_assets.py +2 -12
  13. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/sale.py +3 -3
  14. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/empresa.py +1 -2
  15. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/form_field.py +2 -9
  16. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chat/chat_service.py +13 -75
  17. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/analytics/events_factory.py +24 -0
  18. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/validators/analytics_validator.py +0 -11
  19. letschatty-0.4.344/src/letschatty/models/company/__init__.py +0 -9
  20. letschatty-0.4.344/src/letschatty/models/company/assets/ai_agents_v2/statuses.py +0 -33
  21. letschatty-0.4.344/src/letschatty/models/company/integrations/product_sync_status.py +0 -28
  22. letschatty-0.4.344/src/letschatty/models/company/integrations/shopify/company_shopify_integration.py +0 -62
  23. letschatty-0.4.344/src/letschatty/models/company/integrations/shopify/shopify_product_sync_status.py +0 -18
  24. letschatty-0.4.344/src/letschatty/models/company/integrations/shopify/shopify_webhook_topics.py +0 -40
  25. letschatty-0.4.344/src/letschatty/models/company/integrations/sync_status_enum.py +0 -9
  26. {letschatty-0.4.344 → letschatty-0.4.345}/LICENSE +0 -0
  27. {letschatty-0.4.344 → letschatty-0.4.345}/README.md +0 -0
  28. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/__init__.py +0 -0
  29. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/__init__.py +0 -0
  30. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/ai_microservices/__init__.py +0 -0
  31. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/ai_microservices/expected_output.py +0 -0
  32. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/ai_microservices/lambda_invokation_types.py +0 -0
  33. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/ai_microservices/n8n_ai_agents_payload.py +0 -0
  34. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/ai_microservices/openai_payloads.py +0 -0
  35. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/__init__.py +0 -0
  36. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/base.py +0 -0
  37. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/ai_agent_chat.py +0 -0
  38. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/business_area.py +0 -0
  39. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/chat_based_event.py +0 -0
  40. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/chat_context.py +0 -0
  41. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/chat_funnel.py +0 -0
  42. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/chat_status.py +0 -0
  43. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/contact_point.py +0 -0
  44. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/continuous_conversation.py +0 -0
  45. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/highlight.py +0 -0
  46. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/message.py +0 -0
  47. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/messages_intent_context.py +0 -0
  48. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/product_chat.py +0 -0
  49. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/quality_scoring.py +0 -0
  50. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/sale.py +0 -0
  51. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/tag_chat.py +0 -0
  52. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/chat_based_events/workflow.py +0 -0
  53. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/company_based_events/asset_events.py +0 -0
  54. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/company_based_events/company_events.py +0 -0
  55. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/events/company_based_events/user_events.py +0 -0
  56. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/metrics/__init_.py +0 -0
  57. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/metrics/daily_contact_points.py +0 -0
  58. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/metrics/daily_new_chats.py +0 -0
  59. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/metrics/daily_sent_templates_grouped.py +0 -0
  60. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/metrics/sales_roadmap.py +0 -0
  61. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/metrics/sent_templates.py +0 -0
  62. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/smart_messages/friendly_code_for_source.py +0 -0
  63. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/smart_messages/topic.py +0 -0
  64. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/smart_messages/topic_message.py +0 -0
  65. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/__init__.py +0 -0
  66. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/google_ad_utm_source.py +0 -0
  67. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/helpers.py +0 -0
  68. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/other_source.py +0 -0
  69. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/pure_ad.py +0 -0
  70. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/pure_ad_utm_source.py +0 -0
  71. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/source_base.py +0 -0
  72. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/template_source.py +0 -0
  73. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/topic_default_source.py +0 -0
  74. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/utm_source.py +0 -0
  75. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/utms/referer_info.py +0 -0
  76. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/utms/utm_query_params.py +0 -0
  77. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/analytics/sources/whatsapp_default_source.py +0 -0
  78. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/auth/jwt.py +0 -0
  79. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/__init__.py +0 -0
  80. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/ai_agent_component.py +0 -0
  81. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/chatty_asset_model.py +0 -0
  82. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/helpers.py +0 -0
  83. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/related_asset_usage_example.py +0 -0
  84. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/singleton.py +0 -0
  85. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/update_model_interface.py +0 -0
  86. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/base_models/validate_timestamps_and_id.py +0 -0
  87. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/channels/channel.py +0 -0
  88. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/assets_assigned_to_chat.py +0 -0
  89. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/chat_status_modifications.py +0 -0
  90. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/chat_with_assets.py +0 -0
  91. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/client.py +0 -0
  92. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/continuous_conversation.py +0 -0
  93. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/filter_parameters.py +0 -0
  94. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/flow_link_state.py +0 -0
  95. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/highlight.py +0 -0
  96. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/preview.py +0 -0
  97. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/quality_scoring.py +0 -0
  98. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/scheduled_messages.py +0 -0
  99. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/temporary_chat.py +0 -0
  100. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/chat/time_left.py +0 -0
  101. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/CRM/business_area.py +0 -0
  102. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/CRM/funnel.py +0 -0
  103. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/__init__.py +0 -0
  104. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/ai_agent_message_draft.py +0 -0
  105. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/ai_agents_decision_output.py +0 -0
  106. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/chat_example.py +0 -0
  107. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/chat_example_test.py +0 -0
  108. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_agent.py +0 -0
  109. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_agent_config_for_automation.py +0 -0
  110. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/chatty_ai_mode.py +0 -0
  111. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/context_item.py +0 -0
  112. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/faq.py +0 -0
  113. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/follow_up_strategy.py +0 -0
  114. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/get_chat_with_prompt_response.py +0 -0
  115. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/knowleadge_base_components.py +0 -0
  116. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/n8n_agents_info.py +0 -0
  117. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/n8n_schema_incoming_message_output.json +0 -0
  118. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/n8n_schema_smart_follow_up_output.json +0 -0
  119. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/ai_agents_v2/pre_qualify_config.py +0 -0
  120. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/assignment/__init__.py +0 -0
  121. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/assignment/assignment_assets.py +0 -0
  122. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/automation.py +0 -0
  123. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/chatty_fast_answers/__init__.py +0 -0
  124. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/chatty_fast_answers/chatty_fast_answer.py +0 -0
  125. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/company_assets.py +0 -0
  126. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/contact_point.py +0 -0
  127. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/filter_criteria.py +0 -0
  128. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/flow.py +0 -0
  129. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/launch/__init__.py +0 -0
  130. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/launch/launch.py +0 -0
  131. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/launch/scheduled_communication.py +0 -0
  132. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/launch/subscription.py +0 -0
  133. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/media/__init__.py +0 -0
  134. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/media/file.py +0 -0
  135. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/product.py +0 -0
  136. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/tag.py +0 -0
  137. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/users/agent_chats_snapshot.py +0 -0
  138. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/users/user.py +0 -0
  139. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/users/user_asset_permission.py +0 -0
  140. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/assets/workflow_execution.py +0 -0
  141. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/company_chats_snapshot.py +0 -0
  142. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/company_messaging_settgins.py +0 -0
  143. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/conversation_topic.py +0 -0
  144. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/insight.py +0 -0
  145. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/company/notifications/notification.py +0 -0
  146. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/copilot/links.py +0 -0
  147. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/data_base/__init__.py +0 -0
  148. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/data_base/collection_interface.py +0 -0
  149. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/data_base/mongo_connection.py +0 -0
  150. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/execution/__init__.py +0 -0
  151. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/execution/execution.py +0 -0
  152. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/execution/executor.py +0 -0
  153. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/forms/company/auth0_company_registration_form.py +0 -0
  154. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/forms/company/meta_register.py +0 -0
  155. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/__init__.py +0 -0
  156. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/__init__.py +0 -0
  157. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/audio.py +0 -0
  158. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/base/__init__.py +0 -0
  159. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/base/chatty_message_json.py +0 -0
  160. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/base/message_base.py +0 -0
  161. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/base/message_draft.py +0 -0
  162. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/button.py +0 -0
  163. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/central_notification.py +0 -0
  164. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/contact.py +0 -0
  165. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/document.py +0 -0
  166. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/image.py +0 -0
  167. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/interactive.py +0 -0
  168. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/location.py +0 -0
  169. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/reaction.py +0 -0
  170. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/__init__.py +0 -0
  171. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_audio.py +0 -0
  172. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_button.py +0 -0
  173. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_central.py +0 -0
  174. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_contacts.py +0 -0
  175. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_document.py +0 -0
  176. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_image.py +0 -0
  177. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_interactive.py +0 -0
  178. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_location.py +0 -0
  179. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_media.py +0 -0
  180. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_reaction.py +0 -0
  181. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_sticker.py +0 -0
  182. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_text.py +0 -0
  183. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_content/content_video.py +0 -0
  184. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_context/__init__.py +0 -0
  185. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_context/chatty_context.py +0 -0
  186. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_referal/__init__.py +0 -0
  187. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/schema/chatty_referal/chatty_referal.py +0 -0
  188. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/sticker.py +0 -0
  189. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/text.py +0 -0
  190. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/chatty_messages/video.py +0 -0
  191. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/message_templates/__init__.py +0 -0
  192. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/message_templates/chatty_template_campaign.py +0 -0
  193. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/message_templates/filled_data_from_frontend.py +0 -0
  194. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/message_templates/payload_for_sending_template.py +0 -0
  195. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/message_templates/raw_meta_template.py +0 -0
  196. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/message_templates/recipient_of_template_campaign.py +0 -0
  197. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/message_templates/required_for_frontend_templates.py +0 -0
  198. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/meta_base_notification_json.py +0 -0
  199. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/meta_error_json.py +0 -0
  200. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/meta_inexistent_json.py +0 -0
  201. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/meta_message_json.py +0 -0
  202. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/meta_status_json.py +0 -0
  203. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/meta_unknown_json.py +0 -0
  204. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/__init__.py +0 -0
  205. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/button_content.py +0 -0
  206. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/contacts_content.py +0 -0
  207. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/interactive_content.py +0 -0
  208. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/location_content.py +0 -0
  209. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/multimedia_content.py +0 -0
  210. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/order_content.py +0 -0
  211. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/reaction_content.py +0 -0
  212. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/system_content.py +0 -0
  213. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/content_messages/text_content.py +0 -0
  214. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/values/__init__.py +0 -0
  215. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/values/value_errors.py +0 -0
  216. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/values/value_messages.py +0 -0
  217. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/messages/meta_message_model/schema/values/value_statuses.py +0 -0
  218. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/__init__.py +0 -0
  219. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/custom_exceptions/__init__.py +0 -0
  220. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/custom_exceptions/custom_exceptions.py +0 -0
  221. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/definitions.py +0 -0
  222. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/CRUD_operations.py +0 -0
  223. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/__init__.py +0 -0
  224. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/channel_types.py +0 -0
  225. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/chats_actions.py +0 -0
  226. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/country.py +0 -0
  227. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/deletion_type.py +0 -0
  228. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/executor_types.py +0 -0
  229. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/identifier.py +0 -0
  230. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/message_status_types.py +0 -0
  231. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/message_types.py +0 -0
  232. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/phone_number.py +0 -0
  233. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/serializer_type.py +0 -0
  234. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/source_types.py +0 -0
  235. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/models/utils/types/typealiases.py +0 -0
  236. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/__init__.py +0 -0
  237. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/context_builder_v2.py +0 -0
  238. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/cot_follow_up_examples.py +0 -0
  239. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/followup_schema.json +0 -0
  240. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/smart_follow_up_context_builder_v2.py +0 -0
  241. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/smart_follow_up_service_v2.py +0 -0
  242. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/tool_descriptions/assign_chat_to_ai_agent_itself.json +0 -0
  243. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/tool_descriptions/human_handover.json +0 -0
  244. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_agents/tool_descriptions.py +0 -0
  245. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/ai_components_service.py +0 -0
  246. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chat/chat_extractors.py +0 -0
  247. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chat/client_service.py +0 -0
  248. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chat/conversation_topics_service.py +0 -0
  249. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chatty_assets/__init__.py +0 -0
  250. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chatty_assets/asset_service.py +0 -0
  251. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chatty_assets/base_container.py +0 -0
  252. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chatty_assets/base_container_with_collection.py +0 -0
  253. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chatty_assets/documentation_diagram.png +0 -0
  254. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/chatty_assets/readme.md +0 -0
  255. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/concurrent/concurrent.py +0 -0
  256. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/contact_points/contact_point_service.py +0 -0
  257. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/continuous_conversation_service/continuous_conversation_helper.py +0 -0
  258. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/events/events_manager.py +0 -0
  259. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/__init__.py +0 -0
  260. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/analytics/contact_point_factory.py +0 -0
  261. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/analytics/smart_messages/topics_factory.py +0 -0
  262. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/analytics/sources/helpers.py +0 -0
  263. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/analytics/sources/source_factory.py +0 -0
  264. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/chats/chat_factory.py +0 -0
  265. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/chatty_fast_answers/__init__.py +0 -0
  266. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/chatty_fast_answers/chatty_fast_answers_factory.py +0 -0
  267. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/clients/client_factory.py +0 -0
  268. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/company/__init__.py +0 -0
  269. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/company/empresa_factory.py +0 -0
  270. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/lambda_ai_orchestrartor/lambda_events_factory.py +0 -0
  271. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/__init__.py +0 -0
  272. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/central_notification_factory.py +0 -0
  273. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/chatty_message_factory.py +0 -0
  274. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/child_db_message_factory.py +0 -0
  275. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/child_request_message.py +0 -0
  276. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/from_template_hot_fix.py +0 -0
  277. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/message_templates/template_factory.py +0 -0
  278. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/messages/message_templates/test.py +0 -0
  279. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/meta_notifications/__init__.py +0 -0
  280. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/meta_notifications/meta_notification_factory.py +0 -0
  281. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/factories/product_factory.py +0 -0
  282. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/filter_criteria_service.py +0 -0
  283. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/messages_helpers/__init__.py +0 -0
  284. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/messages_helpers/get_caption_or_body_or_preview.py +0 -0
  285. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/scheduled_messages_service/scheduled_messages_helpers.py +0 -0
  286. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/template_campaigns/template_campaign_service.py +0 -0
  287. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/users/agent_service.py +0 -0
  288. {letschatty-0.4.344 → letschatty-0.4.345}/src/letschatty/services/users/user_factory.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: letschatty
3
- Version: 0.4.344
3
+ Version: 0.4.345
4
4
  Summary: Models and custom classes to work across the Chattyverse
5
5
  License: MIT
6
6
  Author: Axel
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "letschatty"
3
- version = "0.4.344" # Or whichever is your latest version
3
+ version = "0.4.345" # 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"
@@ -61,23 +61,10 @@ class SmartTaggingCallbackEvent(LambdaAiEvent):
61
61
  callback_metadata: SmartTaggingCallbackMetadata
62
62
 
63
63
  @model_validator(mode="before")
64
- def normalize_data(cls, values):
65
- if not isinstance(values, dict):
66
- return values
67
-
68
- data = values.get("data")
69
- if isinstance(data, str):
70
- import json
71
- try:
72
- data = json.loads(data)
73
- values["data"] = data
74
- except (json.JSONDecodeError, TypeError):
75
- return values
76
-
77
- if isinstance(data, dict) and "chain_of_thought" in data:
78
- data["chain_of_thought"]["chatty_ai_agent_id"] = "000000000000000000000000"
79
-
80
- return values
64
+ def validate_data(cls, data):
65
+ if isinstance(data, dict) and "data" in data and "chain_of_thought" in data["data"]:
66
+ data["data"]["chain_of_thought"]["chatty_ai_agent_id"] = "000000000000000000000000"
67
+ return data
81
68
 
82
69
  class ChatData(BaseModel):
83
70
  chat_id: StrObjectId
@@ -3,6 +3,7 @@ from .chat_based_events.contact_point import ContactPointEvent, ContactPointData
3
3
  from .chat_based_events.business_area import ChatBusinessAreaEvent, BusinessAreaData
4
4
  from .chat_based_events.workflow import WorkflowEvent, WorkflowEventData
5
5
  from .chat_based_events.chat_status import ChatStatusEvent, ChatStatusEventData, ChatStatusModification, ChatCreatedFrom
6
+ from .chat_based_events.chat_client import ChatClientEvent
6
7
  from .chat_based_events.chat_funnel import ChatFunnelEvent, FunnelEventData
7
8
  from ...company.CRM.funnel import ChatFunnel, StageTransition, ActiveFunnel
8
9
  from .company_based_events.user_events import UserEvent, UserEventData
@@ -0,0 +1,19 @@
1
+ from ..base import Event
2
+ from ..event_types import EventType
3
+ from .chat_based_event import CustomerEventData
4
+ from typing import ClassVar
5
+ import json
6
+
7
+
8
+ class ChatClientEvent(Event):
9
+ """Emitted when the client (contact/customer) data on a chat is updated."""
10
+ data: CustomerEventData
11
+
12
+ VALID_TYPES: ClassVar[set] = {
13
+ EventType.CHAT_CLIENT_UPDATED,
14
+ }
15
+
16
+ def model_dump_json(self, *args, **kwargs):
17
+ dump = json.loads(super().model_dump_json(*args, **kwargs))
18
+ dump['data'] = self.data.model_dump_json()
19
+ return dump
@@ -8,6 +8,7 @@ EVENT_TO_TYPE_CLASSES = {
8
8
  EventType.CHAT_CREATED : ChatStatusEvent,
9
9
  EventType.CHAT_STATUS_UPDATED : ChatStatusEvent,
10
10
  EventType.CHAT_DELETED : ChatStatusEvent,
11
+ EventType.CHAT_CLIENT_UPDATED : ChatClientEvent,
11
12
  #TAGS
12
13
  EventType.TAG_ASSIGNED : TagChatEvent,
13
14
  EventType.TAG_REMOVED : TagChatEvent,
@@ -5,6 +5,8 @@ class EventType(StrEnum):
5
5
  CHAT_CREATED = "chat.created"
6
6
  CHAT_STATUS_UPDATED = "chat.status_updated"
7
7
  CHAT_DELETED = "chat.deleted"
8
+ ##CHAT CLIENT EVENTS
9
+ CHAT_CLIENT_UPDATED = "chat.client.updated"
8
10
  #TAGS
9
11
  TAG_ASSIGNED = "chat.tag.assigned"
10
12
  TAG_REMOVED = "chat.tag.removed"
@@ -269,17 +269,7 @@ class Chat(CompanyAssetModel):
269
269
  @property
270
270
  def bought_product_ids(self) -> List[StrObjectId]:
271
271
  """Get all sale ids in the chat"""
272
- product_ids: List[StrObjectId] = []
273
- for sale in self.sales:
274
- sale_product_ids = getattr(sale, "product_ids", None)
275
- if sale_product_ids:
276
- for product_id in sale_product_ids:
277
- if product_id not in product_ids:
278
- product_ids.append(product_id)
279
- elif sale.product_id:
280
- if sale.product_id not in product_ids:
281
- product_ids.append(sale.product_id)
282
- return product_ids
272
+ return [sale.product_id for sale in self.sales]
283
273
 
284
274
  @property
285
275
  def products(self) -> List[AssignedAssetToChat]:
@@ -376,3 +366,4 @@ class Chat(CompanyAssetModel):
376
366
  dump["last_message"] = self.last_message.model_dump_json(serializer=SerializerType.DATABASE) if self.last_message else None
377
367
  dump["flow_states"] = [flow_state.model_dump_json(serializer=SerializerType.DATABASE) for flow_state in self.flow_states]
378
368
  return dump
369
+
@@ -0,0 +1,4 @@
1
+ from .assets import *
2
+ from .empresa import EmpresaModel
3
+ from .form_field import FormField, FormFieldPreview, CollectedData, SystemFormFields
4
+ from .CRM.funnel import Funnel, FunnelPreview, ChatFunnel, StageTransition, FunnelStatus
@@ -84,13 +84,12 @@ class ChainOfThoughtInChatPreview(ChattyAssetPreview):
84
84
  # trigger_id removed - trigger info is in: incoming_message_ids for user_message,
85
85
  # triggered_by_user_id for manual_trigger, smart_follow_up_id for follow_up
86
86
  chain_of_thought : Optional[str] = Field(default=None, description="The chain of thought")
87
- confidence: Optional[int] = Field(default=None, ge=0, le=100, description="Confidence 0-100")
88
87
  status: Optional[ChainOfThoughtInChatStatus] = Field(default=None, description="The status of the chain of thought")
89
88
  name: str = Field(description="A title for the chain of thought")
90
89
 
91
90
  @classmethod
92
91
  def get_projection(cls) -> dict[str, Any]:
93
- return super().get_projection() | {"chat_id": 1, "trigger": 1, "chain_of_thought": 1, "confidence": 1, "name": 1, "status": 1}
92
+ return super().get_projection() | {"chat_id": 1, "trigger": 1, "chain_of_thought": 1, "name": 1, "status": 1}
94
93
 
95
94
  @classmethod
96
95
  def from_dict(cls, data: dict) -> 'ChainOfThoughtInChatPreview':
@@ -104,7 +103,6 @@ class ChainOfThoughtInChatPreview(ChattyAssetPreview):
104
103
  chat_id=asset.chat_id,
105
104
  trigger=asset.trigger,
106
105
  chain_of_thought=asset.chain_of_thought,
107
- confidence=asset.confidence,
108
106
  status=asset.status,
109
107
  company_id=asset.company_id,
110
108
  created_at=asset.created_at,
@@ -123,7 +121,6 @@ class ChainOfThoughtInChat(CompanyAssetModel):
123
121
  chatty_ai_agent_id : StrObjectId = Field(description="The chatty ai agent id")
124
122
  chatty_ai_agent : Dict[str, Any] = Field(description="The chatty ai agent at the moment of triggering the chain of thought", exclude=True,default_factory=dict)
125
123
  chain_of_thought : Optional[str] = Field(default=None, description="The chain of thought")
126
- confidence: Optional[int] = Field(default=None, ge=0, le=100, description="Confidence 0-100")
127
124
  name: str = Field(description="A title for the chain of thought", alias="title")
128
125
  preview_class: ClassVar[Type[ChattyAssetPreview]] = ChainOfThoughtInChatPreview
129
126
 
@@ -131,4 +128,5 @@ class ChainOfThoughtInChat(CompanyAssetModel):
131
128
  if self.chain_of_thought is None:
132
129
  self.chain_of_thought = cot
133
130
  else:
134
- self.chain_of_thought += f"\n{cot}"
131
+ self.chain_of_thought += f"\n{cot}"
132
+
@@ -7,16 +7,15 @@ independently without loading entire chat documents.
7
7
  """
8
8
 
9
9
  from letschatty.models.analytics.events.base import EventType
10
- from enum import StrEnum
11
10
  from pydantic import BaseModel, Field, field_validator, ConfigDict
12
11
  from datetime import datetime
13
12
  from zoneinfo import ZoneInfo
14
13
  from typing import Optional, ClassVar, List, Dict, Any
14
+ from enum import StrEnum
15
15
  from letschatty.models.base_models.chatty_asset_model import CompanyAssetModel, ChattyAssetPreview
16
16
  from letschatty.models.utils.types.identifier import StrObjectId
17
17
  from .chain_of_thought_in_chat import ChainOfThoughtInChatTrigger
18
18
  from .chatty_ai_mode import ChattyAIMode
19
- from .statuses import DataCollectionStatus, PreQualifyStatus
20
19
  import logging
21
20
 
22
21
  logger = logging.getLogger(__name__)
@@ -46,6 +45,38 @@ class HumanInterventionReason(StrEnum):
46
45
  SOMETHING_WENT_WRONG = "something_went_wrong"
47
46
 
48
47
 
48
+ class DataCollectionStatus(StrEnum):
49
+ """
50
+ Status of data collection for the AI agent in this chat.
51
+ Only tracks field collection, not qualification status.
52
+
53
+ - COLLECTING: Still collecting data from the user
54
+ - MANDATORY_COMPLETED: All mandatory fields have been collected
55
+ - ALL_COMPLETED: All fields (mandatory + optional) have been collected
56
+ - CANCELLED: Data collection was cancelled
57
+ """
58
+ COLLECTING = "collecting"
59
+ MANDATORY_COMPLETED = "mandatory_completed"
60
+ ALL_COMPLETED = "all_completed"
61
+ CANCELLED = "cancelled"
62
+
63
+
64
+ class PreQualifyStatus(StrEnum):
65
+ """
66
+ Status of pre-qualification for the AI agent in this chat.
67
+ Separate from data collection - tracks qualification evaluation.
68
+
69
+ - PENDING: Waiting for data collection to complete
70
+ - EVALUATING: Data collected, evaluating acceptance criteria
71
+ - QUALIFIED: User met acceptance criteria
72
+ - UNQUALIFIED: User did NOT meet acceptance criteria
73
+ """
74
+ PENDING = "pending"
75
+ EVALUATING = "evaluating"
76
+ QUALIFIED = "qualified"
77
+ UNQUALIFIED = "unqualified"
78
+
79
+
49
80
  class HumanIntervention(BaseModel):
50
81
  """
51
82
  Reason for human intervention
@@ -321,3 +352,4 @@ class ChattyAIAgentInChat(CompanyAssetModel):
321
352
  """Cancel data collection"""
322
353
  self.data_collection_status = DataCollectionStatus.CANCELLED
323
354
  self.updated_at = datetime.now(ZoneInfo("UTC"))
355
+
@@ -4,13 +4,12 @@ from enum import StrEnum
4
4
  from pydantic_core.core_schema import str_schema
5
5
 
6
6
  from letschatty.models.company.assets.ai_agents_v2.chain_of_thought_in_chat import ChainOfThoughtInChatTrigger
7
- from letschatty.models.company.assets.ai_agents_v2.statuses import DataCollectionStatus, PreQualifyStatus
8
7
  from ...utils.types.identifier import StrObjectId
9
8
  from datetime import datetime
10
9
  from zoneinfo import ZoneInfo
11
10
  from bson import ObjectId
12
11
  import json
13
- from typing import Dict, Any, Optional, List
12
+ from typing import Dict, Any, Optional
14
13
  from letschatty.models.utils.types.serializer_type import SerializerType
15
14
  from letschatty.models.company.assets.ai_agents_v2.chatty_ai_mode import ChattyAIMode
16
15
 
@@ -67,8 +66,7 @@ class AssignedAssetToChat(BaseModel):
67
66
 
68
67
 
69
68
  class SaleAssignedToChat(AssignedAssetToChat):
70
- product_id: Optional[StrObjectId] = Field(default=None)
71
- product_ids: List[StrObjectId] = Field(default_factory=list)
69
+ product_id: StrObjectId = Field(frozen=True)
72
70
 
73
71
  class ContactPointAssignedToChat(AssignedAssetToChat):
74
72
  source_id: StrObjectId = Field(frozen=True)
@@ -77,14 +75,6 @@ class ChattyAIAgentAssignedToChat(AssignedAssetToChat):
77
75
  mode: ChattyAIMode = Field(default=ChattyAIMode.OFF)
78
76
  requires_human_intervention: bool = Field(default=False)
79
77
  is_processing: bool = Field(default=False)
80
- data_collection_status: Optional[DataCollectionStatus] = Field(
81
- default=None,
82
- description="Status of data collection for pre-qualification"
83
- )
84
- pre_qualify_status: Optional[PreQualifyStatus] = Field(
85
- default=None,
86
- description="Status of pre-qualification"
87
- )
88
78
  last_call_started_at: Optional[datetime] = Field(default=None, description="The timestamp of the get chat with prompt (the moment n8n started processing the call)")
89
79
  trigger_timestamp: Optional[datetime] = Field(default=None, description="The timestamp of the trigger that started the call, if it's a manual trigger, it will be the timestamp of the manual trigger, if it's a follow up, it will be the timestamp of the follow up, if it's a user message, it will be the timestamp of the user message")
90
80
  last_call_cot_id: Optional[StrObjectId] = Field(default=None)
@@ -5,7 +5,7 @@ from ...utils.types.identifier import StrObjectId
5
5
 
6
6
  class Sale(CompanyAssetModel):
7
7
  chat_id: StrObjectId
8
- product_id: Optional[StrObjectId] = Field(default=None)
8
+ product_id: StrObjectId
9
9
  quantity: int
10
10
  total_amount: float
11
11
  currency: str
@@ -16,7 +16,7 @@ class Sale(CompanyAssetModel):
16
16
  creator_id: StrObjectId
17
17
 
18
18
  class SaleRequest(BaseModel):
19
- product_id: Optional[StrObjectId] = Field(default=None)
19
+ product_id: StrObjectId
20
20
  quantity: int
21
21
  creator_id: StrObjectId
22
22
  total_amount: float
@@ -36,4 +36,4 @@ class SaleRequest(BaseModel):
36
36
  "paid_amount": 100,
37
37
  "installments": 1,
38
38
  "details": {}
39
- }
39
+ }
@@ -1,4 +1,3 @@
1
- from letschatty.models.company.integrations.shopify.company_shopify_integration import ShopifyIntegration
2
1
  from pydantic import Field, ConfigDict, field_validator, SecretStr, model_validator
3
2
  from typing import Optional, List, Dict
4
3
 
@@ -35,7 +34,7 @@ class EmpresaModel(ChattyAssetModel):
35
34
  continuous_conversation_template_name: Optional[str] = Field(default = None, description="The name of the continuous conversation template")
36
35
  default_follow_up_strategy_id: Optional[StrObjectId] = Field(default = None, description="The id of the default follow up strategy")
37
36
  messaging_settings: MessagingSettings = Field(default = MessagingSettings(), description="The messaging settings for the company")
38
- shopify_integration: ShopifyIntegration = Field(default = ShopifyIntegration(), description="The Shopify integration for the company")
37
+
39
38
 
40
39
  model_config = ConfigDict(
41
40
  validate_by_name=True,
@@ -1,4 +1,4 @@
1
- from pydantic import BaseModel, Field, field_validator, ConfigDict
1
+ from pydantic import BaseModel, Field, field_validator
2
2
  from typing import Optional, Any, ClassVar, List
3
3
  from letschatty.models.base_models.chatty_asset_model import CompanyAssetModel, ChattyAssetPreview
4
4
  import re
@@ -212,11 +212,7 @@ class CollectedData(BaseModel):
212
212
  name: Optional[str] = Field(default=None, description="Customer's name")
213
213
  email: Optional[str] = Field(default=None, description="Customer's email address")
214
214
  phone: Optional[str] = Field(default=None, description="Customer's phone number")
215
- document_id: Optional[str] = Field(
216
- default=None,
217
- alias="dni",
218
- description="Customer's DNI/ID number"
219
- )
215
+ document_id: Optional[str] = Field(default=None, description="Customer's DNI/ID number")
220
216
 
221
217
  # Generic key-value store for any other collected fields
222
218
  additional_fields: dict[str, Any] = Field(
@@ -224,9 +220,6 @@ class CollectedData(BaseModel):
224
220
  description="Additional collected fields as key-value pairs"
225
221
  )
226
222
 
227
- model_config = ConfigDict(
228
- populate_by_name=True
229
- )
230
223
 
231
224
  @classmethod
232
225
  def example(cls) -> dict:
@@ -28,10 +28,9 @@ from ...models.chat.scheduled_messages import ScheduledMessageStatus
28
28
  from ...models.utils.types.identifier import StrObjectId
29
29
  from ...models.utils.custom_exceptions.custom_exceptions import AssetAlreadyAssigned, MessageNotFoundError, NotFoundError, MessageAlreadyInChat, MetaErrorNotification, ChatAlreadyAssigned, AlreadyCompleted, ErrorToMantainSafety
30
30
  from ..factories.messages.central_notification_factory import CentralNotificationFactory
31
- from ..factories.messages.chatty_message_factory import from_message_draft
32
31
  from ...models.messages.chatty_messages.base.message_draft import ChattyContentAudio, MessageDraft
33
32
  from ...models.messages.chatty_messages.schema.chatty_content.content_central import CentralNotificationStatus
34
- from ...models.messages.chatty_messages.schema import ChattyContext, ChattyContentText
33
+ from ...models.messages.chatty_messages.schema import ChattyContext
35
34
  from ...models.utils.types.message_types import MessageType
36
35
  from .conversation_topics_service import ConversationTopicsService
37
36
  import logging
@@ -212,43 +211,6 @@ class ChatService:
212
211
  ChatService.add_central_notification_from_text(chat=chat, body=f"Agente de IA {chatty_ai_agent.name} actualizado en el chat {chat.id} por {execution_context.executor.name}", subtype=MessageSubtype.CHATTY_AI_AGENT_UPDATED)
213
212
  return chat.chatty_ai_agent
214
213
 
215
- @staticmethod
216
- def escalate_chatty_ai_agent(
217
- chat: Chat,
218
- execution_context: ExecutionContext,
219
- message: Optional[str] = None,
220
- reason: Optional[str] = None
221
- ) -> None:
222
- """
223
- Mark the chat's AI agent as requiring human intervention and add a central notification.
224
- """
225
- if chat.chatty_ai_agent and not chat.chatty_ai_agent.requires_human_intervention:
226
- chat.chatty_ai_agent.requires_human_intervention = True
227
- execution_context.set_event_time(datetime.now(tz=ZoneInfo("UTC")))
228
- body = "El chat fue escalado a un agente humano"
229
- if reason:
230
- body = f"{body}. Motivo: {reason}"
231
- ChatService.add_central_notification_from_text(
232
- chat=chat,
233
- body=body,
234
- subtype=MessageSubtype.CHATTY_AI_AGENT_NOTIFICATION,
235
- content_status=CentralNotificationStatus.WARNING,
236
- context=ChattyContext(chain_of_thought_id=execution_context.chain_of_thought_id)
237
- )
238
- if message:
239
- outgoing_context = ChattyContext(chain_of_thought_id=execution_context.chain_of_thought_id)
240
- outgoing_message = from_message_draft(
241
- MessageDraft(
242
- type=MessageType.TEXT,
243
- content=ChattyContentText(body=message),
244
- context=outgoing_context,
245
- subtype=MessageSubtype.NONE,
246
- is_incoming_message=False
247
- ),
248
- sent_by=execution_context.executor.id
249
- )
250
- ChatService.add_message(chat=chat, message=outgoing_message)
251
-
252
214
  @staticmethod
253
215
  def add_workflow_link(chat : Chat, link : LinkItem, flow:FlowPreview, execution_context: ExecutionContext, description: str, last_incoming_message_id: Optional[str] = None, next_call: Optional[datetime] = None) -> FlowStateAssignedToChat:
254
216
  """
@@ -304,46 +266,36 @@ class ChatService:
304
266
  return next((state for state in chat.flow_states if state.is_smart_follow_up), None)
305
267
 
306
268
  @staticmethod
307
- def create_sale(
308
- chat: Chat,
309
- execution_context: ExecutionContext,
310
- sale: Sale,
311
- product: Optional[Product],
312
- product_ids: Optional[List[StrObjectId]] = None,
313
- product_label: Optional[str] = None
314
- ) -> SaleAssignedToChat:
269
+ def create_sale(chat : Chat, execution_context: ExecutionContext, sale : Sale, product : Product) -> SaleAssignedToChat:
315
270
  """
316
271
  Add a sale to the chat.
317
272
  """
318
273
  if next((sale for sale in chat.client.sales if sale.asset_id == sale.id), None) is not None:
319
274
  raise AssetAlreadyAssigned(f"Sale with id {sale.id} already assigned to chat {chat.id}")
320
- label = product_label or (product.name if product else "multiples productos")
321
- assigned_product_ids = product_ids or ([product.id] if product else [])
322
275
  assigned_asset = SaleAssignedToChat(
323
276
  asset_type=ChatAssetType.SALE,
324
277
  asset_id=sale.id,
325
278
  assigned_at=sale.created_at,
326
279
  assigned_by=execution_context.executor.id,
327
- product_id=product.id if product else None,
328
- product_ids=assigned_product_ids
280
+ product_id=product.id
329
281
  )
330
282
  execution_context.set_event_time(assigned_asset.assigned_at)
331
283
  bisect.insort(chat.client.sales, assigned_asset)
332
- ChatService.create_highlight(chat=chat, execution_context=execution_context, highlight_data=HighlightRequestData(title=f"🛍️ Venta de {label}", description=f"Venta de {label} creada por {execution_context.executor.name}", starred=False, subtype=MessageSubtype.SALE_ADDED))
333
- ChatService.add_central_notification_from_text(chat=chat, body=f"Venta de {label} agregada al chat {chat.id} por {execution_context.executor.name}", subtype=MessageSubtype.SALE_ADDED)
284
+ ChatService.create_highlight(chat=chat, execution_context=execution_context, highlight_data=HighlightRequestData(title=f"🛍️ Venta de {product.name}", description=f"Venta de {product.name} creada por {execution_context.executor.name}", starred=False, subtype=MessageSubtype.SALE_ADDED))
285
+ ChatService.add_central_notification_from_text(chat=chat, body=f"Venta de {product.name} agregada al chat {chat.id} por {execution_context.executor.name}", subtype=MessageSubtype.SALE_ADDED)
334
286
  return assigned_asset
335
287
 
336
288
  @staticmethod
337
- def update_sale(chat: Chat, execution_context: ExecutionContext, sale: Sale, product_label: str) -> Sale:
289
+ def update_sale(chat : Chat, execution_context: ExecutionContext, sale : Sale, product : Product) -> Sale:
338
290
  """
339
291
  Update a sale for the chat.
340
292
  """
341
- ChatService.create_highlight(chat=chat, execution_context=execution_context, highlight_data=HighlightRequestData(title=f"🛍️ Venta actualizada de {product_label}", description=f"Venta de {product_label} actualizada por {execution_context.executor.name}", starred=False, subtype=MessageSubtype.SALE_UPDATED))
342
- ChatService.add_central_notification_from_text(chat=chat, body=f"Venta de {product_label} actualizada en el chat {chat.id} por {execution_context.executor.name}", subtype=MessageSubtype.SALE_UPDATED)
293
+ ChatService.create_highlight(chat=chat, execution_context=execution_context, highlight_data=HighlightRequestData(title=f"🛍️ Venta actualizada de {product.name}", description=f"Venta de {product.name} actualizada por {execution_context.executor.name}", starred=False, subtype=MessageSubtype.SALE_UPDATED))
294
+ ChatService.add_central_notification_from_text(chat=chat, body=f"Venta de {product.name} actualizada en el chat {chat.id} por {execution_context.executor.name}", subtype=MessageSubtype.SALE_UPDATED)
343
295
  return sale
344
296
 
345
297
  @staticmethod
346
- def delete_sale(chat: Chat, execution_context: ExecutionContext, sale_id: StrObjectId, product_label: str) -> SaleAssignedToChat:
298
+ def delete_sale(chat : Chat, execution_context: ExecutionContext, sale_id : StrObjectId, product : Product) -> SaleAssignedToChat:
347
299
  """
348
300
  Logically remove a sale from the chat.
349
301
  """
@@ -351,8 +303,8 @@ class ChatService:
351
303
  assigned_asset_to_remove = next(sale for sale in chat.client.sales if sale.asset_id == sale_id)
352
304
  chat.client.sales.remove(assigned_asset_to_remove)
353
305
  execution_context.set_event_time(datetime.now(tz=ZoneInfo("UTC")))
354
- ChatService.create_highlight(chat=chat, execution_context=execution_context, highlight_data=HighlightRequestData(title=f"🛍️ Venta eliminada de {product_label}", description=f"Venta de {product_label} eliminada por {execution_context.executor.name}", starred=False, subtype=MessageSubtype.SALE_DELETED))
355
- ChatService.add_central_notification_from_text(chat=chat, body=f"Venta de {product_label} eliminada del chat {chat.id} por {execution_context.executor.name}", subtype=MessageSubtype.SALE_DELETED)
306
+ ChatService.create_highlight(chat=chat, execution_context=execution_context, highlight_data=HighlightRequestData(title=f"🛍️ Venta eliminada de {product.name}", description=f"Venta de {product.name} eliminada por {execution_context.executor.name}", starred=False, subtype=MessageSubtype.SALE_DELETED))
307
+ ChatService.add_central_notification_from_text(chat=chat, body=f"Venta de {product.name} eliminada del chat {chat.id} por {execution_context.executor.name}", subtype=MessageSubtype.SALE_DELETED)
356
308
  return assigned_asset_to_remove
357
309
  except StopIteration:
358
310
  raise NotFoundError(message=f"Sale with id {sale_id} not found in chat {chat.id}")
@@ -897,13 +849,6 @@ class ChatService:
897
849
  chat.client.email = collected_data.email
898
850
  updated_fields.append("email")
899
851
 
900
- if collected_data.phone:
901
- if chat.client.lead_form_data is None:
902
- chat.client.lead_form_data = {}
903
- if chat.client.lead_form_data.get("phone") != collected_data.phone:
904
- chat.client.lead_form_data["phone"] = collected_data.phone
905
- updated_fields.append("phone")
906
-
907
852
  if collected_data.document_id and chat.client.document_id != collected_data.document_id:
908
853
  chat.client.document_id = collected_data.document_id
909
854
  updated_fields.append("document_id")
@@ -921,18 +866,11 @@ class ChatService:
921
866
  execution_context.set_event_time(datetime.now(tz=ZoneInfo("UTC")))
922
867
  logger.info(f"Updated collected data for chat {chat.id}: {', '.join(updated_fields)}")
923
868
 
924
- field_label_map = {
925
- "name": "nombre",
926
- "email": "email",
927
- "phone": "telefono",
928
- "document_id": "dni",
929
- }
930
- display_fields = [field_label_map.get(field, field) for field in updated_fields]
931
869
  ChatService.add_central_notification_from_text(
932
870
  chat=chat,
933
- body=f"Datos del cliente recopilados: {', '.join(display_fields)}",
871
+ body=f"Collected customer data: {', '.join(updated_fields)}",
934
872
  subtype=MessageSubtype.CLIENT_INFO_UPDATED,
935
873
  context=ChattyContext(chain_of_thought_id=execution_context.chain_of_thought_id)
936
874
  )
937
875
 
938
- return chat.client.lead_form_data
876
+ return chat.client.lead_form_data
@@ -415,6 +415,30 @@ class EventFactory:
415
415
  events.append(event)
416
416
  return events
417
417
 
418
+ @staticmethod
419
+ def chat_client_updated_events(chat_with_assets: ChatWithAssets, company_info: EmpresaModel, trace_id: str, executor_type: ExecutorType, executor_id: StrObjectId, event_type: EventType, time: datetime, company_snapshot: Optional[CompanyChatsSnapshot] = None, agent_snapshot: Optional[AgentChatsSnapshot] = None) -> List[Event]:
420
+ events = []
421
+ base_data = EventFactory._create_base_customer_event_data(
422
+ chat_with_assets=chat_with_assets,
423
+ company_info=company_info,
424
+ executor_type=executor_type,
425
+ executor_id=executor_id,
426
+ company_snapshot=company_snapshot,
427
+ agent_snapshot=agent_snapshot
428
+ )
429
+ event = ChatClientEvent(
430
+ specversion=EventFactory.package_version(),
431
+ type=event_type,
432
+ time=time,
433
+ data=base_data,
434
+ source="chatty_api.webapp",
435
+ company_id=company_info.id,
436
+ frozen_company_name=company_info.frozen_name,
437
+ trace_id=trace_id
438
+ )
439
+ events.append(event)
440
+ return events
441
+
418
442
  @staticmethod
419
443
  def chat_created_events(chat_with_assets: ChatWithAssets, company_info: EmpresaModel, trace_id: str,executor_type: ExecutorType, executor_id: StrObjectId, event_type: EventType, time: datetime, contact_point_id: Optional[StrObjectId], created_from: ChatCreatedFrom, company_snapshot: Optional[CompanyChatsSnapshot] = None, agent_snapshot: Optional[AgentChatsSnapshot] = None) -> List[Event]:
420
444
  events = []
@@ -10,10 +10,6 @@ if TYPE_CHECKING:
10
10
 
11
11
  class SourcesAndTopicsValidator:
12
12
  """This class provides methods to validate sources and topics."""
13
- @staticmethod
14
- def normalize_source_name(name: str) -> str:
15
- return name.strip().lower()
16
-
17
13
  @staticmethod
18
14
  def source_validation_check(sources : Dict[str,Source], topics : Dict[str,Topic], source : Source, existing_source_id : str | None = None) -> None:
19
15
  """Checks validation of a source against other sources and topics."""
@@ -32,16 +28,9 @@ class SourcesAndTopicsValidator:
32
28
  """This method checks that no duplicated source is created.
33
29
  For Pure Ads, it checks that the ad_id is unique and doesn't exist already.
34
30
  For Other Sources, it checks that exact trigger doesn't exist already. """
35
- normalized_name = SourcesAndTopicsValidator.normalize_source_name(source.name)
36
- existing_source_name = None
37
- if existing_source_id and existing_source_id in sources:
38
- existing_source_name = SourcesAndTopicsValidator.normalize_source_name(sources[existing_source_id].name)
39
- should_check_name = existing_source_name is None or normalized_name != existing_source_name
40
31
  for source_id, source_to_check in sources.items():
41
32
  if source_id == existing_source_id:
42
33
  continue
43
- if should_check_name and SourcesAndTopicsValidator.normalize_source_name(source_to_check.name) == normalized_name:
44
- raise ConflictedSource(f":warning: *Conflict while adding source: Name already exists* \n New source '{source.name}' \n- Id {source.id} \n Existing source '{source_to_check.name}' \n- Id {source_to_check.id}", conflicting_source_id=source_to_check.id)
45
34
  if source == source_to_check: #type: ignore
46
35
  if isinstance(source, OtherSource):
47
36
  raise ConflictedSource(f":warning: *Conflict while adding source: Trigger already exists* \n New source '{source.name}' \n- Id {source.id} \n- Trigger {source.trigger[:30]} \n Existing source '{source_to_check.name}' \n- Id {source_to_check.id} \n- Trigger '{source_to_check.trigger[:30]}'", conflicting_source_id=source_to_check.id)
@@ -1,9 +0,0 @@
1
- from .assets import *
2
- from .empresa import EmpresaModel
3
- from .form_field import FormField, FormFieldPreview, CollectedData, SystemFormFields
4
- from .CRM.funnel import Funnel, FunnelPreview, ChatFunnel, StageTransition, FunnelStatus
5
- from .integrations.product_sync_status import ProductSyncStatus
6
- from .integrations.sync_status_enum import SyncStatusEnum
7
- from .integrations.shopify.shopify_webhook_topics import ShopifyWebhookTopic
8
- from .integrations.shopify.company_shopify_integration import ShopifyIntegration
9
- from .integrations.shopify.shopify_product_sync_status import ShopifyProductSyncStatus, ShopifyProductSyncStatusEnum
@@ -1,33 +0,0 @@
1
- from enum import StrEnum
2
-
3
-
4
- class DataCollectionStatus(StrEnum):
5
- """
6
- Status of data collection for the AI agent in this chat.
7
- Only tracks field collection, not qualification status.
8
-
9
- - COLLECTING: Still collecting data from the user
10
- - MANDATORY_COMPLETED: All mandatory fields have been collected
11
- - ALL_COMPLETED: All fields (mandatory + optional) have been collected
12
- - CANCELLED: Data collection was cancelled
13
- """
14
- COLLECTING = "collecting"
15
- MANDATORY_COMPLETED = "mandatory_completed"
16
- ALL_COMPLETED = "all_completed"
17
- CANCELLED = "cancelled"
18
-
19
-
20
- class PreQualifyStatus(StrEnum):
21
- """
22
- Status of pre-qualification for the AI agent in this chat.
23
- Separate from data collection - tracks qualification evaluation.
24
-
25
- - PENDING: Waiting for data collection to complete
26
- - EVALUATING: Data collected, evaluating acceptance criteria
27
- - QUALIFIED: User met acceptance criteria
28
- - UNQUALIFIED: User did NOT meet acceptance criteria
29
- """
30
- PENDING = "pending"
31
- EVALUATING = "evaluating"
32
- QUALIFIED = "qualified"
33
- UNQUALIFIED = "unqualified"
@@ -1,28 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from datetime import datetime
4
- from typing import ClassVar, Optional
5
-
6
- from pydantic import Field
7
-
8
- from letschatty.models.company.integrations.sync_status_enum import SyncStatusEnum
9
- from letschatty.models.base_models import CompanyAssetModel
10
-
11
-
12
- class ProductSyncStatus(CompanyAssetModel):
13
- """Generic product sync status for any e-commerce integration."""
14
-
15
- COLLECTION: ClassVar[str] = "product_sync_statuses"
16
-
17
- integration_type: str = Field(
18
- description="Integration type (shopify, tiendanube, etc.)"
19
- )
20
- status: SyncStatusEnum = Field(description="Current sync status")
21
-
22
- products_created: int = Field(default=0)
23
- products_updated: int = Field(default=0)
24
-
25
- name: str = Field(default="")
26
-
27
- finished_at: Optional[datetime] = Field(default=None)
28
-