# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class LlmUsage(object):
    _types = {
        "prompt_tokens": int,
        "completion_tokens": int,
        "total_tokens": int,
    }

    def __init__(self, d=None):
        self.prompt_tokens: Optional[int] = None
        self.completion_tokens: Optional[int] = None
        self.total_tokens: Optional[int] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "LlmUsageBuilder":
        return LlmUsageBuilder()


class LlmUsageBuilder(object):
    def __init__(self) -> None:
        self._llm_usage = LlmUsage()

    def prompt_tokens(self, prompt_tokens: int) -> "LlmUsageBuilder":
        self._llm_usage.prompt_tokens = prompt_tokens
        return self

    def completion_tokens(self, completion_tokens: int) -> "LlmUsageBuilder":
        self._llm_usage.completion_tokens = completion_tokens
        return self

    def total_tokens(self, total_tokens: int) -> "LlmUsageBuilder":
        self._llm_usage.total_tokens = total_tokens
        return self

    def build(self) -> "LlmUsage":
        return self._llm_usage
