if stop is not None:
            if "stop" in params:
                raise ValueError("`stop` found in both the input and default params.")
        sub_prompts = [
            prompts[i : i + self.batch_size]
            for i in range(0, len(prompts), self.batch_size)
        ]
        return sub_prompts
[docs]    def create_llm_result(
        self, choices: Any, prompts: List[str], token_usage: Dict[str, int]
    ) -> LLMResult:
        """Create the LLMResult from the choices and prompts."""
        generations = []
        for i, _ in enumerate(prompts):
            sub_choices = choices[i : (i + 1)]
            generations.append(
                [
                    Generation(
                        text=choice,
                    )
                    for choice in sub_choices
                ]
            )
        llm_output = {"token_usage": token_usage, "model_id": self.model_id}
        return LLMResult(generations=generations, llm_output=llm_output)
    @property
    def _llm_type(self) -> str:
        """Return type of llm."""
        return "fireworks"
[docs]class FireworksChat(BaseLLM):
    """Wrapper around Fireworks Chat large language models.
    To use, you should have the ``fireworksai`` python package installed, and the
    environment variable ``FIREWORKS_API_KEY`` set with your API key.
    Any parameters that are valid to be passed to the fireworks.create
    call can be passed in, even if not explicitly saved on this class.
    Example:
        .. code-block:: python
            from langchain.llms import FireworksChat