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

feat: Added AI related API support #249

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Durdush
Copy link
Contributor

@Durdush Durdush commented May 28, 2024

No description provided.

* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.ai.prompts.getMany" target="_blank"><b>API Documentation</b></a></li>
* </ul>
*/
public ResponseList<AiPrompt> listAiPrompts (Long userId, Long projectId, String action, Long limit, Integer offset) throws HttpException, HttpBadRequestException {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public ResponseList<AiPrompt> listAiPrompts (Long userId, Long projectId, String action, Long limit, Integer offset) throws HttpException, HttpBadRequestException {
public ResponseList<AiPrompt> listAiPrompts(Long userId, Long projectId, String action, Long limit, Integer offset) throws HttpException, HttpBadRequestException {

Usually we don't put a space after the method name. Please fix this here and in other methods

"limit", Optional.ofNullable(limit),
"offset", Optional.ofNullable(offset)
);
AiPromptResponseList aiPromptResponseList = this.httpClient.get(this.url + "/users/" + userId + "/ai/prompts", new HttpRequestConfig(queryParams), AiPromptResponseList.class);
Copy link
Member

Choose a reason for hiding this comment

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

The Crowdin Enterprise version of these API endpoints has a different request URL (without the userId subpath)

https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.getMany

A similar situation existed in PR #242. Please consider the same approach in the current implementation.

AiPromptResponseObject response = this.httpClient.get(this.url + "/users/" + userId + "/ai/prompts/" + aiPromptId, new HttpRequestConfig(), AiPromptResponseObject.class);
return ResponseObject.of(response.getData());
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

* @param request request object
* @return newly created Ai prompt
* @see <ul>
* <li><a href="https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.post" target="_blank"><b>API Documentation</b></a></li>
Copy link
Member

Choose a reason for hiding this comment

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

Missing Crowdin Enterprise links

@@ -0,0 +1,24 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Format this JSON

}

@Test
public void listAiPromptTest(){
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public void listAiPromptTest(){
public void listAiPromptTest() {

@andrii-bodnar
Copy link
Member

Hi @Durdush, could you please take a look at the discussions? Thanks!

@andrii-bodnar andrii-bodnar linked an issue Jun 17, 2024 that may be closed by this pull request
@andrii-bodnar andrii-bodnar marked this pull request as draft June 19, 2024 06:30
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.

AI API support
2 participants