-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- remove `FakeLLM` implementation because `langchain-contrib` doesn't support latest version of `langchain` - remove `langchain-contrib` dependency - update `langchain` to latest version: `0.1.11` #23 - remove `TestFakeLLM` unit test - restore `TestLLMClient` unit test - add versions to `direct-requirements.txt`
- Loading branch information
Showing
5 changed files
with
20 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
chromadb | ||
langchain | ||
langchain-contrib | ||
langchain-openai | ||
pytest | ||
chromadb==0.4.24 | ||
langchain==0.1.11 | ||
langchain-openai==0.0.8 | ||
pytest==8.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import os | ||
import pytest | ||
from src.llm_client import LLMClient | ||
from langchain_contrib.llms.testing import FakeLLM | ||
|
||
class TestFakeLLM: | ||
class TestLLMClient: | ||
@pytest.fixture | ||
def llm_client(self): | ||
return LLMClient(model_type="fake") | ||
return LLMClient(model_type="gpt") | ||
|
||
def test_init(self, llm_client): | ||
assert llm_client.model_type == "fake" | ||
assert llm_client.openai_api_key == os.environ.get("OPENAI_API_KEY") | ||
assert llm_client.model_type == "gpt" | ||
|
||
def test_setup_model(self, llm_client): | ||
model = llm_client.setup_model() | ||
assert isinstance(model, FakeLLM) | ||
temperature = 0.5 | ||
model = llm_client.setup_model(temperature=temperature) | ||
assert model.temperature == temperature |