Prompt Decorator
Auto-instrumentation for LLM provider calls
Auto-instrumentation for LLM provider calls
The Prompt decorator automatically instruments LLM provider calls and creates Prompt Logs on Humanloop. When applied to a function, it:
The decorated function will have the same signature as the original function.
The hyperparameters of the LLM provider call are used to version the Prompt.
If the configuration changes, new Logs will be created under the new version of the the same Prompt.
The following parameters are considered for versioning the Prompt:
Each LLM provider call within the decorated function creates a Log with the following fields set:
error field. However, HumanloopRuntimeError is not caught and will be re-raised: they indicate wrong SDK or decorator usage.prompts.log() or prompts.call() inside the decorated function works normally, with no interaction with the decorator. However, it indicates a misuse of the decorator, as they are alternatives for achieving the same result.prompts.call() with a provider parameter instead of the decorator.Humanloop Prompts are more than the string passed to the LLM provider. They encapsulate LLM hyperparameters, associations to available tools, and can be templated. For more details, refer to our Prompts explanation.