llama.cpp/tools/server/tests/unit
Dorin-Andrei Geman 42158ae2e8
server : fix first message identification (#13634)
* server : fix first message identification

When using the OpenAI SDK (https://github.com/openai/openai-node/blob/master/src/lib/ChatCompletionStream.ts#L623-L626) we noticed that the expected assistant role is missing in the first streaming message. Fix this by correctly checking for the first message.

Co-authored-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
Signed-off-by: Dorin Geman <dorin.geman@docker.com>

* server : Fix checks for first role message for stream=True

Co-authored-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
Signed-off-by: Dorin Geman <dorin.geman@docker.com>

---------

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
Co-authored-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
2025-05-21 15:07:57 +02:00
..
test_basic.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_chat_completion.py server : fix first message identification (#13634) 2025-05-21 15:07:57 +02:00
test_completion.py server : fix cache_tokens bug with no cache_prompt (#13533) 2025-05-14 13:35:07 +02:00
test_ctx_shift.py server : do not return error out of context (with ctx shift disabled) (#13577) 2025-05-16 21:50:00 +02:00
test_embedding.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_infill.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_lora.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_rerank.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_security.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_slot_save.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_speculative.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_template.py server: inject date_string in llama 3.x template + fix date for firefunction v2 (#12802) 2025-05-15 02:39:51 +01:00
test_tokenize.py llama : move end-user examples to tools directory (#13249) 2025-05-02 20:27:13 +02:00
test_tool_call.py server: inject date_string in llama 3.x template + fix date for firefunction v2 (#12802) 2025-05-15 02:39:51 +01:00
test_vision_api.py server : vision support via libmtmd (#12898) 2025-05-09 19:29:37 +02:00