Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

遇到 OpenAI接口中有消息是空tool result 会被AIStudio2API拒绝。 #152

Closed

Description

@aaababaaz

不正确的方法论: 在OpenAI接口中如果有消息是空tool result,会遭到 AI Studio 请求参数无效: 编码 content 0: part 0: function result 缺少名称且无法唯一关联调用 但换在Gemini接口执行,在Gemini上游是完全放行接受这种不正规消息的。

大致来说,在 system instruction 写进后处理单U消息载体,context仅仅写一个空tool result就开始生成。

Activity

  1. Mag1cFall commented on Nov 13, 2026

    @Mag1cFall
    Owner

    这个确实是问题,但是解释起来比较麻烦:
    Gemini上游 或者说Gemini协议官方文档,这个空tool也会被拒绝,但我的项目遵守的原则:

    • 客户端需要的,我们就兼容,不主动拒绝
    • fail-fast
    • 对于默认行为,优先尊重可用性,其次尊重上游(比如assistant轮续写)

    这里是需要可用性的场景,所以openai协议、以及anthropic+responses这俩协议,都应该接受 而不是在本服务处拒绝,
    但是方法论究竟是「全兼容」对,还是「全按文档」对,这没法评价。will be added in v0.3.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions