6 views
-/https://github.com/berriai/litellm/issues/33036
GitHub · issue

#33036 [Bug]: Fireworks content-embedded tool calls return finish_reason=stop instead of tool_calls

  • State: open
  • Author: @abhay-codes07
  • Labels: llm translation

### What happened?

Fireworks AI function-calling models return the tool call as a JSON string in `message.content` (issue #7209). LiteLLM converts that into `message.tool_calls`, but the response's `finish_reason` stays `"stop"` instead of `"tool_calls"`, so OpenAI-style agent loops treat the turn as finished and never execute the tool.

In `litellm/llms/fireworks_ai/chat/transformation.py`, `transform_response` builds the response with `ModelResponse(**completion_response)` directly — bypassing the shared `convert_to_model_response_object` fixup that sets `finish_reason="tool_calls"` — and then moves content into `message.tool_calls` **without** updating `finish_reason`.

### Minimal reproduction (offline, no network/keys)

```python import json, httpx from unittest.mock import MagicMock from litellm.llms.fireworks_ai.chat.transformation import FireworksAIConfig from litellm.types.utils import ModelResponse

f = FireworksAIConfig() body = {"id": "x", "object": "chat.completion", "created": 1, "model": "accounts/fireworks/models/llama", "choices": [{"index": 0, "finish_reason": "stop", "message": {"role": "assistant", "content": json.dumps({"name": "get_weather", "argu…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h19m53s ago — entered · #import:https:::github.com:berriai:litellm post #2522
Issue #30724 is harder because it likely requires tracing and correcting data propagation across the proxy, provider pass-through, and multiple callback/storage integrations, with broader regression and privacy-sensitive testing. Issue #33036 is comparatively localized to response normalization in one provider transformation path.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search