Skip to content

Commit 448bd50

Browse files
authored
Fix-319: Correctly pass api_base and add --max-run-time CLI argument in main_full_repo (#336)
* Pass api_base to AICaller * Modify unit test
1 parent 0f6a405 commit 448bd50

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cover_agent/main_full_repo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ async def run():
2727
print("LSP server initialized.")
2828

2929
generate_log_files = not args.suppress_log_files
30-
ai_caller = AICaller(model=args.model, generate_log_files=generate_log_files)
30+
api_base = getattr(args, "api_base", "")
31+
ai_caller = AICaller(model=args.model, api_base=api_base, generate_log_files=generate_log_files)
3132

3233
# main loop for analyzing test files
3334
for test_file in test_files:

tests/test_ai_caller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def ai_caller(self):
1717
"""
1818
Fixture to create an instance of AICaller for testing.
1919
"""
20-
return AICaller("test-model", "test-api", enable_retry=False)
20+
return AICaller(model="test-model", api_base="test-api", enable_retry=False)
2121

2222
@patch("cover_agent.ai_caller.AICaller.call_model")
2323
def test_call_model_simplified(self, mock_call_model):
@@ -105,6 +105,7 @@ def test_call_model_api_base(self, mock_completion, ai_caller):
105105
"usage": {"prompt_tokens": 2, "completion_tokens": 10},
106106
}
107107
response, prompt_tokens, response_tokens = ai_caller.call_model(prompt)
108+
assert ai_caller.api_base == "test-api"
108109
assert response == "response"
109110
assert prompt_tokens == 2
110111
assert response_tokens == 10

0 commit comments

Comments
 (0)