Skip to content

Commit

Permalink
mock api key
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluder-Paradyne committed Jul 2, 2023
1 parent 2d59089 commit 89118d0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ def get_document_summary(cls, doc_id):
return f'This is a summary of the document with id: {doc_id}'


@patch('superagi.config.config.get_config')
@patch('llama_index.LLMPredictor', MockLLMPredictor)
@patch('llama_index.ServiceContext', MockServiceContext)
@patch('llama_index.ResponseSynthesizer', MockResponseSynthesizer)
@patch('llama_index.DocumentSummaryIndex', MockDocumentSummaryIndex)
def test_generate_summary_of_documents():
def test_generate_summary_of_documents(mock_get_config):
mock_get_config.return_value = 'dummy_api_key'
lds = LlamaDocumentSummary()
# Documents to be summarized
documents = [
Expand All @@ -46,11 +48,13 @@ def test_generate_summary_of_documents():
# Ensure mock summary is returned
assert summary == 'This is a summary of the document with id: 1'

@patch('superagi.config.config.get_config')
@patch('llama_index.LLMPredictor', MockLLMPredictor)
@patch('llama_index.ServiceContext', MockServiceContext)
@patch('llama_index.ResponseSynthesizer', MockResponseSynthesizer)
@patch('llama_index.DocumentSummaryIndex', MockDocumentSummaryIndex)
def test_generate_summary_of_documents_from_texts():
def test_generate_summary_of_documents_from_texts(mock_get_config):
mock_get_config.return_value = 'dummy_api_key'
lds = LlamaDocumentSummary()
# Documents to be summarized
texts = [
Expand Down

0 comments on commit 89118d0

Please sign in to comment.