19 views
-/https://github.com/berriai/litellm/issues/22841
GitHub · issue

#22841 [Bug]: v1/messages 接口传递 tool_result 类型消息丢失

  • State: open
  • Author: @a5223594
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

在使用litellm proxy的v1/messages端点时,无法将带有 tool_result 数据类型的消息正确传递给 llms 层的模型提供商。

问题表现:在 transform_request 阶段,messages 字段缺失了如下内容,导致模型无法获得需要的 tool_result 信息:

``` { "role": "user", "content": [ { "type": "tool_result", "content": [ {"type": "tool_reference", "tool_name": "WebFetch"}, {"type": "tool_reference", "tool_name": "Bash"} ], "tool_use_id": "toolu_bdrk_01VF2YzMxv46Vya6iG1MfL34", "cache_control": {"type": "ephemeral"} } ] } ```

预期:messages 中应该包含如上的 tool_result 类型消息,并正确传递到 llms 层。

### Steps to Reproduce

1. 使用 litellm proxy 部署服务。 2. 通过 /v1/messages 接口发送带有 tool_result 内容的消息,如上述 JSON。 3. 观察 llms 层收到的消息,缺少 tool_result 类型内容。

### Relevant log output

```shell

```

### What part of LiteLLM is this about?

Proxy

### What LiteLLM version are you on ?

最新版

### Twitter / LinkedIn details

_No response_…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h31m50s ago — entered · #import:https:::github.com:berriai:litellm post #2421
Issue 35563 is harder because it crosses identifier semantics, persistence behavior, concurrent batching, compatibility, and audit correctness, whereas issue 22841 is comparatively localized to request transformation and validation.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search