refactor(llm): collapse Endpoint to path-only; require ModelRef.baseURL
Push URL host knowledge from `Endpoint` (route layer) up to `model.baseURL`
(provider helper layer). The route just composes a path onto whatever
host the model already carries.
Endpoint:
- `Endpoint<Body>` shrinks to `{ path }`. No more `default`, `baseURL`,
or `required` fallback fields.
- `Endpoint.path(value)` replaces the old `Endpoint.baseURL({...})` factory.
- `Endpoint.render()` is now sync — `${model.baseURL}${path}` plus query
params. No fallback chain, no Effect wrapper.
ModelRef:
- `ModelRef.baseURL: Schema.String` (was optional). Every materialized
model carries a host.
- `RouteModelInput.baseURL?: string` stays optional so route defaults
can supply a canonical URL; routes without a default tighten it.
Provider helpers:
- Each protocol exports a `DEFAULT_BASE_URL` constant and bakes it into
`route.defaults.baseURL`. Provider helpers don't need to set baseURL.
- Azure uses a new `AtLeastOne<T>` helper from `auth-options.ts` to
require either `resourceName` or `baseURL` at the type level.
- Bedrock provider computes baseURL from `region` at construction time.
- OpenAI-compatible profiles now have required (not optional) `baseURL`
in their type — all 9 already supplied one.
- The `defaultBaseURL: string | false` knob on protocol endpoint
factories is gone.
Effects:
- Forgetting baseURL is now caught at compile time (TS) or model
construction time (modelWithDefaults runtime check), not request time.
- `Endpoint.render` no longer needs Effect wrapping in the transport
hot path.
This commit is contained in:
@@ -7,7 +7,7 @@ const types = (events: ReadonlyArray<{ readonly type: string }>) => events.map((
|
||||
describe("LLMNativeEvents", () => {
|
||||
test("synthesizes text and reasoning boundaries around native deltas", () => {
|
||||
const events = LLMNativeEvents.toSessionEvents([
|
||||
{ type: "request-start", id: "req_1", model: LLM.model({ id: "gpt-5", provider: "openai", route: "openai-responses" }) },
|
||||
{ type: "request-start", id: "req_1", model: LLM.model({ id: "gpt-5", provider: "openai", route: "openai-responses", baseURL: "https://api.openai.com/v1" }) },
|
||||
{ type: "step-start", index: 0 },
|
||||
{ type: "text-delta", text: "Hello" },
|
||||
{ type: "text-delta", text: "!" },
|
||||
|
||||
Reference in New Issue
Block a user