def _prepare_headers(
        self,
        stream: bool,
        headers: Optional[Dict[str, str]] = None,
    ) -> Dict[str, str]:
        """
        Construct and return the headers for a request.

        Args:
            stream (bool): Whether to use streaming for the response.
            headers (Optional[Dict[str, str]]): HTTP headers to include in the request.

        Returns:
            Dict[str, str]: The prepared headers.

        """
        default_headers = {
            "Content-Type": "application/json",
            "Accept": "text/event-stream" if stream else "application/json",
        }
        if stream:
            default_headers["enable-streaming"] = "true"
        if headers:
            default_headers.update(headers)

        logger.debug(f"Prepared headers: {default_headers}")
        return default_headers

        Construct and return the headers for a request.

        Args:
            stream (bool): Whether to use streaming for the response.
            headers (Optional[Dict[str, str]]): HTTP headers to include in the request.

        Returns:
            Dict[str, str]: The prepared headers.

        
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/client.py