git-ai 1.1.1

Git AI: Automates commit messages using ChatGPT. Stage your files, and Git AI generates the messages.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use ai::function_calling;

fn main() -> anyhow::Result<()> {
  // Test with default max length
  let tool = function_calling::create_commit_function_tool(None)?;
  let json = serde_json::to_string_pretty(&tool)?;
  println!("Function schema with default max length (72):");
  println!("{json}");
  println!("\n---\n");

  // Test with custom max length
  let tool = function_calling::create_commit_function_tool(Some(100))?;
  let json = serde_json::to_string_pretty(&tool)?;
  println!("Function schema with custom max length (100):");
  println!("{json}");

  Ok(())
}