Skip to content

Commit 685eb8b

Browse files
authored
fix: update context_length (#61)
1 parent 6f3ff2e commit 685eb8b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lightning_sdk >= 2025.08.26
1+
lightning_sdk >= 2025.09.10

src/litai/llm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ def context_length(self, model: Optional[str] = None) -> int:
250250
"""Returns the context length of the specified model."""
251251
self._wait_for_model()
252252
assert self._llm is not None, "LLM backend must be initialized"
253-
return self._llm.context_length(model)
253+
if not model:
254+
return self._llm.context_length
255+
return self._llm.get_context_length(model)
254256

255257
def chat( # noqa: D417
256258
self,

tests/test_llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_llm_context_length(mock_llm_class):
9292

9393
LLMCLIENT._sdkllm_cache.clear()
9494
mock_llm_instance = MagicMock()
95-
mock_llm_instance.context_length.return_value = 8000
95+
mock_llm_instance.context_length = 8000
9696

9797
mock_llm_class.return_value = mock_llm_instance
9898

0 commit comments

Comments
 (0)