Skip to main content

Module common

Module common 

Source

Enums§

JsonResult
Result of attempting to parse a (potentially partial) JSON string.

Functions§

call_tool
Validate tool arguments against its JSON schema and then execute it.
check_api_key
Verify that an environment variable containing an API key is set.
convert_event_to_message
Convert a persisted AgentEventAny back into an SDK Message.
estimate_tokens
Estimate the number of tokens in a given text using the GPT-2 tokenizer. Requires the token_estimation feature. Returns 0 if the feature is disabled.
parse_json_fragment
Parse a JSON string that may be incomplete (e.g. streaming tool arguments).