code: def generate_pr_title(
      pr_number: int,
      model: Model = "gpt-4",
      repo_name: str = "wandb/wandb",
  ) -> str:
      """Generate a PR title for a given PR number using the given model."""
      messages = [
          {
              "role": "system",
              "content": (
                  "Your task is to write a title for a GitHub pull request "
                  "that will follow the conventional commit format and capture the essence of the change: "
                  f"<type>(<scope>): <description>. The possible types are: {CC_TYPES}."
                  f"The possible scopes are: {CC_SCOPES}."
                  "The description must start with a verb in the imperative mood and be lower case."
                  "For context, the user will provide the current title and the diff of the pull request."
                  "and their corresponding labels."
                  "You must respond in the format: <type>(<scope>): <description>."
                  "Be concise and specific. If you are unsure, keep the original title."
                  "Even if you think the correct type or scope is missing, you must only use the provided options."
                  "Be concise."
              ),
          },
          {
              "role": "user",
              "content": "Title: {{TITLE}}. Diff: {{DIFF}}.",
          },
      ]
  
      pr_title, diff = get_pr_info(pr_number, repo_name=repo_name)
  
      # todo: check context limit, strip diff if too long
  
      messages[-1]["content"] = messages[-1]["content"].replace(
          "{{TITLE}}", pr_title
      )
      messages[-1]["content"] = messages[-1]["content"].replace(
          "{{DIFF}}", diff
      )
  
      completion = chat_completion_with_backoff(
          model=model,
          messages=messages,
      )
      suggested_title = completion.choices[0]["message"]["content"]
  
      return suggested_title
  
file_path: wandb/tools/pr-title-bot.py
imports: import argparse
  import os
  import sys
  from typing import Optional, Tuple
  from github import Github
  from openai import OpenAI
  from tenacity import retry, stop_after_attempt, wait_random_exponential
label_desc: Use image node_id 4 for calling a global function with example usage: generate_pr_title(pr_number, model, repo_name) and returns: suggested_title