Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Open Responses API doesn't accept "output_text" as an input Item

未关闭 适合新手
#12,337 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #12339 来自 @localai-org-maint-bot —— 已关闭,未合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
api, backend

调研方向

从 core/http/endpoints/openresponses/responses.go 的第 727 行和第 750-754 行附近开始,然后使用之前 response 的输出作为输入来复现 /v1/responses 请求。检查 output_text 项如何转换为后端输入。当包含 output_text 的复制输出被接受,并且之前 response 的内容到达模型上下文时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug unconfirmed

LocalAI version:
v4.10.0 (7ad0cbf259f0c7bf9920fe2438fc3630ecd6c672)

Environment, CPU architecture, OS, and Version:
Docker, x86, Linux

Describe the bug
Open Response API doesn't accept output_text as an Item per the spec.
https://www.openresponses.org/reference#request-body
https://github.com/mudler/LocalAI/blob/b77937f61c522feb64f362a1ce322b5ef979cb7d/core/http/endpoints/openresponses/responses.go#L727

You should be able to exactly copy the "output" JSON from one call into the "input" JSON of the next call.

To Reproduce
Start a new OR API request (/v1/responses) with output messages from a previous response.

Expected behavior
The model sees the previous responses in the context for the new response

Logs

Example input:

Input JSON
{
  "model": "gemma-4-26b-a4b-it",
  "instructions": "These are scanned hand-written notes. Combine the notes, but do not reorder or change the wording of the notes except for the footnotes and endnotes. ",
  "input": [
    {
      "id": "msg_8c030eaa-8eca-402d-9a37-3b81097dedf8",
      "role": "assistant",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "text": "text 1",
          "type": "output_text",
          "logprobs": [],
          "annotations": []
        }
      ],
      "summary": [],
      "arguments": ""
    },
    {
      "id": "msg_936e093d-e8b7-46b1-a3ed-c5058f5092af",
      "role": "assistant",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "text": "text 2",
          "type": "output_text",
          "logprobs": [],
          "annotations": []
        }
      ],
      "summary": [],
      "arguments": ""
    },
    {
      "id": "msg_259556ea-700d-42e6-905a-9897fb6674d9",
      "role": "assistant",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "text": "text 3",
          "type": "output_text",
          "logprobs": [],
          "annotations": []
        }
      ],
      "summary": [],
      "arguments": ""
    },
    {
      "id": "msg_427a8eff-6185-402e-99a6-1a93c3b3f705",
      "role": "assistant",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "text": "text 4",
          "type": "output_text",
          "logprobs": [],
          "annotations": []
        }
      ],
      "summary": [],
      "arguments": ""
    }
  ],
  "temperature": 0.8
}

Example Backend Input:

Backend Input
[
  {
    "role": "system",
    "content": "These are scanned hand-written notes. Combine the notes, but do not reorder or change the wording of the notes except for the footnotes and endnotes. "
  }
]
Backend Output
{
  "id": "resp_ac7c7791-7680-4685-a4cc-c206264b073f",
  "object": "response",
  "created_at": 1790610865,
  "completed_at": 1790610910,
  "status": "completed",
  "model": "gemma-4-26b-a4b-it",
  "output": [
    {
      "type": "message",
      "id": "msg_8f7ba482-ca80-4cc9-8633-9d71dd0e8fa3",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Please provide the scanned hand-written notes (by uploading the images or providing the text). \n\nOnce you provide them, I will combine them according to your exact constraints:\n1. **No reordering:** I will keep the notes in their original sequence.\n2. **No wording changes:** I will not change a single word in the body of the notes.\n3. **Footnotes/Endnotes exception:** I will only adjust the footnotes and endnotes to ensure they are correctly placed or formatted according to your requirements.",
          "annotations": [],
          "logprobs": []
        }
      ],
      "arguments": "",
      "summary": []
    }
  ],
  "error": null,
  "incomplete_details": null,
  "previous_response_id": null,
  "instructions": "These are scanned hand-written notes. Combine the notes, but do not reorder or change the wording of the notes except for the footnotes and endnotes. ",
  "tools": [],
  "tool_choice": "none",
  "parallel_tool_calls": true,
  "max_tool_calls": null,
  "temperature": 0.8,
  "top_p": 1,
  "presence_penalty": 0,
  "frequency_penalty": 0,
  "top_logprobs": 0,
  "max_output_tokens": null,
  "text": {
    "format": {
      "type": "text"
    }
  },
  "truncation": "auto",
  "reasoning": null,
  "usage": {
    "input_tokens": 43,
    "output_tokens": 1546,
    "total_tokens": 1589,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens_details": {
      "reasoning_tokens": 0
    }
  },
  "metadata": {},
  "store": true,
  "background": false,
  "service_tier": "default",
  "safety_identifier": null,
  "prompt_cache_key": null
}

Additional context
I believe | "output_text" (Pseudo code since I am unfamiliar with go) needs to be added here as a quick solution, but I'm unsure if it will cause downstream problems.
https://github.com/mudler/LocalAI/blob/b77937f61c522feb64f362a1ce322b5ef979cb7d/core/http/endpoints/openresponses/responses.go#L750-L754

主要语言
Go
星标
49.8k
派生
4.5k
平均合并
20 小时 52 分钟
30 天内合并 PR
359

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mudler/LocalAI 的其他 Issue

查看 mudler/LocalAI 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。