From 1a5c17a92fb748c689a724bea060152a821803b1 Mon Sep 17 00:00:00 2001 From: Matthew Farrellee Date: Wed, 29 Jan 2025 12:25:50 -0500 Subject: [PATCH] align with CompletionResponseStreamChunk.delta as str (instead of TextDelta) (#900) # What does this PR do? fix type mismatch in /v1/inference/completion ## Test Plan `llama stack run ./llama_stack/templates/nvidia/run.yaml` `LLAMA_STACK_BASE_URL="http://localhost:8321" pytest -v tests/client-sdk/inference/test_inference.py` ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Ran pre-commit to handle lint / formatting issues. - [x] Read the [contributor guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md), Pull Request section? - [ ] Updated relevant documentation. - [ ] Wrote necessary unit or integration tests. --- llama_stack/providers/remote/inference/nvidia/openai_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_stack/providers/remote/inference/nvidia/openai_utils.py b/llama_stack/providers/remote/inference/nvidia/openai_utils.py index 0f753f80d..43be0fc94 100644 --- a/llama_stack/providers/remote/inference/nvidia/openai_utils.py +++ b/llama_stack/providers/remote/inference/nvidia/openai_utils.py @@ -632,7 +632,7 @@ async def convert_openai_completion_stream( async for chunk in stream: choice = chunk.choices[0] yield CompletionResponseStreamChunk( - delta=TextDelta(text=choice.text), + delta=choice.text, stop_reason=_convert_openai_finish_reason(choice.finish_reason), logprobs=_convert_openai_completion_logprobs(choice.logprobs), )