letschatty 0.4.347__py3-none-any.whl → 0.4.348__py3-none-any.whl

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.
@@ -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
@@ -213,12 +212,7 @@ class ChatService:
213
212
  return chat.chatty_ai_agent
214
213
 
215
214
  @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:
215
+ def escalate_chatty_ai_agent(chat: Chat, execution_context: ExecutionContext, message: Optional[str] = None) -> None:
222
216
  """
223
217
  Mark the chat's AI agent as requiring human intervention and add a central notification.
224
218
  """
@@ -226,8 +220,8 @@ class ChatService:
226
220
  chat.chatty_ai_agent.requires_human_intervention = True
227
221
  execution_context.set_event_time(datetime.now(tz=ZoneInfo("UTC")))
228
222
  body = "El chat fue escalado a un agente humano"
229
- if reason:
230
- body = f"{body}. Motivo: {reason}"
223
+ if message:
224
+ body = f"{body}. Motivo: {message}"
231
225
  ChatService.add_central_notification_from_text(
232
226
  chat=chat,
233
227
  body=body,
@@ -235,19 +229,6 @@ class ChatService:
235
229
  content_status=CentralNotificationStatus.WARNING,
236
230
  context=ChattyContext(chain_of_thought_id=execution_context.chain_of_thought_id)
237
231
  )
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
232
 
252
233
  @staticmethod
253
234
  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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: letschatty
3
- Version: 0.4.347
3
+ Version: 0.4.348
4
4
  Summary: Models and custom classes to work across the Chattyverse
5
5
  License: MIT
6
6
  Author: Axel
@@ -231,7 +231,7 @@ letschatty/services/ai_agents/tool_descriptions/human_handover.json,sha256=-b3l_
231
231
  letschatty/services/ai_agents/tool_descriptions.py,sha256=MMFhcgEl6Z7k8BUv3Yx1pCxHzIjc8HD93S0uM5OPj8Y,105
232
232
  letschatty/services/ai_components_service.py,sha256=QUb-NdzHj4nPmnceVSQ9Pe3swFWUrkUFKzDZeuP0b5o,3762
233
233
  letschatty/services/chat/chat_extractors.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
234
- letschatty/services/chat/chat_service.py,sha256=UKmFpLJaoK7SHC2neNgGFnP9PYjUa03H2cVkplfSI9A,50209
234
+ letschatty/services/chat/chat_service.py,sha256=75ebdL9C1k4NU_zfTsGqSi31H0Gv1yqB-IOHJK6GyQY,49439
235
235
  letschatty/services/chat/client_service.py,sha256=TtlG0GJDqx6YemfueiJzAtMNk_udnPhg0MJG0bKwnk8,1097
236
236
  letschatty/services/chat/conversation_topics_service.py,sha256=jvIkpHTCz0JKXui3n_BRs6UQ-TB3x7DrQsnX2zUVFVw,2461
237
237
  letschatty/services/chatty_assets/__init__.py,sha256=quOXMGvcDVRkbeaGfCQliFfZzis5m1wrfJkHqDkWRx8,132
@@ -276,7 +276,7 @@ letschatty/services/template_campaigns/template_campaign_service.py,sha256=jORgD
276
276
  letschatty/services/users/agent_service.py,sha256=hIkUUJ1SpkKbh5_uo4i2CeqGtuMTjU7tSV8k5J7WPG4,279
277
277
  letschatty/services/users/user_factory.py,sha256=FCB9uiAfjMeYfh4kMdx5h8VDHJ8MCsD-uaxW3X3KaWM,6681
278
278
  letschatty/services/validators/analytics_validator.py,sha256=6ejecLcif2i1C5trUo1qQgp8vKr9WchdljFZ5GzB2i4,7239
279
- letschatty-0.4.347.dist-info/LICENSE,sha256=EClLu_bO2HBLDcThowIwfaIg5EOwIYhpRsBJjVEk92A,1197
280
- letschatty-0.4.347.dist-info/METADATA,sha256=XBq4h1YtuUJqunaMbK96HeCgM3ZYMO7WeuRZXugTVYw,3283
281
- letschatty-0.4.347.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
282
- letschatty-0.4.347.dist-info/RECORD,,
279
+ letschatty-0.4.348.dist-info/LICENSE,sha256=EClLu_bO2HBLDcThowIwfaIg5EOwIYhpRsBJjVEk92A,1197
280
+ letschatty-0.4.348.dist-info/METADATA,sha256=v718GGEk56rt4dRJa4zpho6WWar_mileYNkNKqDArzk,3283
281
+ letschatty-0.4.348.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
282
+ letschatty-0.4.348.dist-info/RECORD,,