Skip to main content

CallOverride

Struct CallOverride 

Source
pub struct CallOverride {
Show 23 fields pub module: Option<String>, pub function: Option<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 enum_fields: HashMap<String, String>, pub enum_module: Option<String>, pub result_is_simple: 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>,
}
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.

§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”, or “json”.

  • "kwargs": construct OptionsType(key=val, ...) (requires options_type).
  • "dict": pass as a plain dict/object literal {"key": "val"}.
  • "json": pass via json.loads('...') / JSON.parse('...').
§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.

§result_is_simple: bool

When 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.

§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.

Trait Implementations§

Source§

impl Clone for CallOverride

Source§

fn clone(&self) -> CallOverride

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CallOverride

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CallOverride

Source§

fn default() -> CallOverride

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CallOverride

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CallOverride

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,