chainfury CLI

We made this super extensible so you can do things via CLI as well.

chainfury.cli.help()[source]
chainfury.cli.main()[source]
chainfury.cli.run(chain: str, inp: str, stream: bool = False, print_thoughts: bool = False, f=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]

Run a chain with input and write the outputs.

Parameters:
  • chain (str) – This can be one of json filepath (e.g. “/chain.json”), json string (e.g. ‘{“id”: “99jcjs9j2”, …}’), chain id (e.g. “99jcjs9j2”)

  • inp (str) – This can be one of json filepath (e.g. “/input.json”), json string (e.g. ‘{“foo”: “bar”, …}’)

  • stream (bool, optional) – Whether to stream the output. Defaults to False.

  • print_thoughts (bool, optional) – Whether to print thoughts. Defaults to False.

  • f (file, optional) – File to write the output to. Defaults to sys.stdout.

Examples

>>> $ cf run ./sample.json {"foo": "bar"}