From fbf4a858680d25966b5f48f24cae1c71175ffbe8 Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Sat, 6 Jul 2024 18:22:12 -0400 Subject: [PATCH] server-tests : use trailing slash in openai base_url --- examples/server/tests/features/steps/steps.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/server/tests/features/steps/steps.py b/examples/server/tests/features/steps/steps.py index 3446d1821..014231b73 100644 --- a/examples/server/tests/features/steps/steps.py +++ b/examples/server/tests/features/steps/steps.py @@ -780,7 +780,7 @@ def step_assert_metric_value(context, metric_name, metric_value): def step_available_models(context): # openai client always expects an api_key openai.api_key = context.user_api_key if context.user_api_key is not None else 'nope' - openai.base_url = f'{context.base_url}/v1' + openai.base_url = f'{context.base_url}/v1/' context.models = openai.models.list().data @@ -993,7 +993,7 @@ async def oai_chat_completions(user_prompt, else: try: openai.api_key = user_api_key - openai.base_url = f'{base_url}{base_path}' + openai.base_url = f'{base_url}{base_path}/' assert model is not None chat_completion = openai.chat.completions.create( messages=payload['messages'], @@ -1079,7 +1079,7 @@ async def request_oai_embeddings(input, seed, return embeddings else: openai.api_key = user_api_key - openai.base_url = f'{base_url}/v1' + openai.base_url = f'{base_url}/v1/' assert model is not None oai_embeddings = openai.embeddings.create( model=model,