A guide on how to call your Prompts that are managed on Humanloop.

This guide will show you how to call your Prompts through the API, enabling you to generate responses from the large language model while versioning your Prompts.

You can call an existing Prompt on Humanloop, or you can call a Prompt you’re managing in code. These two use-cases are demonstrated below.

Prerequisites

Call an existing Prompt

If you don’t have Prompt already on Humanloop, please follow our Prompt creation guide first.

1

Get the Prompt ID

In Humanloop, navigate to the Prompt and copy the Prompt ID by clicking Prompt name in the top bar, and copying from the popover.

2

Call the Prompt by ID

Now you can use the SDK to generate completions and log the results to your Prompt:

This can be done by using the Prompt Call method in the SDK.

Call a Prompt defined in code

You can also manage your Prompts in code. Pass the prompt details within your API call to generate responses with the specified parameters.

View your Prompt Logs

Navigate to the Logs tab of your Prompt. You will be able to see the recorded inputs, messages and model generations.

Next steps