execute#

langchain_prompty.utils.execute(
prompt: str | Prompty,
configuration: dict[str, Any] = {},
parameters: dict[str, Any] = {},
inputs: dict[str, Any] = {},
raw: bool = False,
connection: str = 'default',
) β†’ Any[source]#

Execute a prompty.

Parameters:
  • prompt (str | Prompty) – The prompt to execute. Can be a path to a prompty file or a Prompty object.

  • configuration (dict[str, Any]) – The configuration to use. Defaults to {}.

  • parameters (dict[str, Any]) – The parameters to use. Defaults to {}.

  • inputs (dict[str, Any]) – The inputs to the prompty. Defaults to {}.

  • raw (bool) – Whether to return the raw output. Defaults to False.

  • connection (str) – The connection to use. Defaults to β€œdefault”.

Returns:

The result of executing the prompty.

Return type:

Any