mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-05 02:41:45 +00:00
The OpenAPI spec adopts the lithos request, response, content part, tool, usage, and cost schemas. The completions endpoint returns the lithos `Response` JSON verbatim and SSE carries lithos `StreamEvent`s verbatim. The models and providers endpoints serve the fabro-types catalog views, and the install and model-test flows probe providers through fabro-llm. The CLI builds its catalog from the operator overlay, drives `fabro exec` through the server gateway adapter, and parses reasoning effort with the shared controls. The web app reads content parts as lithos-tagged objects. The TypeScript client is regenerated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
34 lines
884 B
Rust
34 lines
884 B
Rust
use std::any::{TypeId, type_name};
|
|
|
|
use fabro_api::types::ModelLimits as ApiModelLimits;
|
|
use fabro_types::ModelLimits;
|
|
|
|
#[test]
|
|
fn model_limits_reuses_canonical_type() {
|
|
assert_same_type::<ApiModelLimits, ModelLimits>();
|
|
}
|
|
|
|
#[test]
|
|
fn model_limits_json_matches_openapi_shape() {
|
|
let limits = ModelLimits {
|
|
context_window: 1_000_000,
|
|
max_output: Some(128_000),
|
|
};
|
|
|
|
let json = serde_json::to_value(limits).unwrap();
|
|
assert_eq!(json["context_window"], 1_000_000);
|
|
assert_eq!(json["max_output"], 128_000);
|
|
|
|
let round_trip: ApiModelLimits = serde_json::from_value(json).unwrap();
|
|
assert_eq!(round_trip, limits);
|
|
}
|
|
|
|
fn assert_same_type<T: 'static, U: 'static>() {
|
|
assert_eq!(
|
|
TypeId::of::<T>(),
|
|
TypeId::of::<U>(),
|
|
"{} should be the same type as {}",
|
|
type_name::<T>(),
|
|
type_name::<U>()
|
|
);
|
|
}
|