Module zep_python.utils

Expand source code
from enum import Enum
from typing import Any, Dict


class SearchType(str, Enum):
    similarity = "similarity"
    mmr = "mmr"


def filter_dict(d: Dict[Any, Any]) -> Dict[Any, Any]:
    """
    Filters out None values from a dictionary.

    Parameters
    ----------
    d : Dict[Any, Any]
        The dictionary to be filtered.

    Returns
    -------
    Dict[Any, Any]
        The filtered dictionary.
    """
    return {k: v for k, v in d.items() if v is not None}

Functions

def filter_dict(d: Dict[Any, Any]) ‑> Dict[Any, Any]

Filters out None values from a dictionary.

Parameters

d : Dict[Any, Any]
The dictionary to be filtered.

Returns

Dict[Any, Any]
The filtered dictionary.
Expand source code
def filter_dict(d: Dict[Any, Any]) -> Dict[Any, Any]:
    """
    Filters out None values from a dictionary.

    Parameters
    ----------
    d : Dict[Any, Any]
        The dictionary to be filtered.

    Returns
    -------
    Dict[Any, Any]
        The filtered dictionary.
    """
    return {k: v for k, v in d.items() if v is not None}

Classes

class SearchType (*args, **kwds)

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.

Expand source code
class SearchType(str, Enum):
    similarity = "similarity"
    mmr = "mmr"

Ancestors

  • builtins.str
  • enum.Enum

Class variables

var mmr
var similarity