Commit 1b5fbb0
committed
fix: third CoPilot review pass on PR #42
Addresses 5 remaining review threads (3 substantive, 2 stale on
already-fixed code):
- LlmProviderResponseAssertion (the typed assertion model in
harness/expectations.py) now lists `parsed: Any | None`. The
runtime assertion in test_llm_provider.py already handled it, but
the typed parser had it under extra="forbid" and would have
rejected any future case-shape LLM fixture using `parsed`. The
021-028 fixtures slip past today on `calls:` form's permissive
`LlmCallSpec.expected: dict[str, Any]`; this lines the two paths
up.
- docs/model-providers/authoring.md skeleton comment tightened:
removed the "ignore it and return free-form text" option from
the response_schema guidance. A provider that silently drops the
parameter violates the Protocol contract; callers expect either
Response.parsed populated or StructuredOutputInvalid raised. Now
only two valid options surfaced: raise ProviderInvalidRequest
until implemented, or wire it through.
- docs/concepts/llms.md softened the static-typing claim in the
Pydantic-class form section. Response.parsed is
`dict[str, Any] | BaseModel | None`, so a type checker won't
narrow from `response_schema=Classification` alone. The page now
separates the runtime guarantee (validated instance) from static
access (requires cast/isinstance/typed assignment); generic
Response[T] flagged as a follow-up.
The two stale threads (examples/00-hello-world/main.py provider
cleanup, test_structured_output.py provider cleanup) were already
fixed in commit 8ed334c; replies sent + threads resolved without
code changes.1 parent 8ed334c commit 1b5fbb0
3 files changed
Lines changed: 26 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
| |||
0 commit comments