agentscope-ai / agentscope-ai/QwenPaw

[Feature]: Support OpenAI response format

Abierto
#5,489 1 comentario 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
TypeScript
Estrellas
35k
Forks
3.1k
Merge medio
1 d 13 h
PR fusionados (30 d)
228

Descripción

## Summary

Support OpenAI-style response-format messages in the existing message flow.

## Component(s) Affected

- [x] Core / Backend (app, agents, config, providers, utils, local_models)
- [ ] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [x] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy

## Problem / Motivation

The current message flow is mainly based on traditional chat messages. However, OpenAI-style response objects can contain structured output such as text items, tool calls, reasoning items, status, usage, and metadata.

If these responses are flattened into plain chat messages too early, useful structured fields may be lost. This makes it harder to support providers or workflows that follow the OpenAI response format.

## Proposed Solution

Add support for OpenAI-style response-format messages.

The implementation should:

- accept response-format messages where message input/output is handled
- preserve structured fields instead of flattening them too early
- keep existing chat message compatibility
- convert to plain text only when required by a downstream component
- add tests for response-format messages, tool calls, and backward compatibility

## Alternatives Considered

- Flatten response-format messages into plain text immediately.
- Handle response objects separately in each provider or workflow.
- Define a custom protocol instead of following the OpenAI response format.

## Additional Context

The goal is to follow the OpenAI response format directly and make it work cleanly with the existing message flow.

## Willing to Contribute

- [x] I am willing to open a PR for this feature (after discussion).

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

No files or test entry points are named. Start by tracing the existing core/backend message flow and identifying where structured messages are flattened. Define how response objects, text items, tool calls, reasoning, status, usage, and metadata remain available while preserving chat compatibility, then add coverage for response-format messages, tool calls, and backward compatibility.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api, backend, testing
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Tranquilo
Claridad
Necesita aclaración
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.