> ## Documentation Index
> Fetch the complete documentation index at: https://assembly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Change model and parameters

> Learn how you can customize LeMUR parameters to alter the outcome.

## Change the model type

LeMUR features the following LLMs:

* Claude 3.5 Sonnet
* Claude 3 Opus
* Claude 3 Haiku
* Claude 3 Sonnet
* Claude 2.1 (*Legacy - sunsetting on 02/06/25*)
* Claude 2 (*Legacy - sunsetting on 02/06/25*)

You can switch the model by specifying the `final_model` parameter.

| Model                                           | SDK Parameter                     | Description                                                                                                                                                                                                                                         |
| ----------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Claude 3.5 Sonnet**                           | `aai.LemurModel.claude3_5_sonnet` | Claude 3.5 Sonnet is the most intelligent model to date, outperforming Claude 3 Opus on a wide range of evaluations, with the speed and cost of Claude 3 Sonnet. This uses Anthropic's Claude 3.5 Sonnet model version`claude-3-5-sonnet-20240620`. |
| **Claude 3.0 Opus**                             | `aai.LemurModel.claude3_opus`     | Claude 3 Opus is good at handling complex analysis, longer tasks with many steps, and higher-order math and coding tasks.                                                                                                                           |
| **Claude 3.0 Haiku**                            | `aai.LemurModel.claude3_haiku`    | Claude 3 Haiku is the fastest model that can execute lightweight actions.                                                                                                                                                                           |
| **Claude 3.0 Sonnet**                           | `aai.LemurModel.claude3_sonnet`   | Claude 3 Sonnet is a legacy model with a balanced combination of performance and speed for efficient, high-throughput tasks.                                                                                                                        |
| **Claude 2.1**(Legacy - sunsetting on 02/06/25) | `aai.LemurModel.claude2_1`        | Claude 2.1 is a legacy model similar to Claude 2. The key difference is that it minimizes model hallucination and system prompts, has a larger context window, and performs better in citations.                                                    |
| **Claude 2**(Legacy - sunsetting on 02/06/25)   | `aai.LemurModel.claude2_0`        | Claude 2 is a legacy model that has good complex reasoning. It offers more nuanced responses and improved contextual comprehension.                                                                                                                 |

You can find more information on pricing for each model .

## Change the maximum output size

You can change the maximum output size in tokens by specifying the `max_output_size` parameter. Up to 4000 tokens are allowed.

<CodeGroup>
  ```python Python theme={"system"}
  result = transcript.lemur.task(
      prompt,
      max_output_size=1000
  )
  ```

  ```typescript Typescript theme={"system"}
  const { response } = await client.lemur.task({
    transcript_ids: [transcript.id],
    prompt,
    max_output_size: 1000
  })
  ```

  ```go Go theme={"system"}
  var params aai.LeMURTaskParams
  params.Prompt = aai.String(prompt)
  params.TranscriptIDs = []string{aai.ToString(transcript.ID)}
  params.MaxOutputSize = aai.Int64(2000)

  result, _ := client.LeMUR.Task(ctx, params)
  ```

  ```java Java theme={"system"}
  var params = LemurTaskParams.builder()
          .prompt(prompt)
          .transcriptIds(List.of(transcript.getId()))
          .maxOutputSize(1000)
          .build();
  ```

  ```csharp C# theme={"system"}
  var lemurTaskParams = new LemurTaskParams
  {
      Prompt = prompt,
      TranscriptIds = [transcript.Id],
      MaxOutputSize = 1000
  };
  ```

  ```ruby Ruby theme={"system"}
  response = client.lemur.task(
    prompt: prompt,
    transcript_ids: [transcript_id],
    max_output_size: 1000
  )
  ```
</CodeGroup>

## Change the temperature

You can change the temperature by specifying the `temperature` parameter, ranging from 0.0 to 1.0.

Higher values result in answers that are more creative, lower values are more conservative.

<CodeGroup>
  ```python Python theme={"system"}
  result = transcript.lemur.task(
      prompt,
      temperature=0.7
  )
  ```

  ```typescript Typescript theme={"system"}
  const { response } = await client.lemur.task({
    transcript_ids: [transcript.id],
    prompt,
    temperature: 0.7
  })
  ```

  ```go Go theme={"system"}
  var params aai.LeMURTaskParams
  params.Prompt = aai.String(prompt)
  params.TranscriptIDs = []string{aai.ToString(transcript.ID)}
  params.Temperature = aai.Float64(0.7)

  result, _ := client.LeMUR.Task(ctx, params)
  ```

  ```java Java theme={"system"}
  var params = LemurTaskParams.builder()
          .prompt(prompt)
          .transcriptIds(List.of(transcript.getId()))
          .temperature(0.7)
          .build();
  ```

  ```csharp C# theme={"system"}
  var params = LemurTaskParams.builder()
          .prompt(prompt)
          .transcriptIds(List.of(transcript.getId()))
          .temperature(0.7)
          .build();
  ```

  ```ruby Ruby theme={"system"}
  response = client.lemur.task(
    prompt: prompt,
    transcript_ids: [transcript_id],
    temperature: 0.7
  )
  ```
</CodeGroup>

## Send customized input

You can submit custom text inputs to LeMUR without transcript IDs. This allows you to customize the input, for example, you could include the speaker labels for the LLM.

To submit custom text input, use the `input_text` parameter on `aai.Lemur().task()`.

<CodeGroup>
  ```python Python theme={"system"}
  config = aai.TranscriptionConfig(
    speaker_labels=True,
  )
  transcript = transcriber.transcribe(audio_url, config=config)

  text_with_speaker_labels = ""
  for utt in transcript.utterances:
      text_with_speaker_labels += f"Speaker {utt.speaker}:\n{utt.text}\n"

  result = aai.Lemur().task(
      prompt,
      input_text=text_with_speaker_labels
  )
  ```

  ```typescript Typescript theme={"system"}
  const params = {
    audio: audioUrl,
    speaker_labels: true
  }
  const transcript = await client.transcripts.transcribe(params)

  const textWithSpeakerLabels = ''
  for (let utterance of transcript.utterances!) {
    textWithSpeakerLabels += `Speaker ${utterance.speaker}:\n${utterance.text}\n`
  }

  const { response } = await client.lemur.task({
    prompt: prompt,
    input_text: textWithSpeakerLabels
  })
  ```

  ```go Go theme={"system"}
  transcript, _ := client.Transcripts.TranscribeFromURL(ctx, audioURL, &aai.TranscriptOptionalParams{
      SpeakerLabels: aai.Bool(true),
  })

  var textWithSpeakerLabels string

  for _, utterance := range transcript.Utterances {
      textWithSpeakerLabels += fmt.Sprintf("Speaker %s:\n%s\n",
          aai.ToString(utterance.Speaker),
          aai.ToString(utterance.Text),
      )
  }

  var params aai.LeMURTaskParams
  params.Prompt = aai.String(prompt)
  params.InputText = aai.String(textWithSpeakerLabels)

  result, _ := client.LeMUR.Task(ctx, params)
  ```

  ```java Java theme={"system"}
  var params = TranscriptOptionalParams.builder()
          .speakerLabels(true)
          .build();

  Transcript transcript = client.transcripts().transcribe(audioUrl, params);

  String textWithSpeakerLabels = transcript.getUtterances()
          .map(utterances -> utterances.stream()
                  .map(utterance -> "Speaker " + utterance.getSpeaker() + ":\n" + utterance.getText() + "\n")
                  .collect(Collectors.joining()))
          .orElse("");

  var response = client.lemur().task(LemurTaskParams.builder()
          .prompt(prompt)
          .inputText(textWithSpeakerLabels)
          .build());
  ```

  ```csharp C# theme={"system"}
  var transcript = await client.Transcripts.TranscribeAsync(new TranscriptParams
  {
      AudioUrl = "https://assembly.ai/sports_injuries.mp3",
      SpeakerLabels = true
  });

  var textWithSpeakerLabels = string.Join(
      "",
      transcript.Utterances!.Select(utterance => $"Speaker {utterance.Speaker}:\n{utterance.Text}\n")
  );

  var lemurTaskParams = new LemurTaskParams
  {
      Prompt = prompt,
      InputText = textWithSpeakerLabels
  };

  var response = await client.Lemur.TaskAsync(lemurTaskParams);
  ```

  ```ruby Ruby theme={"system"}
  transcript = client.transcripts.transcribe(
    audio_url: audio_url,
    speaker_labels: true
  )

  text_with_speaker_labels = (transcript.utterances.map do |utterance|
    sprintf(
      "Speaker %<speaker>s:\n%<text>s\n",
      speaker: utterance.speaker,
      text: utterance.text
    )
  end).join("\n")

  response = client.lemur.task(
    prompt: prompt,
    input_text: text_with_speaker_labels
  )

  puts response.response
  ```
</CodeGroup>

## Submit multiple transcripts

LeMUR can easily ingest multiple transcripts in a single API call.

You can feed in up to a maximum of 100 files or 100 hours, whichever is lower.

<CodeGroup>
  ```python Python theme={"system"}
  transcript_group = transcriber.transcribe_group(
      [
          "https://example.org/customer1.mp3",
          "https://example.org/customer2.mp3",
          "https://example.org/customer3.mp3",
      ],
  )

  # Or use existing transcripts:
  # transcript_group = aai.TranscriptGroup.get_by_ids([id1, id2, id3])

  result = transcript_group.lemur.task(
    prompt="Provide a summary of these customer calls."
  )
  ```

  ```typescript Typescript theme={"system"}
  const { response } = await client.lemur.task({
    transcript_ids: [id1, id2, id3],
    prompt: 'Provide a summary of these customer calls.'
  })
  ```

  ```go Go theme={"system"}
  var params aai.LeMURTaskParams
  params.TranscriptIDs = []string{id1, id2, id3}
  params.Prompt = aai.String("Provide a summary of these customer calls.")

  result, _ := client.LeMUR.Task(ctx, params)
  ```

  ```java Java theme={"system"}
  var response = client.lemur().task(LemurTaskParams.builder()
          .prompt(prompt)
          .transcriptIds(List.of(id1, id2, id3))
          .build());
  ```

  ```csharp C# theme={"system"}
  var lemurTaskParams = new LemurTaskParams
  {
      Prompt = prompt,
      TranscriptIds = [id1, id2, id3]
  };
  ```

  ```ruby Ruby theme={"system"}
  response = client.lemur.task(
    prompt: prompt,
    transcript_ids: [id1, id2, id3]
  )
  ```
</CodeGroup>

## Delete data

You can delete the data for a previously submitted LeMUR request.

Response data from the LLM, as well as any context provided in the original request will be removed.

<CodeGroup>
  ```python Python theme={"system"}
  result = transcript.lemur.task(prompt)

  deletion_response = aai.Lemur.purge_request_data(result.request_id)
  ```

  ```typescript Typescript theme={"system"}
  const { response, request_id } = await client.lemur.task({
    transcript_ids: [transcript.id],
    prompt
  })

  const deletionResponse = await client.lemur.purgeRequestData(request_id)
  ```

  ```java Java theme={"system"}
  var response = client.lemur().task(LemurTaskParams.builder()
          .prompt(prompt)
          .transcriptIds(List.of(transcript.getId()))
          .build());

  var deletionResponse = client.lemur().purgeRequestData(response.getRequestId());
  ```

  ```csharp C# theme={"system"}
  var response = await client.Lemur.TaskAsync(lemurTaskParams);

  var deletionResponse = await client.Lemur.PurgeRequestDataAsync(response.RequestId);
  ```

  ```ruby Ruby theme={"system"}
  response = client.lemur.task(
    prompt: prompt,
    transcript_ids: [transcript_id],
  )

  deletion_response = client.lemur.purge_request_data(request_id: response.request_id)
  ```
</CodeGroup>

## API reference

You can find detailed information about all LeMUR API endpoints and parameters in the [LeMUR API reference](https://assemblyai.com/docs/api-reference/lemur).
