Normalize OpenAI base URLs
This commit is contained in:
@@ -8,6 +8,7 @@ from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
from aituner.cli import main as cli_main
|
||||
from aituner.http_client import _openai_url
|
||||
from aituner.job import append_job, build_trial_job
|
||||
from aituner.llm import build_prompt, parse_proposal_text
|
||||
from aituner.search import ThresholdProbe, binary_search_max_feasible
|
||||
@@ -717,6 +718,16 @@ class CoreFlowTests(unittest.TestCase):
|
||||
self.assertEqual(len(replayed), 3)
|
||||
self.assertEqual(replayed[1].error, "slo_pass_rate_unrecoverable")
|
||||
|
||||
def test_openai_url_avoids_double_v1(self) -> None:
|
||||
self.assertEqual(
|
||||
_openai_url("http://example.com", "/v1/chat/completions"),
|
||||
"http://example.com/v1/chat/completions",
|
||||
)
|
||||
self.assertEqual(
|
||||
_openai_url("http://example.com/v1", "/v1/chat/completions"),
|
||||
"http://example.com/v1/chat/completions",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user