Skip to content
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
30 changes: 27 additions & 3 deletions src/ai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

export class Ai extends CrowdinApi {
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param options request options
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.custom.placeholders.getMany
*/
Expand All @@ -22,6 +23,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.post
*/
Expand All @@ -33,6 +35,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.get
*/
Expand All @@ -44,6 +47,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.delete
*/
Expand All @@ -53,6 +57,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.patch
Expand All @@ -66,6 +71,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param aiPromptId ai prompt identifier
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.post
Expand All @@ -80,6 +86,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.get
Expand All @@ -94,6 +101,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
* @param options request options
Expand All @@ -109,6 +117,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param options request options
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.getMany
*/
Expand All @@ -122,6 +131,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param aiPromptId ai prompt identifier
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.post
Expand All @@ -136,6 +146,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.get
Expand All @@ -150,6 +161,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.get
Expand Down Expand Up @@ -429,7 +441,7 @@
*/
getAiOrganizationSettings(): Promise<ResponseObject<AiModel.AiSettings>> {
const url = `${this.url}/ai/settings`;
return this.get(url);
return this.get(url, this.defaultConfig());
}

/**
Expand Down Expand Up @@ -457,6 +469,7 @@
// Community

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param options request options
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompt.custom.placeholders.getMany
Expand All @@ -470,6 +483,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.post
Expand All @@ -483,6 +497,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.get
Expand All @@ -496,6 +511,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.delete
Expand All @@ -506,6 +522,7 @@
}

/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @param request request body
Expand All @@ -521,6 +538,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param aiPromptId ai prompt identifier
* @param request request body
Expand All @@ -537,6 +555,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
Expand All @@ -553,6 +572,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
Expand All @@ -570,6 +590,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param options request options
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.getMany
Expand All @@ -585,6 +606,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param aiPromptId ai prompt identifier
* @param request request body
Expand All @@ -601,6 +623,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
Expand All @@ -617,6 +640,7 @@
}

/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
Expand Down Expand Up @@ -944,9 +968,9 @@
* @param userId user Identifier
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.settings.get
*/
getAiUsertSettings(userId: number): Promise<ResponseObject<AiModel.AiSettings>> {
getAiUserSettings(userId: number): Promise<ResponseObject<AiModel.AiSettings>> {
const url = `${this.url}/users/${userId}/ai/settings`;
return this.get(url);
return this.get(url, this.defaultConfig());
}

/**
Expand Down Expand Up @@ -1165,7 +1189,7 @@
mode: 'external';
identifier: string;
key: string;
options?: any;

Check warning on line 1192 in src/ai/index.ts

View workflow job for this annotation

GitHub Actions / code-coverage

Unexpected any. Specify a different type
}

export interface AddAiPromptRequest {
Expand Down Expand Up @@ -1241,7 +1265,7 @@
}

export interface OverridePromptValues {
[key: string]: any;

Check warning on line 1268 in src/ai/index.ts

View workflow job for this annotation

GitHub Actions / code-coverage

Unexpected any. Specify a different type
}
/* ai Prompts Section END*/

Expand Down Expand Up @@ -1369,7 +1393,7 @@

export interface OtherChatCompletionRequest {
stream?: boolean;
[key: string]: any;

Check warning on line 1396 in src/ai/index.ts

View workflow job for this annotation

GitHub Actions / code-coverage

Unexpected any. Specify a different type
}

export interface GoogleGeminiChatCompletionRequest extends OtherChatCompletionRequest {
Expand Down
2 changes: 1 addition & 1 deletion tests/ai/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ describe('AI API', () => {
});

it('Get AI User Settings', async () => {
const settings = await api.getAiUsertSettings(userId);
const settings = await api.getAiUserSettings(userId);
expect(settings.data.assistActionAiPromptId).toBe(assistActionAiPromptId);
});

Expand Down
Loading