fix: move reasoning wrapper types to llama-stack-api and fix mypy errors - #5407
Conversation
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ llama-stack-client-openapi studio · code · diff
✅ llama-stack-client-go studio · conflict
✅ llama-stack-client-python studio · conflict
✅ llama-stack-client-node studio · conflict
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
5564754 to
b429f65
Compare
skamenan7
left a comment
There was a problem hiding this comment.
LGTM, apart couple of comments.
PR ogx-ai#5206 merged with `openai_chat_completions_with_reasoning` returning `-> object` which hid type errors. The wrapper types OpenAIChatCompletionWithReasoning and OpenAIChatCompletionChunkWithReasoning were incorrectly placed in providers/inline/responses/builtin/responses/types.py instead of being in llama-stack-api where API types belong. This change: - Moves the wrapper types to src/llama_stack_api/inference/models.py - Converts them from @DataClass to BaseModel with Field() descriptors to match the rest of the API model definitions - Updates all imports across providers (bedrock, ollama, vllm) and routers - Adds explicit type annotation for completion_result variable that can hold either regular or reasoning-aware completion types - Fixes mypy errors that were previously hidden by the `-> object` return type Signed-off-by: Charlie Doern <cdoern@redhat.com>
remove json_schema_type to remove this from the spec Signed-off-by: Charlie Doern <cdoern@redhat.com>
Signed-off-by: Charlie Doern <cdoern@redhat.com>
|
Just reassuring to know that BFCL eval results remain consistent with #5206 |
What does this PR do?
PR #5206 merged with
openai_chat_completions_with_reasoningreturning-> objectwhich hid type errors. The wrapper types OpenAIChatCompletionWithReasoning and OpenAIChatCompletionChunkWithReasoning were incorrectly placed in providers/inline/responses/builtin/responses/types.py instead of being in llama-stack-api where API types belong.This change:
-> objectreturn type