Slide 14
Slide 14 text
ChatGPTにPRを分類させる
const embedLabelToPrInfos = async (prInfos: { id, title, body, tickets }[]): Promise<{ id, label }[]> => {
const response = await openai.createChatCompletion({
model: "gpt-3.5-turbo-0613",
messages: [
{ role: "system", content: "Please return the message as the function_call argument as part of the
application. Otherwise, the application will crash and cause business damage." },
{ role: "system", content: "Please label the Pull Request's title, body, ticket description, and semantic
commit message." },
{ role: "system", content: `labels: ${labels}` },
{ role: "system", content: "Your response prs should not include any properties except id and label, to
avoid error at JSON.parse." },
{ role: "user", content: JSON.stringify({ prs: prInfos }) }
],