langchain_prompty.utils.execute

langchain_prompty.utils.execute(prompt: Union[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 (Union[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