File tree Expand file tree Collapse file tree 5 files changed +32
-27
lines changed Expand file tree Collapse file tree 5 files changed +32
-27
lines changed Original file line number Diff line number Diff line change @@ -1615,10 +1615,10 @@ struct server_context {
16151615 std::vector<ik_chat_msg_diff> oaicompat_msg_diffs;
16161616 slot.update_chat_msg (oaicompat_msg_diffs);
16171617
1618- // Following original llama.cpp pattern: send empty content in streaming mode
1619- // Clean content comes through oaicompat_msg_diffs instead of raw tokens
1618+ // For text completion endpoints, send actual content; for chat completion, use diffs
1619+ // OpenAI-compatible chat endpoints use empty content with diffs for tool calls
16201620 res.data = json {
1621- {" content" , " " }, // Empty - clean content provided via diffs
1621+ {" content" , slot. oaicompat ? " " : tkn. text_to_send }, // Text completion needs actual content
16221622 {" stop" , false },
16231623 {" id_slot" , slot.id },
16241624 {" multimodal" , false }
@@ -2889,7 +2889,11 @@ static std::vector<json> format_partial_response_oaicompat(server_task_result ta
28892889 };
28902890 streaming_chunks.push_back (finish_chunk);
28912891 }
2892-
2892+ if (server_task_result_dict.count (task_result.id ) > 0 )
2893+ {
2894+ for (auto & chunk : streaming_chunks)
2895+ chunk.push_back ({ " timings" , server_task_result_dict[task_result.id ].timings .to_json () });
2896+ }
28932897 // Return streaming chunks (could be just final chunk if no diffs)
28942898 if (!streaming_chunks.empty ()) {
28952899 return streaming_chunks;
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -228,6 +228,26 @@ const SETTING_SECTIONS = (
228228 localConfig : typeof CONFIG_DEFAULT ,
229229 setLocalConfig : ( config : typeof CONFIG_DEFAULT ) => void
230230) : SettingSection [ ] => [
231+ {
232+ title : (
233+ < >
234+ < BookmarkIcon className = { ICON_CLASSNAME } />
235+ Presets
236+ </ >
237+ ) ,
238+ fields : [
239+ {
240+ type : SettingInputType . CUSTOM ,
241+ key : 'custom' , // dummy key for presets
242+ component : ( ) => (
243+ < PresetsManager
244+ currentConfig = { localConfig }
245+ onLoadPreset = { setLocalConfig }
246+ />
247+ ) ,
248+ } ,
249+ ] ,
250+ } ,
231251 {
232252 title : (
233253 < >
@@ -489,26 +509,7 @@ const SETTING_SECTIONS = (
489509 } ,
490510 ] ,
491511 } ,
492- {
493- title : (
494- < >
495- < BookmarkIcon className = { ICON_CLASSNAME } />
496- Presets
497- </ >
498- ) ,
499- fields : [
500- {
501- type : SettingInputType . CUSTOM ,
502- key : 'custom' , // dummy key for presets
503- component : ( ) => (
504- < PresetsManager
505- currentConfig = { localConfig }
506- onLoadPreset = { setLocalConfig }
507- />
508- ) ,
509- } ,
510- ] ,
511- } ,
512+
512513] ;
513514
514515export default function SettingDialog ( {
Original file line number Diff line number Diff line change 4848.chat-bubble-base-300 {
4949 --tw-bg-opacity : 1 ;
5050 --tw-text-opacity : 1 ;
51- @apply bg-base-300 text-base-content ;
51+ @apply break-words bg-base-300 text-base-content ;
5252}
5353
5454/* Highlight.js */
You can’t perform that action at this time.
0 commit comments