mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-19 05:25:02 +08:00
[Tool] Fix auto tool call (#22434)
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
This commit is contained in:
parent
7e0b121812
commit
4da8bf20d0
@ -132,9 +132,6 @@ class OpenAIServingResponses(OpenAIServing):
|
|||||||
"\"auto\" tool choice has been enabled please note that while"
|
"\"auto\" tool choice has been enabled please note that while"
|
||||||
" the parallel_tool_calls client option is preset for "
|
" the parallel_tool_calls client option is preset for "
|
||||||
"compatibility reasons, it will be ignored.")
|
"compatibility reasons, it will be ignored.")
|
||||||
if not self.use_harmony:
|
|
||||||
raise NotImplementedError("Auto tool choice is not supported "
|
|
||||||
"yet unless using Harmony")
|
|
||||||
|
|
||||||
# HACK(woosuk): This is a hack. We should use a better store.
|
# HACK(woosuk): This is a hack. We should use a better store.
|
||||||
# FIXME: If enable_store=True, this may cause a memory leak since we
|
# FIXME: If enable_store=True, this may cause a memory leak since we
|
||||||
@ -212,8 +209,8 @@ class OpenAIServingResponses(OpenAIServing):
|
|||||||
await self._make_request(request, prev_response,
|
await self._make_request(request, prev_response,
|
||||||
tokenizer))
|
tokenizer))
|
||||||
|
|
||||||
except (ValueError, TypeError, RuntimeError,
|
except (ValueError, TypeError, RuntimeError, jinja2.TemplateError,
|
||||||
jinja2.TemplateError) as e:
|
NotImplementedError) as e:
|
||||||
logger.exception("Error in preprocessing prompt inputs")
|
logger.exception("Error in preprocessing prompt inputs")
|
||||||
return self.create_error_response(f"{e} {e.__cause__}")
|
return self.create_error_response(f"{e} {e.__cause__}")
|
||||||
|
|
||||||
@ -313,6 +310,9 @@ class OpenAIServingResponses(OpenAIServing):
|
|||||||
prev_response: Optional[ResponsesResponse],
|
prev_response: Optional[ResponsesResponse],
|
||||||
tokenizer: AnyTokenizer,
|
tokenizer: AnyTokenizer,
|
||||||
):
|
):
|
||||||
|
if len(request.tools) > 0:
|
||||||
|
raise NotImplementedError(
|
||||||
|
"Tool use is not supported in Responses API without Harmony")
|
||||||
# Construct the input messages.
|
# Construct the input messages.
|
||||||
messages = self._construct_input_messages(request, prev_response)
|
messages = self._construct_input_messages(request, prev_response)
|
||||||
_, request_prompts, engine_prompts = await self._preprocess_chat(
|
_, request_prompts, engine_prompts = await self._preprocess_chat(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user