Ask questions about your audio data
In this guide, you’ll learn how to use LeMUR to ask questions and get answers about your audio data.
If you want a Quickstart, see Apply LLMs to audio files.
Before you start
To use LeMUR, you need an AssemblyAI account with a credit card set up.
Basic Q&A example
If you want to send a custom prompt to the LLM, you can use the LeMUR Task and apply the model to your transcribed audio files.
Python
TypeScript
Go
Java
C#
Ruby
To ask question about your audio data, define a prompt with your questions and call transcript.lemur.task()
. The underlying transcript
is automatically used as additional context for the model.
Example output
Q&A with specialized endpoint
The LeMUR Question & Answer function requires no prompt engineering and facilitates more deterministic and structured outputs. See the code examples below for more information on how to use this endpoint.
Python
TypeScript
Go
Java
C#
Ruby
To use it, define a list of aai.LemurQuestion
objects. For each question, you can define additional context
and specify either a answer_format
or a list of answer_options
. Additionally, you can define an overall context
.
Custom Q&A example (Advanced)
This example shows how you can run a custom LeMUR task with an advanced prompt to create custom Q&A responses:
More Q&A prompt examples
Try any of these prompts to get started:
For more use cases and prompt examples, see LeMUR examples.
API reference
Improve the results
To improve the results, see the following resources:
- Optimize your prompt with the prompt engineering guide.
- To alter the outcome, see Change model and parameters.