(self)
| 2069 | return HistoryCompactContextWindow(current_tokens, messages_length, token_limit, conversation_tokens, system_tokens, tool_definitions_tokens) |
| 2070 | |
| 2071 | def to_dict(self) -> dict: |
| 2072 | result: dict = {} |
| 2073 | result["currentTokens"] = from_int(self.current_tokens) |
| 2074 | result["messagesLength"] = from_int(self.messages_length) |
| 2075 | result["tokenLimit"] = from_int(self.token_limit) |
| 2076 | if self.conversation_tokens is not None: |
| 2077 | result["conversationTokens"] = from_union([from_int, from_none], self.conversation_tokens) |
| 2078 | if self.system_tokens is not None: |
| 2079 | result["systemTokens"] = from_union([from_int, from_none], self.system_tokens) |
| 2080 | if self.tool_definitions_tokens is not None: |
| 2081 | result["toolDefinitionsTokens"] = from_union([from_int, from_none], self.tool_definitions_tokens) |
| 2082 | return result |
| 2083 | |
| 2084 | # Experimental: this type is part of an experimental API and may change or be removed. |
| 2085 | @dataclass |
nothing calls this directly
no test coverage detected