[ROCm][CI] Stabilize Granite tool-use and test URL construction (#43017)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Andreas Karatzas
2026-05-23 12:21:11 +08:00
committed by GitHub
parent 6a4723a2e0
commit 76ea1d5d2f
5 changed files with 46 additions and 11 deletions
+8 -3
View File
@@ -12,17 +12,22 @@ from .utils import (
SEARCH_TOOL,
SEED,
WEATHER_TOOL,
ServerConfig,
ensure_system_prompt,
)
# test: request a chat completion that should return tool calls, so we know they
# are parsable
@pytest.mark.asyncio
async def test_tool_call_and_choice(client: openai.AsyncOpenAI):
async def test_tool_call_and_choice(
client: openai.AsyncOpenAI, server_config: ServerConfig
):
models = await client.models.list()
model_name: str = models.data[0].id
messages = ensure_system_prompt(MESSAGES_ASKING_FOR_TOOLS, server_config)
chat_completion = await client.chat.completions.create(
messages=MESSAGES_ASKING_FOR_TOOLS,
messages=messages,
temperature=0,
max_completion_tokens=100,
model=model_name,
@@ -68,7 +73,7 @@ async def test_tool_call_and_choice(client: openai.AsyncOpenAI):
# make the same request, streaming
stream = await client.chat.completions.create(
model=model_name,
messages=MESSAGES_ASKING_FOR_TOOLS,
messages=messages,
temperature=0,
max_completion_tokens=100,
tools=[WEATHER_TOOL, SEARCH_TOOL],