Package genlayer.std.nondet_fns#

Warning

This is an internal module

class genlayer.std.nondet_fns.ExecPromptKwArgs[source]#
clear() None.  Remove all items from D.#
copy() a shallow copy of D#
fromkeys(value=None, /)#

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)#

Return the value for key if key is in the dictionary, else default.

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
pop(k[, d]) v, remove specified key and return the corresponding value.#

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()#

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

response_format: NotRequired[Literal['text', 'json']]#

Defaults to text

setdefault(key, default=None, /)#

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from mapping/iterable E and F.#

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D's values#
class genlayer.std.nondet_fns.GetWebpageKwArgs[source]#
clear() None.  Remove all items from D.#
copy() a shallow copy of D#
fromkeys(value=None, /)#

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)#

Return the value for key if key is in the dictionary, else default.

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
mode: Literal['html', 'text', 'screenshot']#

Mode in which to return the result

pop(k[, d]) v, remove specified key and return the corresponding value.#

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()#

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)#

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from mapping/iterable E and F.#

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D's values#
wait_after_loaded: NotRequired[str]#

How long to wait after dom loaded (for js to emit dynamic content) Should be in format such as “1000ms” or “1s”

genlayer.std.nondet_fns.exec_prompt(prompt: str, *, images: collections.abc.Sequence[bytes | Image] | None = None) str[source]#
genlayer.std.nondet_fns.exec_prompt(prompt: str, *, response_format: Literal['text'], images: collections.abc.Sequence[bytes | Image] | None = None) str
genlayer.std.nondet_fns.exec_prompt(prompt: str, *, response_format: Literal['json'], image: bytes | Image | None = None) dict[str, Any]

API to execute a prompt (perform NLP)

Parameters:
Return type:

str

Note

supports .lazy() version, which will return Lazy

genlayer.std.nondet_fns.get_webpage(url: str, *, wait_after_loaded: str | None = None, mode: Literal['text', 'html']) str[source]#
genlayer.std.nondet_fns.get_webpage(url: str, *, wait_after_loaded: str | None = None, mode: Literal['screenshot']) Image

API to get a webpage after rendering it

Parameters:
Return type:

str

Note

supports .lazy() version, which will return Lazy