Unverified Commit 855b101d authored by yjc9696's avatar yjc9696 Committed by GitHub
Browse files

[Frontend] add tools for dsv32 developer role (#30040)


Signed-off-by: default avatarpridejcyang <pridejcyang@tencent.com>
Co-authored-by: default avatarpridejcyang <pridejcyang@tencent.com>
Co-authored-by: default avatarJee Jee Li <pandaleefree@gmail.com>
parent d0502b49
......@@ -24,6 +24,7 @@ from openai.types.chat import (
ChatCompletionContentPartInputAudioParam,
ChatCompletionContentPartRefusalParam,
ChatCompletionContentPartTextParam,
ChatCompletionFunctionToolParam,
ChatCompletionMessageToolCallParam,
ChatCompletionToolMessageParam,
)
......@@ -269,6 +270,9 @@ class CustomChatCompletionMessageParam(TypedDict, total=False):
reasoning: str | None
"""The reasoning content for interleaved thinking."""
tools: list[ChatCompletionFunctionToolParam] | None
"""The tools for developer role."""
ChatCompletionMessageParam: TypeAlias = (
OpenAIChatCompletionMessageParam
......@@ -300,6 +304,9 @@ class ConversationMessage(TypedDict, total=False):
reasoning_content: str | None
"""Deprecated: The reasoning content for interleaved thinking."""
tools: list[ChatCompletionFunctionToolParam] | None
"""The tools for developer role."""
# Passed in by user
ChatTemplateContentFormatOption = Literal["auto", "string", "openai"]
......@@ -1619,6 +1626,8 @@ def _parse_chat_message_content(
if "name" in message and isinstance(message["name"], str):
result_msg["name"] = message["name"]
if role == "developer":
result_msg["tools"] = message.get("tools", None)
return result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment