| 2198 | } |
| 2199 | |
| 2200 | static json format_partial_response( |
| 2201 | llama_server_context &llama, llama_client_slot *slot, const std::string &content, const std::vector<completion_token_output> &probs |
| 2202 | ) { |
| 2203 | json res = json |
| 2204 | { |
| 2205 | {"content", content }, |
| 2206 | {"stop", false}, |
| 2207 | {"slot_id", slot->id }, |
| 2208 | {"multimodal", llama.multimodal } |
| 2209 | }; |
| 2210 | |
| 2211 | if (slot->sparams.n_probs > 0) |
| 2212 | { |
| 2213 | res["completion_probabilities"] = probs_vector_to_json(llama.ctx, probs); |
| 2214 | } |
| 2215 | |
| 2216 | return res; |
| 2217 | } |
| 2218 | |
| 2219 | static json format_tokenizer_response(const std::vector<llama_token> &tokens) |
| 2220 | { |
nothing calls this directly
no test coverage detected