agentscope-ai / agentscope-ai/QwenPaw

[Feature]: Support OpenAI response format

Offen
#5,489 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
TypeScript
Sterne
35k
Forks
3.1k
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
228

Beschreibung

## 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).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
api, backend, testing
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.