langchain.utilities.scenexplain.SceneXplainAPIWrapper¶
- class langchain.utilities.scenexplain.SceneXplainAPIWrapper(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, scenex_api_key: str, scenex_api_url: str = 'https://api.scenex.jina.ai/v1/describe')[source]¶
Bases:
BaseSettings,BaseModelWrapper for SceneXplain API.
In order to set this up, you need API key for the SceneXplain API. You can obtain a key by following the steps below. - Sign up for a free account at https://scenex.jina.ai/. - Navigate to the API Access page (https://scenex.jina.ai/api)
and create a new API key.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- param scenex_api_key: str [Required]¶
- param scenex_api_url: str = 'https://api.scenex.jina.ai/v1/describe'¶
- model Config¶
Bases:
BaseConfig- getter_dict¶
alias of
GetterDict
- classmethod customise_sources(init_settings: Callable[[BaseSettings], Dict[str, Any]], env_settings: Callable[[BaseSettings], Dict[str, Any]], file_secret_settings: Callable[[BaseSettings], Dict[str, Any]]) Tuple[Callable[[BaseSettings], Dict[str, Any]], ...]¶
- classmethod get_field_info(name: unicode) Dict[str, Any]¶
Get properties of FieldInfo from the fields property of the config class.
- json_dumps(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)¶
Serialize
objto a JSON formattedstr.If
skipkeysis true thendictkeys that are not basic types (str,int,float,bool,None) will be skipped instead of raising aTypeError.If
ensure_asciiis false, then the return value can contain non-ASCII characters if they appear in strings contained inobj. Otherwise, all such characters are escaped in JSON strings.If
check_circularis false, then the circular reference check for container types will be skipped and a circular reference will result in anRecursionError(or worse).If
allow_nanis false, then it will be aValueErrorto serialize out of rangefloatvalues (nan,inf,-inf) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN,Infinity,-Infinity).If
indentis a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines.Noneis the most compact representation.If specified,
separatorsshould be an(item_separator, key_separator)tuple. The default is(', ', ': ')if indent isNoneand(',', ': ')otherwise. To get the most compact JSON representation, you should specify(',', ':')to eliminate whitespace.default(obj)is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError.If sort_keys is true (default:
False), then the output of dictionaries will be sorted by key.To use a custom
JSONEncodersubclass (e.g. one that overrides the.default()method to serialize additional types), specify it with theclskwarg; otherwiseJSONEncoderis used.
- json_loads(*, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)¶
Deserialize
s(astr,bytesorbytearrayinstance containing a JSON document) to a Python object.object_hookis an optional function that will be called with the result of any object literal decode (adict). The return value ofobject_hookwill be used instead of thedict. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting).object_pairs_hookis an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value ofobject_pairs_hookwill be used instead of thedict. This feature can be used to implement custom decoders. Ifobject_hookis also defined, theobject_pairs_hooktakes priority.parse_float, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal).parse_int, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float).parse_constant, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered.To use a custom
JSONDecodersubclass, specify it with theclskwarg; otherwiseJSONDecoderis used.
- classmethod parse_env_var(field_name: unicode, raw_val: unicode) Any¶
- classmethod prepare_field(field: ModelField) None¶
Optional hook to check or modify fields during model creation.
- alias_generator = None¶
- allow_inf_nan = True¶
- allow_mutation = True¶
- allow_population_by_field_name = False¶
- anystr_lower = False¶
- anystr_strip_whitespace = False¶
- anystr_upper = False¶
- arbitrary_types_allowed = True¶
- case_sensitive = False¶
- copy_on_model_validation = 'shallow'¶
- env_file = None¶
- env_file_encoding = None¶
- env_nested_delimiter = None¶
- env_prefix = ''¶
- error_msg_templates = {}¶
- extra = 'forbid'¶
- fields = {}¶
- frozen = False¶
- json_encoders = {}¶
- keep_untouched = ()¶
- max_anystr_length = None¶
- min_anystr_length = 0¶
- orm_mode = False¶
- post_init_call = 'before_validation'¶
- schema_extra = {}¶
- secrets_dir = None¶
- smart_union = False¶
- title = None¶
- underscore_attrs_are_private = False¶
- use_enum_values = False¶
- validate_all = True¶
- validate_assignment = False¶