Skip to content

Commit

Permalink
Update documentation and tests to account for history handling change
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Dec 19, 2024
1 parent ca32adc commit 9dd2ac2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion neon_data_models/models/api/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class LLMRequest(BaseModel):
"Mutually exclusive with `stream`.")
max_history: int = Field(
default=2, description="Maximum number of user/assistant "
"message pairs to include in history context.")
"message pairs to include in history context. "
"Excludes system prompt and incoming query.")

@model_validator(mode='before')
@classmethod
Expand Down
4 changes: 3 additions & 1 deletion tests/models/api/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def test_llm_request(self):
self.assertFalse(valid_request.beam_search)
self.assertEqual(len(valid_request.history), len(test_history))
self.assertEqual(len(valid_request.to_completion_kwargs()['messages']),
2 * valid_request.max_history + 1)
2 * valid_request.max_history + 2)
self.assertEqual(valid_request.to_completion_kwargs()['messages'][-1],
test_query)

# Valid explicit streaming
streaming_request = LLMRequest(query=test_query, history=test_history,
Expand Down

0 comments on commit 9dd2ac2

Please sign in to comment.