|
8 | 8 | from copy import deepcopy |
9 | 9 | from call_processing.log.logger import logger |
10 | 10 | from call_processing.services.tool_wrapper_service import ToolWrapperFactory |
| 11 | +from call_processing.utils import get_current_ist_time_str |
11 | 12 |
|
12 | 13 | # Pipecat core imports |
13 | 14 | from pipecat.adapters.schemas.tools_schema import ToolsSchema |
|
49 | 50 | from call_processing.services.stt_service import STTServiceFactory |
50 | 51 | from call_processing.services.tts_service import TTSServiceFactory |
51 | 52 | from call_processing.services.llm_service import LLMServiceFactory |
52 | | -from call_processing.services.conversation_completion_tool import ( |
53 | | - ConversationCompletionToolFactory, |
54 | | -) |
| 53 | + |
| 54 | +# from call_processing.services.conversation_completion_tool import ( |
| 55 | +# ConversationCompletionToolFactory, |
| 56 | +# ) |
55 | 57 | from call_processing.constants.language_config import ( |
56 | 58 | LANGUAGE_INSTRUCTIONS, |
57 | 59 | ) |
@@ -300,7 +302,7 @@ async def run_conversation( |
300 | 302 | # Create initial messages with system prompt |
301 | 303 | base_system_prompt = ( |
302 | 304 | f'Customer phone number: {customer_number}\n' |
303 | | - + agent_config['system_prompt'] |
| 305 | + f'{get_current_ist_time_str()}\n' + agent_config['system_prompt'] |
304 | 306 | ) |
305 | 307 |
|
306 | 308 | # Add language instruction for default language if multi-language |
@@ -375,34 +377,34 @@ async def run_conversation( |
375 | 377 | logger.info('Registered language detection tool with LLM') |
376 | 378 |
|
377 | 379 | # Register conversation completion tool |
378 | | - conversation_completion_func = ( |
379 | | - ConversationCompletionToolFactory.create_conversation_completion_tool( |
380 | | - task_container=task_container |
381 | | - ) |
382 | | - ) |
383 | | - llm.register_function('end_conversation', conversation_completion_func) |
| 380 | + # conversation_completion_func = ( |
| 381 | + # ConversationCompletionToolFactory.create_conversation_completion_tool( |
| 382 | + # task_container=task_container |
| 383 | + # ) |
| 384 | + # ) |
| 385 | + # llm.register_function('end_conversation', conversation_completion_func) |
384 | 386 | logger.info('Registered conversation completion tool with LLM') |
385 | 387 |
|
386 | 388 | # Create FunctionSchema for conversation completion |
387 | | - end_conversation_schema = FunctionSchema( |
388 | | - name='end_conversation', |
389 | | - description=( |
390 | | - 'Call this function when the user indicates they want to end the conversation. ' |
391 | | - 'This includes goodbye phrases, expressions of completion, or any indication ' |
392 | | - 'that the user wants to hang up or finish the call. Examples: "goodbye", "bye", ' |
393 | | - '"thank you", "that\'s all", "I\'m done", etc.' |
394 | | - ), |
395 | | - properties={ |
396 | | - 'farewell_message': { |
397 | | - 'type': 'string', |
398 | | - 'description': ( |
399 | | - 'Optional custom farewell message to say to the user before ending. ' |
400 | | - 'If not provided, uses default: "Thank you for using our service! Goodbye!"' |
401 | | - ), |
402 | | - } |
403 | | - }, |
404 | | - required=[], |
405 | | - ) |
| 389 | + # end_conversation_schema = FunctionSchema( |
| 390 | + # name='end_conversation', |
| 391 | + # description=( |
| 392 | + # 'Call this function when the user indicates they want to end the conversation. ' |
| 393 | + # 'This includes goodbye phrases, expressions of completion, or any indication ' |
| 394 | + # 'that the user wants to hang up or finish the call. Examples: "goodbye", "bye", ' |
| 395 | + # '"thank you", "that\'s all", "I\'m done", etc.' |
| 396 | + # ), |
| 397 | + # properties={ |
| 398 | + # 'farewell_message': { |
| 399 | + # 'type': 'string', |
| 400 | + # 'description': ( |
| 401 | + # 'Optional custom farewell message to say to the user before ending. ' |
| 402 | + # 'If not provided, uses default: "Thank you for using our service! Goodbye!"' |
| 403 | + # ), |
| 404 | + # } |
| 405 | + # }, |
| 406 | + # required=[], |
| 407 | + # ) |
406 | 408 |
|
407 | 409 | # Create FunctionSchema for language detection (if multi-language) |
408 | 410 | language_detection_schemas = [] |
@@ -435,7 +437,8 @@ async def run_conversation( |
435 | 437 |
|
436 | 438 | # Combine all FunctionSchema objects for ToolsSchema |
437 | 439 | all_function_schemas = ( |
438 | | - [end_conversation_schema] + language_detection_schemas + function_schemas |
| 440 | + # [end_conversation_schema] + |
| 441 | + language_detection_schemas + function_schemas |
439 | 442 | ) |
440 | 443 | tools_schema = ToolsSchema(standard_tools=all_function_schemas) |
441 | 444 |
|
|
0 commit comments