<filename>samples/python-azurefunction/SendMessageToKafka/__init__.py
import logging
import json
import azure.functions as func

def main(args, messages: func.Out[bytes]) -> None:
    logging.info('Python processed a SendMessageToKafka request from the Dapr Runtime.')
    messages.set(json.dumps({"data": args}))

<filename>samples/python-azurefunction/SendMessageToKafka/__init__.py
import logging
import json
import azure.functions as func

def main(args, messages: func.Out[bytes]) -> None:
    logging.info('Python processed a SendMessageToKafka request from the Dapr Runtime.')
    messages.set(json.dumps({"data": args}))
