Accept a JSON Schema document as `output_type`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start from AgentOutputSchema and the AgentOutputSchemaBase interface it implements, specifically json_schema(), is_strict_json_schema() and validate_json(), plus how ModelBehaviorError is raised during output parsing. Decide the validation approach first, since the issue leaves open whether to add jsonschema as an optional extra or skip local validation when strict=True. Done means a JsonSchemaOutput class that passes its schema through unchanged when strict=False, returns a parsed dict, and raises ModelBehaviorError on invalid JSON or schema violations, with tests for both modes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Please read this first
- Have you read the docs? Yes
- Have you searched for related issues? Yes
Describe the feature
AgentOutputSchema takes a Python type, so an agent whose response schema arrives at runtime as JSON Schema (user-defined agents in agent-builder products, schemas stored in config) needs a hand-written AgentOutputSchemaBase subclass that re-implements json_schema(), is_strict_json_schema() and validate_json(), with its own JSON parsing, validation and ModelBehaviorError mapping.
Proposal: a built-in output schema that takes the document directly, e.g.
Agent(..., output_type=JsonSchemaOutput(schema, name="ticket", strict=False))
strict=Truerunsensure_strict_json_schemaasAgentOutputSchemadoes;strict=Falsesends the schema as given, since user-authored schemas often fall outside the strict subset.validate_jsonparses and validates against the schema and raisesModelBehaviorErroron invalid JSON or a schema violation, so retries and error handling match typed outputs.- It returns the parsed dict.
Validation could use jsonschema as an optional extra, or skip local validation when strict=True, where the provider already enforces the schema.
- Lenguaje dominante
- Python
- Estrellas
- 29.9k
- Forks
- 4.8k
- Merge medio
- 1 d 3 min
- PR fusionados (30 d)
- 213
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 openai/openai-agents-python
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 87/100
openai/openai-agents-python#5350 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
SandboxApplyPatchTool splits patch lines with str.splitlines(), so a form feed or in a line breaks Add/Update FilePosiblemente ocupada @abhishekacharya200 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openai/openai-agents-python#5349 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
openai/openai-agents-python#5348 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Support the OpenAI Decisions APIAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
openai/openai-agents-python#5353 ·
Los mantenedores suelen responder en 1 día
-
RunState round trip drops alias-only fields: `"async": null` on a function call is serialized as `async_` and breaks `get_interruptions()` on restorePosiblemente ocupada @iveteamorim la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
openai/openai-agents-python#5352 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de openai/openai-agents-python
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
gradio-app/gradio#13964 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 93/100
BSData/horus-heresy-3rd-edition#3232 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jbacalso24/mimry#123 ·
Los mantenedores suelen responder en 1 día
-
p:3-mid pydanty:bug pydanty:is-working
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
pydantic/pydantic-ai#10153 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue priority: medium size: S testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
cubrid-lab/cubrid-cookbook-python#316 ·
Los mantenedores suelen responder en 1 día