quivr/backend/core/tests/test_chat_llm.py
Stan Girard 13e9fc490b
feat: Add get_model method to ModelRepository (#2949)
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
2024-08-06 08:44:12 -07:00

20 lines
526 B
Python

import pytest
from quivr_core import ChatLLM
@pytest.mark.base
def test_chat_llm(fake_llm):
chat_llm = ChatLLM(
llm=fake_llm,
)
answer = chat_llm.answer("Hello, how are you?")
assert len(answer.answer) > 0
assert answer.metadata is not None
assert answer.metadata.citations is None
assert answer.metadata.followup_questions is None
assert answer.metadata.sources == []
assert answer.metadata.metadata_model is not None
assert answer.metadata.metadata_model.name is not None