paper_flow() fails on its own README example: dict-typed nodes field breaks strict structured output, UUID id fields reject the model's natural output
Nadie ha tomado este issue todavía.
- #92 de @isorobo — cerrado sin fusionar
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Empieza por quantmind/flows/paper.py y quantmind/knowledge/_tree.py; después, inspecciona los modelos Paper y los modelos de knowledge relacionados mencionados en el issue. Ejecuta el ejemplo de un solo paper del README con openai-agents 0.18.1 y la suite completa de pruebas. Se considera terminado cuando el ejemplo se completa sin errores de validación de schema o UUID y las pruebas existentes siguen pasando, salvo el fallo no relacionado indicado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The single-paper example in the README does not run against the currently resolved dependency versions (openai-agents>=0.14, no ceiling, resolves to 0.18.1):
import asyncio
from quantmind.configs import PaperFlowCfg
from quantmind.configs.paper import ArxivIdentifier
from quantmind.flows import paper_flow
async def main() -> None:
paper = await paper_flow(
ArxivIdentifier(id="2401.12345"),
cfg=PaperFlowCfg(model="gpt-4o-mini"),
)
asyncio.run(main())
Two separate bugs stack on top of each other.
Bug 1 — Agent(output_type=Paper) raises before any LLM call
TreeKnowledge.nodes is dict[UUID, TreeNode] (quantmind/knowledge/_tree.py). OpenAI's strict-mode structured output — the default in current openai-agents releases — cannot represent dict-typed fields at all (arbitrary keys are incompatible with a fixed JSON Schema). paper_flow (quantmind/flows/paper.py) passes the bare Paper type straight into Agent(output_type=out_type), with no strict_json_schema=False escape hatch, so the run fails immediately:
agents.exceptions.UserError: Strict JSON schema is enabled, but the output type is not valid.
Either make the output type strict, or wrap your type with AgentOutputSchema(YourType, strict_json_schema=False)
Bug 2 — once strict mode is off, UUID-typed id fields reject the model's output
Wrapping the output type in AgentOutputSchema(Paper, strict_json_schema=False) gets past bug 1, but a non-strict schema drops the UUID format constraint. The extraction agent then does exactly what you'd expect an LLM to do when free-form: it fills TreeNode.node_id / parent_id / children_ids with readable slugs ("root", "introduction", "methodology") and BaseKnowledge.id with the paper's arXiv id ("2404.11584"), rather than leaving these at their UUID4 defaults. Validation then fails with ~80+ uuid_parsing errors.
Repro
Ran the unmodified README example against a real paper (arXiv 2404.11584, "The landscape of emerging AI agent architectures for reasoning, planning, and tool calling: A survey", model gpt-4o-mini) on the current main (8e21888). Fails both ways described above. Full traceback available on request.
Fix
Opened # — changes TreeNode.node_id/parent_id/children_ids, TreeKnowledge.root_node_id/nodes, BaseKnowledge.id, and PaperKnowledgeCard.paper_id from UUID to str (accepts both UUIDs and readable slugs), and has paper_flow pass AgentOutputSchema(out_type, strict_json_schema=False) instead of a bare type. Verified: the unmodified README example now completes end-to-end with zero validation errors against the same real paper, and the full test suite passes (232/233 — the one failure is pre-existing and unrelated, a Windows path-separator assertion in a local-file test).
Environment
openai-agents==0.18.1(resolved from the unpinned>=0.14floor)- Windows 11, Python 3.12.12
- Lenguaje dominante
- Python
- Estrellas
- 3.1k
- Forks
- 492
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de LLMQuant/quant-mind
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
LLMQuant/quant-mind#155 · 2 comentarios ·
-
design(flows): structure tree drafted from truncated page text (1200 chars), diverging from PageIndex full-page constructionQuizá libre de nuevo @keli-wen la tomó hace 81 días y no hay ningún pull request abierto. Abiertoarea: flows area: preprocess type: design
LLMQuant/quant-mind#133 · 1 comentario · 1 asignado ·
-
feat(flows): surface token-usage and cost for runs and batch_runPosiblemente ocupada @dhruvraajeev la tomó hace 81 días. Abiertoarea: configs area: flows area: mind type: feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
LLMQuant/quant-mind#127 · 1 comentario ·
-
design(config): define ownership of typed operation inputsQuizá libre de nuevo @keli-wen la tomó hace 85 días y no hay ningún pull request abierto. Abiertoarea: flows type: feature
LLMQuant/quant-mind#121 · 1 asignado ·
-
bug: exchange-qualified multi-symbol lists are only partially capturedPosiblemente ocupada @pengpengyi92 la tomó hace 82 días. Abiertoarea: preprocess stale type: bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
LLMQuant/quant-mind#108 · 2 comentarios ·
Todos los issues de LLMQuant/quant-mind
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
Status: Triage Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Objects.List treats versions=false (and similar flags) as truePosiblemente ocupada @andaaron la tomó hoy. Abiertopriority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleapis/storage-testbench#829 ·
Los mantenedores suelen responder en 2 días
-
[Bug]: memory provider treats 1:1 DMs as shared surfaces, so DM turns never receive reviewed recordsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
rlaope/oh-my-hermes#2088 ·
Los mantenedores suelen responder en 1 día