Skip to content
FeedbackDashboard

Generate an AI commit message for a specific SDK

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

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

ParametersExpand Collapse
project: String
target: :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: String

Base ref for comparison

head_ref: String

Head ref for comparison

ReturnsExpand Collapse
class ProjectGenerateCommitMessageResponse { ai_commit_message }
ai_commit_message: String

Generate an AI commit message for a specific SDK

require "stainless_v0"

stainless = StainlessV0::Client.new(
  api_key: "My API Key",
  environment: "staging" # defaults to "production"
)

response = stainless.projects.generate_commit_message(
  project: "project",
  target: :python,
  base_ref: "base_ref",
  head_ref: "head_ref"
)

puts(response)
{
  "ai_commit_message": "ai_commit_message"
}
Returns Examples
{
  "ai_commit_message": "ai_commit_message"
}