| 136 | compile(code, "<test>", "exec") |
| 137 | |
| 138 | def test_frame_to_python(self, sample_input): |
| 139 | _config.default_model = "gpt-4o-mini" |
| 140 | frame = ( |
| 141 | read_json(sample_input) |
| 142 | .map("summarize", |
| 143 | prompt="Summarize: {{ input.text }}", |
| 144 | output={"schema": {"summary": "string"}}) |
| 145 | ) |
| 146 | code = frame.to_python() |
| 147 | assert "docetl.default_model = 'gpt-4o-mini'" in code |
| 148 | assert ".map('summarize'" in code |
| 149 | compile(code, "<test>", "exec") |
| 150 | |
| 151 | def test_multiline_prompt(self, sample_input): |
| 152 | frame = ( |