Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add collection and map params to setAsrProperties #267

Conversation

OneFat3
Copy link
Contributor

@OneFat3 OneFat3 commented Oct 16, 2024

add collection and map params to setAsrProperties + test

fun handle(properties: Map<String, Any>, asrConfig: AsrConfig): AsrConfig {
val propertiesJson = JsonObject(properties.mapValues { entry ->
when (val value = entry.value) {
is List<*> -> JsonArray(value.map { JsonPrimitive(it.toString()) })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть ли аргументы, почему List а не Collection?

Кажется, что никаких пререквизитов листа не требуется

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CptBronzebeard Ожидается только List, но его методы не используются, поправил на Collection.
Также в документации к провайдерам заметил, что некоторые параметры могут потребовать вложенности, добавил Map.

@OneFat3 OneFat3 changed the title add list params to setAsrProperties add collection and map params to setAsrProperties Oct 21, 2024
@CptBronzebeard CptBronzebeard merged commit 156a5a9 into just-ai:master Oct 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants