Terminology matches are particularly useful to get consistent translations when prompting LLMs.
Right now, we can search terminology via api/v2/search/terminology/, but that doesn't scale when translating a file in multiple locales, as it would require an absurd amount of calls (terms can be made of multiple words, so would need to get all combinations of 1–3 words in all strings, then send N queries, where N = num_locales x combinations)
Extract from string
Entrypoint: api/v2/terminology/extract-from-text.
Auth: Doesn't requires PAT, since it's only one string.
Accept a locale and text parameters. Returns a list of matching terms.
text should be capped, e.g. at 2k strings, and return an error if the string exceeds it.
{
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"definition": "string",
"part_of_speech": "adjective",
"text": "string",
"translation_text": "string",
"usage": "string",
"notes": "string"
}
]
}
Extract from file
Moved this to #4534
Terminology matches are particularly useful to get consistent translations when prompting LLMs.
Right now, we can search terminology via
api/v2/search/terminology/, but that doesn't scale when translating a file in multiple locales, as it would require an absurd amount of calls (terms can be made of multiple words, so would need to get all combinations of 1–3 words in all strings, then send N queries, whereN = num_locales x combinations)Extract from string
Entrypoint:
api/v2/terminology/extract-from-text.Auth: Doesn't requires PAT, since it's only one string.
Accept a
localeandtextparameters. Returns a list of matching terms.textshould be capped, e.g. at 2k strings, and return an error if the string exceeds it.Extract from file
Moved this to #4534