utils
set_additional_properties_false_json_schema(schema)
Set additionalProperties to False on all object schemas.
Recursively walks the JSON schema and, for every object schema, sets
additionalProperties to False unless it is already present. An object
schema is one whose type is "object" or, for a nullable object, a
list containing "object" (e.g. ["object", "null"]).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
dict
|
The JSON schema to modify |
required |
Returns:
| Type | Description |
|---|---|
dict
|
The modified schema with additionalProperties set to False |
Source code in outlines/models/utils.py
split_multimodal_input(content)
Split a multimodal input into its text prompt and assets.