Apply formatting
This commit is contained in:
@ -59,7 +59,12 @@ export async function openAI_ClassifyFeed(title: string): Promise<string> {
|
||||
|
||||
export async function openAI_GeneratePodcastContent(
|
||||
title: string,
|
||||
items: Array<{ title: string; link: string; content?: string; description?: string }>,
|
||||
items: Array<{
|
||||
title: string;
|
||||
link: string;
|
||||
content?: string;
|
||||
description?: string;
|
||||
}>,
|
||||
): Promise<string> {
|
||||
if (!title || title.trim() === "") {
|
||||
throw new Error("Feed title is required for podcast content generation");
|
||||
@ -78,22 +83,25 @@ export async function openAI_GeneratePodcastContent(
|
||||
}
|
||||
|
||||
// Build detailed article information including content
|
||||
const articleDetails = validItems.map((item, i) => {
|
||||
let articleInfo = `${i + 1}. タイトル: ${item.title}\nURL: ${item.link}`;
|
||||
|
||||
// Add content if available
|
||||
const content = item.content || item.description;
|
||||
if (content && content.trim()) {
|
||||
// Limit content length to avoid token limits
|
||||
const maxContentLength = 2000;
|
||||
const truncatedContent = content.length > maxContentLength
|
||||
? content.substring(0, maxContentLength) + "..."
|
||||
: content;
|
||||
articleInfo += `\n内容: ${truncatedContent}`;
|
||||
}
|
||||
|
||||
return articleInfo;
|
||||
}).join("\n\n");
|
||||
const articleDetails = validItems
|
||||
.map((item, i) => {
|
||||
let articleInfo = `${i + 1}. タイトル: ${item.title}\nURL: ${item.link}`;
|
||||
|
||||
// Add content if available
|
||||
const content = item.content || item.description;
|
||||
if (content && content.trim()) {
|
||||
// Limit content length to avoid token limits
|
||||
const maxContentLength = 2000;
|
||||
const truncatedContent =
|
||||
content.length > maxContentLength
|
||||
? content.substring(0, maxContentLength) + "..."
|
||||
: content;
|
||||
articleInfo += `\n内容: ${truncatedContent}`;
|
||||
}
|
||||
|
||||
return articleInfo;
|
||||
})
|
||||
.join("\n\n");
|
||||
|
||||
const prompt = `
|
||||
あなたはプロのポッドキャスタです。以下に示すフィードタイトルに基づき、そのトピックに関する詳細なポッドキャスト原稿を作成してください。
|
||||
|
Reference in New Issue
Block a user