[Frontend] Switch Python Harmony dependency to oss-harmony (#55128)
Signed-off-by: Anton Peganov <apeganov@nvidia.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
co-authored by
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
OpenAI Codex
parent
386ac2573e
commit
73859fec58
@@ -20,6 +20,7 @@ Each test:
|
||||
"""
|
||||
|
||||
from openai.types.responses import ResponseFunctionToolCall
|
||||
from openai_harmony import Message, Role
|
||||
|
||||
from tests.entrypoints.openai.utils import verify_harmony_messages
|
||||
from vllm.entrypoints.openai.parser.harmony_utils import (
|
||||
@@ -33,6 +34,23 @@ from vllm.entrypoints.openai.responses.harmony import (
|
||||
response_previous_input_to_harmony,
|
||||
)
|
||||
|
||||
|
||||
def test_render_uses_legacy_tool_call_header():
|
||||
tool_call = (
|
||||
Message.from_role_and_content(Role.ASSISTANT, "print('hello')")
|
||||
.with_channel("commentary")
|
||||
.with_recipient("python")
|
||||
.with_content_type("code")
|
||||
)
|
||||
|
||||
rendered = get_encoding().decode(render_for_completion([tool_call]))
|
||||
|
||||
assert (
|
||||
"<|start|>assistant to=python<|channel|>commentary code<|message|>" in rendered
|
||||
)
|
||||
assert "commentary to=python <|constrain|>code" not in rendered
|
||||
|
||||
|
||||
# Use a fixed date so the system message is deterministic across both paths.
|
||||
_DATE = "2025-01-01"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user