Skip to content
FeedbackDashboard

Generate an AI commit message for a specific SDK

ProjectGenerateCommitMessageResponse projects().generateCommitMessage(ProjectGenerateCommitMessageParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v0/projects/{project}/generate_commit_message

Generates an AI commit message by comparing two git refs in the SDK repository.

ParametersExpand Collapse
ProjectGenerateCommitMessageParams params
Optional<String> project
Target target

Language target

PYTHON("python")
NODE("node")
TYPESCRIPT("typescript")
JAVA("java")
KOTLIN("kotlin")
GO("go")
RUBY("ruby")
TERRAFORM("terraform")
CLI("cli")
CSHARP("csharp")
PHP("php")
OPENAPI("openapi")
SQL("sql")
String baseRef

Base ref for comparison

String headRef

Head ref for comparison

ReturnsExpand Collapse
class ProjectGenerateCommitMessageResponse:
String aiCommitMessage

Generate an AI commit message for a specific SDK

package com.stainless.api.example;

import com.stainless.api.client.StainlessClient;
import com.stainless.api.client.okhttp.StainlessOkHttpClient;
import com.stainless.api.models.projects.ProjectGenerateCommitMessageParams;
import com.stainless.api.models.projects.ProjectGenerateCommitMessageResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        StainlessClient client = StainlessOkHttpClient.fromEnv();

        ProjectGenerateCommitMessageParams params = ProjectGenerateCommitMessageParams.builder()
            .target(ProjectGenerateCommitMessageParams.Target.PYTHON)
            .baseRef("base_ref")
            .headRef("head_ref")
            .build();
        ProjectGenerateCommitMessageResponse response = client.projects().generateCommitMessage(params);
    }
}
{
  "ai_commit_message": "ai_commit_message"
}
Returns Examples
{
  "ai_commit_message": "ai_commit_message"
}