Skip to content
FeedbackDashboard

Generate an AI commit message for a specific SDK

projects.generate_commit_message(ProjectGenerateCommitMessageParams**kwargs) -> ProjectGenerateCommitMessageResponse
POST/v0/projects/{project}/generate_commit_message

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

ParametersExpand Collapse
project: Optional[str]
target: Literal["python", "node", "typescript", 10 more]

Language target

Accepts one of the following:
"python"
"node"
"typescript"
"java"
"kotlin"
"go"
"ruby"
"terraform"
"cli"
"csharp"
"php"
"openapi"
"sql"
base_ref: str

Base ref for comparison

head_ref: str

Head ref for comparison

ReturnsExpand Collapse
class ProjectGenerateCommitMessageResponse:
ai_commit_message: str

Generate an AI commit message for a specific SDK

import os
from stainless_v0 import Stainless

client = Stainless(
    api_key=os.environ.get("STAINLESS_API_KEY"),  # This is the default and can be omitted
)
response = client.projects.generate_commit_message(
    project="project",
    target="python",
    base_ref="base_ref",
    head_ref="head_ref",
)
print(response.ai_commit_message)
{
  "ai_commit_message": "ai_commit_message"
}
Returns Examples
{
  "ai_commit_message": "ai_commit_message"
}