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