Untitled

 avatar
unknown
plain_text
2 months ago
1.3 kB
2
Indexable
assistant = MultimodalAgent(model=model, fnc_ctx=SystemAssistantFunction())
    tmp = SystemAssistantFunction()

    @assistant.on("function_calls_finished")
    def on_function_calls_finished(called_functions: list[agents.llm.CalledFunction]):
        lkapi = LiveKitAPI()
        if len(called_functions) == 0:
            return
        function_name=called_functions[0].call_info.function_info.name
        print("function_name", function_name)
        if function_name == "end_call":
            print('The end_call event is triggered')
            # urgency_result = function.result
            asyncio.create_task(lkapi.room.delete_room(DeleteRoomRequest(
                room=ctx.room.name
            )))
        elif function_name == "book_appointment":
            email = called_functions[0].call_info.arguments.get("email")
            if email:
                # asyncio.create_task(follow_up_appointment(email))
                print('asyncio.create_task(follow_up_appointment(email))')
        elif function_name == "analyze_dental_image":
            user_instruction = called_functions[0].call_info.arguments.get("user_msg")
            # asyncio.create_task(_answer(user_instruction, use_image=True))
            print('asyncio.create_task(_answer(user_instruction, use_image=True))')
Editor is loading...
Leave a Comment