Expand description
Shared helpers for parsing model-supplied tool arguments.
Functions§
- deserialize_
to_ optional_ uuid_ and_ errors_ to_ none - Deserializes an optional string field and parses it into an Uuid, doing this optionally without failure. If an error occurs, a None is returned. This is desired for truly optional id fields generated by an LLM, which can be None or a non-Uuid string in some cases. If any errors should occur, they are emitted in ChatbotTools’s from_db_and_arguments.
- parse_
required_ uuid - Parses a required UUID tool argument, reporting a parse failure as
ChatbotErrorType::InvalidToolArguments naming
field_nameand the offending value.