]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
server: /v1/responses (partial) (#18486)
author손희준 <redacted>
Wed, 21 Jan 2026 16:47:23 +0000 (01:47 +0900)
committerGitHub <redacted>
Wed, 21 Jan 2026 16:47:23 +0000 (17:47 +0100)
commitfbbf3ad1900bbaa97cd3c8de4c764afb0f6d8972
treefa2ab0142e571bbb2e35ed8c899a5fe08609230b
parent33f890e5799d1bb539f72f3d7e1ea30b8cff1123
server: /v1/responses (partial) (#18486)

* from previous PR

* Make instruction(system) as first message

* Convert [input_message] (text/image/file)

* Rename convert_responses_to_chatcmpl(body) -> response_body

* Initial tool call support

* Erase instructions field from chatcmpl body

* Feed reasoning texts to chat template

* Use std::vector instead of opaque json array

* Make output_item.added events consistent

* Move `server_task_result_cmpl_partial::update` from header to source

* Match ID of output_item.added and .done events

* Add function_call only if there is no "fc_" prefix

* Add function call output at non-streaming API

* Test if ID is persistent

* Add doc

* Fix style - use trailing comma

* Rewrite state management

* catch up with upstream/master

* Fix style - "type" is the first item of SSE data

* Explicitly check "instructions" from response_body

* Make lambdas static

* Check if reasoning content exists

* Add `oai_resp_id` to task_result_state(also initialized at ctor), server_task_result_cmpl_partial, and server_task_result_cmpl_final

* Reject `input_file` since it is not supported by chatcmpl

* Add "fc_" prefix to non-straming function call id as coderabbit pointed out

---------

Co-authored-by: openingnow <>
requirements/requirements-tool_bench.txt
tools/server/README.md
tools/server/server-common.cpp
tools/server/server-common.h
tools/server/server-context.cpp
tools/server/server-context.h
tools/server/server-task.cpp
tools/server/server-task.h
tools/server/server.cpp
tools/server/tests/requirements.txt
tools/server/tests/unit/test_compat_oai_responses.py [new file with mode: 0644]