Resolve and pretty-print the result without invoking the flow.
(
natural_language: str,
*,
target_flow: Callable[..., Awaitable[Any]],
resolver_model: str = "gpt-4o-mini",
)
| 99 | name=f"magic_resolver_{target_flow.__name__}", |
| 100 | instructions=instructions, |
| 101 | model=resolver_model, |
| 102 | output_type=ResolvedFlowConfig[input_type, cfg_type], # type: ignore[valid-type] |
| 103 | ) |
| 104 | result = await Runner.run(resolver, natural_language) |
| 105 | out = result.final_output |
| 106 | return out.input_obj, out.cfg_obj |
| 107 | |
| 108 | |
| 109 | async def preview_resolve( |
| 110 | natural_language: str, |
| 111 | *, |
| 112 | target_flow: Callable[..., Awaitable[Any]], |
| 113 | resolver_model: str = "gpt-5.6-luna", |
| 114 | ) -> tuple[Any, Any]: |
| 115 | """Resolve and pretty-print the result without invoking the flow.""" |
| 116 | inp, cfg = await resolve_magic_input( |
| 117 | natural_language, |
| 118 | target_flow=target_flow, |