Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hot fix: Manage > 1 length vectors as inputs for output, summary structure and diarization instructions #11

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: minutemaker
Title: GenAI-based meeting and conferences minutes generator
Version: 0.5.1
Version: 0.5.2
Authors@R:
person("Angelo", "D'Ambrosio", , "a.dambrosioMD@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-2045-5155"))
Expand Down
30 changes: 30 additions & 0 deletions R/prompts.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ generate_summarisation_prompt <- function(
args$extra_output_instructions
)

# Remove extra_output_instructions since it would trigger the length check
# later
args$extra_output_instructions <- NULL

# Collapse output instruction into a bullet point list
args$output_instructions <- paste0(
"- ",
args$output_instructions,
Expand All @@ -270,6 +275,19 @@ generate_summarisation_prompt <- function(
args$output_length <- "3"
}

# Aggregate arguments if length > 1 vectors
if (length(args$extra_diarization_instructions) > 1) {
args$extra_diarization_instructions <- paste(
args$extra_diarization_instructions, collapse = "\n"
)
}

if (length(args$summary_structure) > 1) {
args$summary_structure <- paste(
args$summary_structure, collapse = "\n"
)
}

prompt <- paste(

get_prompts("base_task"),
Expand Down Expand Up @@ -355,6 +373,11 @@ generate_rolling_aggregation_prompt <- function(
args$extra_output_instructions
)

# Remove extra_output_instructions since it would trigger the length check
# later
args$extra_output_instructions <- NULL

# Collapse output instruction into a bullet point list
args$output_instructions <- paste0(
"- ",
args$output_instructions,
Expand All @@ -365,6 +388,13 @@ generate_rolling_aggregation_prompt <- function(
args$output_length <- "3"
}

# Aggregate arguments if length > 1 vectors
if (length(args$summary_structure) > 1) {
args$summary_structure <- paste(
args$summary_structure, collapse = "\n"
)
}

summary_seq <- seq_along(summaries)

summaries <- stringr::str_glue(
Expand Down