def _generate(
        self, knowledge, messages, system_prompt, **kwargs
    ) -> CompletionResponse:
        """
        Generate completion for the given prompt.
        """
        raw_message = self.client.generate.create(
            messages=messages,
            knowledge=knowledge or [],
            model=self.model,
            system_prompt=system_prompt,
            avoid_commentary=self.avoid_commentary,
            temperature=kwargs.get("temperature", 0.0),
            max_new_tokens=kwargs.get("max_tokens", 1024),
            top_p=kwargs.get("top_p", 1),
        )
        return raw_message.response

        Generate completion for the given prompt.
        
llama-index-integrations/llms/llama-index-llms-contextual/llama_index/llms/contextual/base.py