utils#

Classes

utils.utils.JSONObjectEncoder(*[, skipkeys, ...])

Custom JSON encoder for objects in LangChain.

Functions

utils.env.get_from_dict_or_env(data, key, ...)

Get a value from a dictionary or an environment variable.

utils.env.get_from_env(key, env_key[, ...])

Get a value from a dictionary or an environment variable.

utils.math.cosine_similarity(X, Y)

Row-wise cosine similarity between two equal-width matrices.

utils.math.cosine_similarity_top_k(X, Y[, ...])

Row-wise cosine similarity with optional top-k and score threshold filtering.

utils.utils.detect_file_src_type(file_path)

Detect if the file is local or remote.

utils.utils.download_audio_from_url(audio_url)

Download audio from url to local.

utils.utils.get_endpoint_from_project(...[, ...])

Retrieves the endpoint and credentials required a given a project endpoint.