Skip to content

Commit

Permalink
docs: update documentation
Browse files Browse the repository at this point in the history
Update README to describe the use of llmR for summarisation and the addition of the new local models for stt.
  • Loading branch information
bakaburg1 committed Oct 11, 2024
1 parent 3227b0d commit 8bff883
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 84 deletions.
85 changes: 43 additions & 42 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,63 +58,64 @@ Here is an example workflow.

### Setting up the package

You need to set up the API keys for the speech-to-text and text summarization
APIs. You can do this by setting the following options:
You need to set up the infrastructure for the speech-to-text and text
summarization APIs.
The LLM-powered summarization requires the `bakaburg1/llmR` package which is
installed (from GitHub) together with `minutemaker`.

```{r, eval = FALSE}
You can do this by setting the following options:

# Load the package
```{r, eval = FALSE}
# Load the necessary packages
library(minutemaker)
# Set the API information for the speech-to-text API of choice
# OpenAI example
# Set up LLM model of choice using llmR functions
options(
# OpenAI API Key (for both text-to-speech and text summary)
minutemaker_openai_api_key = "***",
minutemaker_openai_model_gpt = "gpt-4"
# Example: Setting up OpenAI GPT-4 model
llmR::record_llmr_model(
label = "openai",
provider = "openai",
model = "gpt-4",
api_key = "your_openai_api_key"
)
# Azure example
options(
# Azure Whisper API (for text-to-speech)
minutemaker_azure_resource_whisper = "***",
minutemaker_azure_deployment_whisper = "***",
minutemaker_azure_api_key_whisper = "***",
# Azure GPT API (for text summary)
minutemaker_azure_resource_gpt = "***",
minutemaker_azure_deployment_gpt = "***",
minutemaker_azure_api_key_gpt = "***",
# Azure common parameters (common)
minutemaker_azure_api_version = "***"
# Example: Setting up Azure GPT model
llmR::record_llmr_model(
label = "azure_gpt",
provider = "azure",
model = "your_azure_deployment_id",
endpoint = "https://your-resource-name.openai.azure.com",
api_key = "your_azure_api_key",
api_version = "2024-06-01"
)
# Local GPT model example
options(
# Local LLM model (for text summary)
minutemaker_local_endpoint_gpt = "local-host-path-to-model"
)
# Set the preferred LLM globally using one of the labels defined above
llmR::set_llmr_model("openai")
# Set the preferred LLM globally
# Set up the speech-to-text (STT) options
options(
minutemaker_llm_provider = "***" # E.g. "openai", "azure", "local" or custom
# Choose the STT model among online models: "azure_whisper" or "openai_whisper"
# or local models: "whisper_local", "mlx_whisper_local" (python based),
# (use "mlx_whisper_local" for Apple Silicon)
# "whisper_ctranslate2" (cli based, install ctranslate2 separately)
minutemaker_stt_model = "whisper_local",
# OpenAI Whisper API Key (for remote OpenAI whisper model)
minutemaker_openai_api_key = "your_openai_api_key",
# Azure Whisper API credentials (for remote Azure whisper model)
minutemaker_azure_resource_whisper = "your_azure_resource_name",
minutemaker_azure_deployment_whisper = "your_azure_deployment_id",
minutemaker_azure_api_key_whisper = "your_azure_api_key",
minutemaker_azure_api_version = "2024-06-01"
)
```

These setting can be also passed manually to the various functions, but the
option system is more convenient.
Of course you just need to set the options for the APIs you want to use (e.g.,
you don't need the speech-to-text API options if you already have a transcript).
These settings can also be passed manually to the various functions, but the
option system is more convenient. You only need to set the options for the APIs
you want to use (e.g., you don't need the speech-to-text API options if you
already have a transcript).

### Transcribing the audio

Expand Down
84 changes: 43 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,62 +51,64 @@ Here is an example workflow.

### Setting up the package

You need to set up the API keys for the speech-to-text and text
summarization APIs. You can do this by setting the following options:
You need to set up the infrastructure for the speech-to-text and text
summarization APIs. The LLM-powered summarization requires the
`bakaburg1/llmR` package which is installed (from GitHub) together with
`minutemaker`.

``` r
You can do this by setting the following options:

# Load the package
``` r
# Load the necessary packages
library(minutemaker)

# Set the API information for the speech-to-text API of choice
# Set up LLM model of choice using llmR functions

# OpenAI example

options(

# OpenAI API Key (for both text-to-speech and text summary)
minutemaker_openai_api_key = "***",

minutemaker_openai_model_gpt = "gpt-4"
# Example: Setting up OpenAI GPT-4 model
llmR::record_llmr_model(
label = "openai",
provider = "openai",
model = "gpt-4",
api_key = "your_openai_api_key"
)

# Azure example

options(

# Azure Whisper API (for text-to-speech)
minutemaker_azure_resource_whisper = "***",
minutemaker_azure_deployment_whisper = "***",
minutemaker_azure_api_key_whisper = "***",

# Azure GPT API (for text summary)
minutemaker_azure_resource_gpt = "***",
minutemaker_azure_deployment_gpt = "***",
minutemaker_azure_api_key_gpt = "***",

# Azure common parameters (common)
minutemaker_azure_api_version = "***"
# Example: Setting up Azure GPT model
llmR::record_llmr_model(
label = "azure_gpt",
provider = "azure",
model = "your_azure_deployment_id",
endpoint = "https://your-resource-name.openai.azure.com",
api_key = "your_azure_api_key",
api_version = "2024-06-01"
)

# Local GPT model example

options(
# Local LLM model (for text summary)
minutemaker_local_endpoint_gpt = "local-host-path-to-model"
)
# Set the preferred LLM globally using one of the labels defined above
llmR::set_llmr_model("openai")

# Set the preferred LLM globally
# Set up the speech-to-text (STT) options

options(
minutemaker_llm_provider = "***" # E.g. "openai", "azure", "local" or custom
# Choose the STT model among online models: "azure_whisper" or "openai_whisper"
# or local models: "whisper_local", "mlx_whisper_local" (python based),
# (use "mlx_whisper_local" for Apple Silicon)
# "whisper_ctranslate2" (cli based, install ctranslate2 separately)
minutemaker_stt_model = "whisper_local",

# OpenAI Whisper API Key (for remote OpenAI whisper model)
minutemaker_openai_api_key = "your_openai_api_key",

# Azure Whisper API credentials (for remote Azure whisper model)
minutemaker_azure_resource_whisper = "your_azure_resource_name",
minutemaker_azure_deployment_whisper = "your_azure_deployment_id",
minutemaker_azure_api_key_whisper = "your_azure_api_key",
minutemaker_azure_api_version = "2024-06-01"
)
```

These setting can be also passed manually to the various functions, but
the option system is more convenient. Of course you just need to set the
options for the APIs you want to use (e.g., you don’t need the
speech-to-text API options if you already have a transcript).
These settings can also be passed manually to the various functions, but
the option system is more convenient. You only need to set the options
for the APIs you want to use (e.g., you don’t need the speech-to-text
API options if you already have a transcript).

### Transcribing the audio

Expand Down
2 changes: 1 addition & 1 deletion man/speech_to_summary_workflow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8bff883

Please # to comment.