llm_output=llm_output,
        )
    @property
    def _llm_type(self) -> str:
        """Return type of llm."""
        return "fireworks-chat"
[docs]class Fireworks(BaseFireworks):
    """Wrapper around Fireworks large language models.
    To use, you should have the ``fireworks`` 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 fireworks
            llm = Fireworks(model_id="fireworks-llama-v2-13b")
    """
[docs]def update_token_usage(
    keys: Set[str], response: Dict[str, Any], token_usage: Dict[str, Any]
) -> None:
    """Update token usage."""
    _keys_to_use = keys.intersection(response)
    for _key in _keys_to_use:
        if _key not in token_usage:
            token_usage[_key] = response["usage"][_key]
        else:
            token_usage[_key] += response["usage"][_key]
[docs]def execute(
    prompt: str,
    model: str,
    api_key: Optional[str],
    max_tokens: int = 256,
    temperature: float = 0.0,
    top_p: float = 1.0,
) -> Any:
    """Execute LLM query"""
    requestUrl = "https://api.fireworks.ai/inference/v1/completions"
    requestBody = {
        "model": model,