mirror of
https://github.com/aimingmed/aimingmed-ai.git
synced 2026-02-04 22:25:34 +08:00
update
This commit is contained in:
parent
09673ae3fe
commit
47654c821a
@ -16,6 +16,7 @@ docker = "*"
|
||||
ipywidgets = "*"
|
||||
ipykernel = "*"
|
||||
jupyter = "*"
|
||||
chromadb = "*"
|
||||
|
||||
[dev-packages]
|
||||
pytest = "==8.0.0"
|
||||
|
||||
960
app/llmops/Pipfile.lock
generated
960
app/llmops/Pipfile.lock
generated
File diff suppressed because it is too large
Load Diff
31
app/llmops/tests/src/chain_of_thought/test_run.py
Normal file
31
app/llmops/tests/src/chain_of_thought/test_run.py
Normal file
@ -0,0 +1,31 @@
|
||||
import pytest
|
||||
from unittest.mock import patch, MagicMock
|
||||
import sys
|
||||
sys.path.append("/Users/leehongkai/projects/aimingmed/aimingmed-ai/app/llmops")
|
||||
from src.chain_of_thought import run
|
||||
|
||||
def test_go():
|
||||
# Create mock arguments
|
||||
args = MagicMock()
|
||||
args.query = "test_query"
|
||||
args.input_chromadb_artifact = "test_artifact"
|
||||
args.embedding_model = "test_embedding_model"
|
||||
args.chat_model_provider = "gemini"
|
||||
|
||||
# Mock wandb.init and other external dependencies
|
||||
with patch("wandb.init") as mock_wandb_init, \
|
||||
patch("chromadb.PersistentClient") as mock_chromadb_client, \
|
||||
patch("sentence_transformers.SentenceTransformer") as mock_sentence_transformer, \
|
||||
patch("langchain_google_genai.ChatGoogleGenerativeAI") as mock_chat_google_generative_ai:
|
||||
|
||||
# Configure the mocks
|
||||
mock_wandb_init.return_value = MagicMock()
|
||||
mock_chromadb_client.return_value = MagicMock()
|
||||
mock_sentence_transformer.return_value = MagicMock()
|
||||
mock_chat_google_generative_ai.return_value = MagicMock()
|
||||
|
||||
# Call the go function
|
||||
run.go(args)
|
||||
|
||||
# Add assertions to validate the behavior of the go function
|
||||
assert mock_wandb_init.called
|
||||
Loading…
x
Reference in New Issue
Block a user