pub struct CallOverride {Show 45 fields
pub module: Option<String>,
pub function: Option<String>,
pub arg_name_map: HashMap<String, String>,
pub crate_name: Option<String>,
pub class: Option<String>,
pub alias: Option<String>,
pub header: Option<String>,
pub prefix: Option<String>,
pub options_type: Option<String>,
pub options_via: Option<String>,
pub from_json_module: Option<String>,
pub async: Option<bool>,
pub enum_fields: HashMap<String, String>,
pub enum_module: Option<String>,
pub nested_types: HashMap<String, String>,
pub nested_types_optional: bool,
pub result_is_simple: bool,
pub result_is_array: bool,
pub result_is_vec: bool,
pub result_is_bytes: bool,
pub result_is_option: bool,
pub result_is_r_list: bool,
pub result_is_json_struct: bool,
pub wrap_options_in_some: bool,
pub extra_args: Vec<String>,
pub returns_result: Option<bool>,
pub handle_nested_types: HashMap<String, String>,
pub handle_dict_types: HashSet<String>,
pub handle_struct_type: Option<String>,
pub handle_atom_list_fields: HashSet<String>,
pub handle_config_type: Option<String>,
pub php_client_factory: Option<String>,
pub client_factory: Option<String>,
pub bigint_fields: Vec<String>,
pub cli_args: Vec<String>,
pub cli_flags: HashMap<String, String>,
pub result_type: Option<String>,
pub arg_order: Vec<String>,
pub options_ptr: bool,
pub visitor_function: Option<String>,
pub trait_imports: Vec<String>,
pub raw_c_result_type: Option<String>,
pub c_free_fn: Option<String>,
pub path_fields: Vec<String>,
pub visitor_trait: Option<String>,
}Expand description
Per-language override for function call configuration.
Fields§
§module: Option<String>Override the module/import path.
function: Option<String>Override the function name.
arg_name_map: HashMap<String, String>Maps canonical argument names to language-specific argument names.
Used when a language binding uses a different parameter name than the
canonical args list in CallConfig. For example, if the canonical
arg name is doc but the Python binding uses html, specify:
[e2e.call.overrides.python]
arg_name_map = { doc = "html" }The key is the canonical name (from args[].name) and the value is the
name to use when emitting the keyword argument in generated tests.
crate_name: Option<String>Override the crate name (Rust only).
class: Option<String>Override the class name (Java/C# only).
alias: Option<String>Import alias (Go only, e.g., htmd).
header: Option<String>C header file name (C only).
prefix: Option<String>FFI symbol prefix (C only).
options_type: Option<String>For json_object args: the constructor to use instead of raw dict/object.
E.g., “ConversionOptions” — generates ConversionOptions(**options) in Python,
new ConversionOptions(options) in TypeScript.
options_via: Option<String>How to pass json_object args: “kwargs” (default), “dict”, “json”, or “from_json”.
"kwargs": constructOptionsType(key=val, ...)(requiresoptions_type)."dict": pass as a plain dict/object literal{"key": "val"}."json": pass viajson.loads('...')/JSON.parse('...')."from_json": callOptionsType.from_json('...')(Python only, PyO3 native types).
from_json_module: Option<String>Module to import options_type from when options_via = "from_json".
When set, a separate from {from_json_module} import {options_type} line
is emitted instead of including the type in the main module import.
E.g., "liter_llm._internal_bindings" for PyO3 native types.
async: Option<bool>Override whether the call is async for this language.
When set, takes precedence over the call-level async flag.
Useful when a language binding uses a different async model — for example,
a Python binding that returns a sync iterator from a function marked
async = true at the call level.
enum_fields: HashMap<String, String>Maps fixture option field names to their enum type names.
E.g., {"headingStyle": "HeadingStyle", "codeBlockStyle": "CodeBlockStyle"}.
The generator imports these types and maps string values to enum constants.
enum_module: Option<String>Module to import enum types from (if different from the main module). E.g., “html_to_markdown._html_to_markdown” for PyO3 native enums.
nested_types: HashMap<String, String>Maps nested fixture object field names to their C# type names.
Used to generate JsonSerializer.Deserialize<NestedType>(...) for nested objects.
E.g., {"preprocessing": "PreprocessingOptions"}.
nested_types_optional: boolWhen false, nested config builder results are passed directly to builder methods
without wrapping in Optional.of(...). Set to false for bindings where nested
option types are non-optional (e.g., html-to-markdown Java).
Defaults to true for backward compatibility.
result_is_simple: boolWhen true, the function returns a simple type (e.g., String) rather
than a struct. Generators that would normally emit result.content
(or equivalent field access) will use the result variable directly.
result_is_array: boolWhen true (and combined with result_is_simple), the simple result is
a slice/array type (e.g., []string in Go, Vec<String> in Rust).
The Go generator uses strings.Join(value, " ") for contains assertions
instead of string(value).
result_is_vec: boolWhen true, the function returns Vec<T> rather than a single value.
Field-path assertions are emitted as .iter().all(|r| <accessor>) so
every element is checked. (Rust generator.)
result_is_bytes: boolWhen true, the function returns a raw byte array (e.g., byte[] in Java,
[]byte in Go). Used by generators to select the correct length accessor
(field .length vs method .length()).
result_is_option: boolWhen true, the function returns Option<T>. The result is unwrapped
before any non-is_none/is_some assertion runs; is_empty/not_empty
assertions map to is_none()/is_some(). (Rust generator.)
result_is_r_list: boolWhen true, the R generator emits the call result directly without wrapping
in jsonlite::fromJSON(). Use when the R binding already returns a native
R list (Robj) rather than a JSON string. Field-path assertions still use
result$field accessor syntax (i.e. result_is_simple behaviour is NOT
implied — only the JSON parse wrapper is suppressed). (R generator only.)
result_is_json_struct: boolWhen true, the Zig generator treats the result as a []u8 JSON string
representing a struct value (e.g., ExtractionResult serialized via the
FFI _to_json helper). The generator parses the JSON with
std.json.parseFromSlice(std.json.Value, ...) before emitting field
assertions, traversing the dynamic JSON object for each field path.
(Zig generator only.)
wrap_options_in_some: boolWhen true, the Rust generator wraps the json_object argument expression
in Some(...).clone() to match an owned Option<T> parameter slot rather
than passing &options. (Rust generator only.)
extra_args: Vec<String>Trailing positional arguments appended verbatim after the configured
args. Used when the target function takes additional positional slots
(e.g. visitor) the fixture cannot supply directly. (Rust generator only.)
returns_result: Option<bool>Per-rust override of the call-level returns_result. When set, takes
precedence over CallConfig.returns_result for the Rust generator only.
Useful when one binding is fallible while others are not.
handle_nested_types: HashMap<String, String>Maps handle config field names to their Python type constructor names.
When the handle config object contains a nested dict-valued field, the
generator will wrap it in the specified type using keyword arguments.
E.g., {"browser": "BrowserConfig"} generates BrowserConfig(mode="auto")
instead of {"mode": "auto"}.
handle_dict_types: HashSet<String>Handle config fields whose type constructor takes a single dict argument instead of keyword arguments.
E.g., ["auth"] means AuthConfig({"type": "basic", ...}) instead of
AuthConfig(type="basic", ...).
handle_struct_type: Option<String>Elixir struct module name for the handle config argument.
When set, the generated Elixir handle config uses struct literal syntax
(%Module.StructType{key: val}) instead of a plain string-keyed map.
Rustler NifStruct requires a proper Elixir struct — plain maps are rejected.
E.g., "CrawlConfig" generates %Kreuzcrawl.CrawlConfig{download_assets: true}.
handle_atom_list_fields: HashSet<String>Handle config fields whose list values are Elixir atoms (Rustler NifUnitEnum).
When a config field is a Vec<EnumType> in Rust, the Elixir side must pass
a list of atoms (e.g., [:image, :document]) not strings (["image"]).
List the field names here so the generator emits atom literals instead of strings.
E.g., ["asset_types"] generates asset_types: [:image] instead of ["image"].
handle_config_type: Option<String>WASM config class name for handle args (WASM generator only).
When set, handle args are constructed using ConfigType.default() + setters
instead of passing a plain JS object (which fails _assertClass validation).
E.g., "WasmCrawlConfig" generates:
const engineConfig = WasmCrawlConfig.default();
engineConfig.maxDepth = 1;
const engine = createEngine(engineConfig);php_client_factory: Option<String>PHP client factory method name (PHP generator only).
When set, the generated PHP test instantiates a client via
ClassName::factory_method('test-key') and calls methods on the instance
instead of using static facade calls.
E.g., "createClient" generates:
$client = LiterLlm::createClient('test-key');
$result = $client->chat($request);client_factory: Option<String>Client factory function name for instance-method languages (WASM, etc.).
When set, the generated test imports this function, creates a client, and calls API methods on the instance instead of as top-level functions.
E.g., "createClient" generates:
import { createClient } from 'pkg';
const client = createClient('test-key');
const result = await client.chat(request);bigint_fields: Vec<String>Fields on the options object that require BigInt() wrapping (WASM only).
wasm_bindgen maps Rust u64/i64 to JavaScript BigInt. Numeric
values assigned to these setters must be wrapped with BigInt(n).
List camelCase field names, e.g.:
[e2e.call.overrides.wasm]
bigint_fields = ["maxTokens", "seed"]cli_args: Vec<String>Static CLI arguments appended to every invocation (brew/CLI generator only).
E.g., ["--format", "json"] appends --format json to every CLI call.
cli_flags: HashMap<String, String>Maps fixture config field names to CLI flag names (brew/CLI generator only).
E.g., {"output_format": "--format"} generates --format <value> from
the fixture’s output_format input field.
result_type: Option<String>C FFI opaque result type name (C only).
The PascalCase name of the result struct, without the prefix.
E.g., "ChatCompletionResponse" for LiterllmChatCompletionResponse*.
If not set, defaults to the function name in PascalCase.
arg_order: Vec<String>Override the argument order for this language binding.
Lists argument names from args in the order they should be passed
to the target function. Useful when a language binding reorders parameters
relative to the canonical args list in CallConfig.
E.g., if args = [path, mime_type, config] but the Node.js binding
takes (path, config, mime_type?), specify:
[e2e.call.overrides.node]
arg_order = ["path", "config", "mime_type"]options_ptr: boolWhen true, json_object args with an options_type are passed as a
pointer (*OptionsType) rather than a value. Use for Go bindings where
the options parameter is *ConversionOptions (nil-able pointer) rather
than a plain struct.
Absent options are passed as nil; present options are unmarshalled into
a local variable and passed as &optionsVar.
visitor_function: Option<String>Alternative function name to use when the fixture includes a visitor.
Some bindings expose two entry points: Convert(html, opts) for the
plain case and ConvertWithVisitor(html, opts, visitor) when a visitor
is involved. Set this to the visitor-accepting function name so the
generator can pick the right symbol automatically.
E.g., "ConvertWithVisitor" makes the Go generator emit:
result, err := htmd.ConvertWithVisitor(html, nil, visitor)instead of htmd.Convert(html, nil, visitor) (which would not compile).
trait_imports: Vec<String>Rust trait names to import when client_factory is set (Rust generator only).
When client_factory is set, the generated test creates a client object and
calls methods on it. Those methods are defined on traits (e.g. LlmClient,
FileClient) that must be in scope. List the trait names here and the Rust
generator will emit use {module}::{trait_name}; for each.
E.g.:
[e2e.call.overrides.rust]
client_factory = "create_client"
trait_imports = ["LlmClient", "FileClient", "BatchClient", "ResponseClient"]raw_c_result_type: Option<String>Raw C return type, used verbatim instead of {PREFIX}Type* (C only).
Valid values: "char*", "int32_t", "uintptr_t".
When set, the C generator skips options handle construction and uses the
raw type directly. Free logic is adjusted accordingly.
c_free_fn: Option<String>Free function for raw char* C results (C only).
Defaults to {prefix}_free_string when unset and raw_c_result_type == "char*".
path_fields: Vec<String>Fields in a json_object arg that must be wrapped in java.nio.file.Path.of()
(Java generator only).
E.g., ["cache_dir"] wraps the string value of cache_dir so the builder
receives java.nio.file.Path.of("/tmp/dir") instead of a plain string.
visitor_trait: Option<String>Trait name for the visitor pattern (Rust e2e tests only).
When a fixture declares a visitor block, the Rust e2e generator emits
impl <trait_name> for _TestVisitor { ... } and imports the trait from
{module}::visitor. When unset, no visitor block is emitted and fixtures
that declare a visitor will cause a codegen error.
E.g., "HtmlVisitor" generates:
use html_to_markdown_rs::visitor::{HtmlVisitor, NodeContext, VisitResult};
// ...
impl HtmlVisitor for _TestVisitor { ... }Trait Implementations§
Source§impl Clone for CallOverride
impl Clone for CallOverride
Source§fn clone(&self) -> CallOverride
fn clone(&self) -> CallOverride
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more