mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-27 09:26:22 +02:00
Fix broken merge (#480)
This commit is contained in:
parent
f62de4e644
commit
e7e2e4d56f
1 changed files with 0 additions and 29 deletions
|
|
@ -188,22 +188,12 @@ class TestVertexAIProcessorSimple(IsolatedAsyncioTestCase):
|
|||
assert result.out_token == 0
|
||||
assert result.model == 'gemini-2.0-flash-001'
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.google.auth.default')
|
||||
>>>>>>> release/v1.2
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.service_account')
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.vertexai')
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.GenerativeModel')
|
||||
@patch('trustgraph.base.async_processor.AsyncProcessor.__init__')
|
||||
@patch('trustgraph.base.llm_service.LlmService.__init__')
|
||||
<<<<<<< HEAD
|
||||
async def test_processor_initialization_without_private_key(self, mock_llm_init, mock_async_init, mock_generative_model, mock_vertexai, mock_service_account):
|
||||
"""Test processor initialization without private key (should fail)"""
|
||||
# Arrange
|
||||
mock_async_init.return_value = None
|
||||
mock_llm_init.return_value = None
|
||||
=======
|
||||
async def test_processor_initialization_without_private_key(self, mock_llm_init, mock_async_init, mock_generative_model, mock_vertexai, mock_service_account, mock_auth_default):
|
||||
"""Test processor initialization without private key (uses default credentials)"""
|
||||
# Arrange
|
||||
|
|
@ -217,7 +207,6 @@ class TestVertexAIProcessorSimple(IsolatedAsyncioTestCase):
|
|||
# Mock GenerativeModel
|
||||
mock_model = MagicMock()
|
||||
mock_generative_model.return_value = mock_model
|
||||
>>>>>>> release/v1.2
|
||||
|
||||
config = {
|
||||
'region': 'us-central1',
|
||||
|
|
@ -230,11 +219,6 @@ class TestVertexAIProcessorSimple(IsolatedAsyncioTestCase):
|
|||
'id': 'test-processor'
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
# Act & Assert
|
||||
with pytest.raises(RuntimeError, match="Private key file not specified"):
|
||||
processor = Processor(**config)
|
||||
=======
|
||||
# Act
|
||||
processor = Processor(**config)
|
||||
|
||||
|
|
@ -245,7 +229,6 @@ class TestVertexAIProcessorSimple(IsolatedAsyncioTestCase):
|
|||
location='us-central1',
|
||||
project='test-project-123'
|
||||
)
|
||||
>>>>>>> release/v1.2
|
||||
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.service_account')
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.vertexai')
|
||||
|
|
@ -325,20 +308,11 @@ class TestVertexAIProcessorSimple(IsolatedAsyncioTestCase):
|
|||
# Verify service account was called with custom key
|
||||
mock_service_account.Credentials.from_service_account_file.assert_called_once_with('custom-key.json')
|
||||
|
||||
<<<<<<< HEAD
|
||||
# Verify that parameters dict has the correct values (this is accessible)
|
||||
assert processor.parameters["temperature"] == 0.7
|
||||
assert processor.parameters["max_output_tokens"] == 4096
|
||||
assert processor.parameters["top_p"] == 1.0
|
||||
assert processor.parameters["top_k"] == 32
|
||||
assert processor.parameters["candidate_count"] == 1
|
||||
=======
|
||||
# Verify that api_params dict has the correct values (this is accessible)
|
||||
assert processor.api_params["temperature"] == 0.7
|
||||
assert processor.api_params["max_output_tokens"] == 4096
|
||||
assert processor.api_params["top_p"] == 1.0
|
||||
assert processor.api_params["top_k"] == 32
|
||||
>>>>>>> release/v1.2
|
||||
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.service_account')
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.vertexai')
|
||||
|
|
@ -433,8 +407,6 @@ class TestVertexAIProcessorSimple(IsolatedAsyncioTestCase):
|
|||
# The prompt should be "" + "\n\n" + "" = "\n\n"
|
||||
assert call_args[0][0] == "\n\n"
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.AnthropicVertex')
|
||||
@patch('trustgraph.model.text_completion.vertexai.llm.service_account')
|
||||
@patch('trustgraph.base.async_processor.AsyncProcessor.__init__')
|
||||
|
|
@ -487,7 +459,6 @@ class TestVertexAIProcessorSimple(IsolatedAsyncioTestCase):
|
|||
assert processor.api_params["top_p"] == 1.0
|
||||
assert processor.api_params["top_k"] == 32
|
||||
|
||||
>>>>>>> release/v1.2
|
||||
|
||||
if __name__ == '__main__':
|
||||
pytest.main([__file__])
|
||||
Loading…
Add table
Add a link
Reference in a new issue