Skip to content

Commit 4e5c39c

Browse files
authored
feat(ai): add support for styleGuideIds in AI Translation methods (#262)
1 parent 8f5f1fc commit 4e5c39c

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

‎crowdin_api/api_resources/ai/tests/test_ai_resources.py‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,38 @@ def test_get_ai_file_translations_path(self, in_params, path, base_absolut_url):
11291129
"targetLanguageId": "uk",
11301130
},
11311131
),
1132+
(
1133+
AiFileTranslationRequest(
1134+
storageId=1,
1135+
targetLanguageId="uk",
1136+
sourceLanguageId="en",
1137+
type="txt",
1138+
parserVersion=1,
1139+
tmIds=[123],
1140+
glossaryIds=[456],
1141+
styleGuideIds=[654],
1142+
aiPromptId=789,
1143+
aiProviderId=12,
1144+
aiModelId="gpt-4.1",
1145+
instructions=["Keep a formal tone"],
1146+
attachmentIds=[123],
1147+
),
1148+
{
1149+
"storageId": 1,
1150+
"targetLanguageId": "uk",
1151+
"sourceLanguageId": "en",
1152+
"type": "txt",
1153+
"parserVersion": 1,
1154+
"tmIds": [123],
1155+
"glossaryIds": [456],
1156+
"styleGuideIds": [654],
1157+
"aiPromptId": 789,
1158+
"aiProviderId": 12,
1159+
"aiModelId": "gpt-4.1",
1160+
"instructions": ["Keep a formal tone"],
1161+
"attachmentIds": [123],
1162+
},
1163+
),
11321164
),
11331165
)
11341166
@mock.patch("crowdin_api.requester.APIRequester.request")
@@ -2449,6 +2481,38 @@ def test_get_ai_file_translations_path(self, in_params, path, base_absolut_url):
24492481
"targetLanguageId": "uk",
24502482
},
24512483
),
2484+
(
2485+
AiFileTranslationRequest(
2486+
storageId=1,
2487+
targetLanguageId="uk",
2488+
sourceLanguageId="en",
2489+
type="txt",
2490+
parserVersion=1,
2491+
tmIds=[123],
2492+
glossaryIds=[456],
2493+
styleGuideIds=[654],
2494+
aiPromptId=789,
2495+
aiProviderId=12,
2496+
aiModelId="gpt-4.1",
2497+
instructions=["Keep a formal tone"],
2498+
attachmentIds=[123],
2499+
),
2500+
{
2501+
"storageId": 1,
2502+
"targetLanguageId": "uk",
2503+
"sourceLanguageId": "en",
2504+
"type": "txt",
2505+
"parserVersion": 1,
2506+
"tmIds": [123],
2507+
"glossaryIds": [456],
2508+
"styleGuideIds": [654],
2509+
"aiPromptId": 789,
2510+
"aiProviderId": 12,
2511+
"aiModelId": "gpt-4.1",
2512+
"instructions": ["Keep a formal tone"],
2513+
"attachmentIds": [123],
2514+
},
2515+
),
24522516
),
24532517
)
24542518
@mock.patch("crowdin_api.requester.APIRequester.request")

‎crowdin_api/api_resources/ai/types.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ class AiFileTranslationRequest(TypedDict):
297297
parserVersion: Optional[int]
298298
tmIds: Optional[Iterable[int]]
299299
glossaryIds: Optional[Iterable[int]]
300+
styleGuideIds: Optional[Iterable[int]]
300301
aiPromptId: Optional[int]
301302
aiProviderId: Optional[int]
302303
aiModelId: Optional[str]

0 commit comments

Comments
 (0)