Skip to main content

venice_ai.utils.form

Form-data serialization helpers.

Exports: * :func:serialize_form_value — convert Python values to API-friendly strings

serialize_form_value

def serialize_form_value(value: Any) -> str

Serialize a value for form data submission.

Handles proper serialization of booleans to lowercase strings as expected by the Venice AI API.

Arguments:

  • value - The value to serialize

Returns:

String representation suitable for form data

Example:

>>> serialize_form_value(True)
'true'
>>> serialize_form_value(False)
'false'
>>> serialize_form_value(42)
'42'