mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-01-26 17:20:01 +00:00
Fix text generation endpoint (#654)
This commit is contained in:
committed by
GitHub
parent
cfc8f5a61b
commit
33daaf7310
@@ -1615,10 +1615,10 @@ struct server_context {
|
||||
std::vector<ik_chat_msg_diff> oaicompat_msg_diffs;
|
||||
slot.update_chat_msg(oaicompat_msg_diffs);
|
||||
|
||||
// Following original llama.cpp pattern: send empty content in streaming mode
|
||||
// Clean content comes through oaicompat_msg_diffs instead of raw tokens
|
||||
// For text completion endpoints, send actual content; for chat completion, use diffs
|
||||
// OpenAI-compatible chat endpoints use empty content with diffs for tool calls
|
||||
res.data = json {
|
||||
{"content", ""}, // Empty - clean content provided via diffs
|
||||
{"content", slot.oaicompat ? "" : tkn.text_to_send}, // Text completion needs actual content
|
||||
{"stop", false},
|
||||
{"id_slot", slot.id},
|
||||
{"multimodal", false}
|
||||
|
||||
Reference in New Issue
Block a user