def check_data_or_url()

in aidial_sdk/chat_completion/chunks.py [0:0]


    def check_data_or_url(cls, values):
        data, url = values.get("data"), values.get("url")

        if data is None and url is None:
            raise ValueError("Trying to add attachment without data and url")
        if data is not None and url is not None:
            raise ValueError("Trying to add attachment with data and url")

        return values