def _trim_batch_response(self, result_str: str) -> str:
        """Trim the resulting response from a batch request by removing provided prompt and extra generated text."""
        # extract the generated part of the prompt
        split = result_str.split("[/INST]", 1)
        generated = split[-1]
        end_token = generated.find("</s>")
        if end_token == -1:
            return generated
        return generated[:end_token].strip()
Trim the resulting response from a batch request by removing provided prompt and extra generated text.
llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/utils.py