"""Maximum number of retries to make when generating."""
    @property
    def lc_secrets(self) -> Dict[str, str]:
        return {"fireworks_api_key": "FIREWORKS_API_KEY"}
    @property
    def lc_serializable(self) -> bool:
        return True
    def __new__(cls, **data: Any) -> Any:
        """Initialize the Fireworks object."""
        data.get("model_id", "")
        return super().__new__(cls)
    class Config:
        """Configuration for this pydantic object."""
        allow_population_by_field_name = True
    @root_validator()
    def validate_environment(cls, values: Dict) -> Dict:
        """Validate that api key and python package exists in environment."""
        values["fireworks_api_key"] = get_from_dict_or_env(
            values, "fireworks_api_key", "FIREWORKS_API_KEY"
        )
        return values
    def _generate(
        self,
        prompts: List[str],
        stop: Optional[List[str]] = None,
        run_manager: Optional[CallbackManagerForLLMRun] = None,
        **kwargs: Any,
    ) -> LLMResult:
        """Call out to Fireworks endpoint with k unique prompts.
        Args:
            prompts: The prompts to pass into the model.
            stop: Optional list of stop words to use when generating.
        Returns:
            The full LLM output.
        """
        params = {"model": self.model_id}
        params = {**params, **kwargs}
        sub_prompts = self.get_batch_prompts(params, prompts, stop)
        choices = []
        token_usage: Dict[str, int] = {}