@gendive/slide 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6313,12 +6313,13 @@ class $f extends Error {
6313
6313
  }
6314
6314
  }
6315
6315
  const xv = async (t, e, n, o, i, c) => {
6316
- const h = `${e.baseUrl || ZS}/${t}`, p = await fetch(h, {
6316
+ const h = `${e.baseUrl || ZS}/${t}`, p = {
6317
+ "Content-Type": "application/json"
6318
+ };
6319
+ !e.skipAuth && e.apiKey && (p["X-API-KEY"] = e.apiKey), e.customHeaders && Object.assign(p, e.customHeaders);
6320
+ const u = await fetch(h, {
6317
6321
  method: "POST",
6318
- headers: {
6319
- "Content-Type": "application/json",
6320
- "X-API-KEY": e.apiKey
6321
- },
6322
+ headers: p,
6322
6323
  body: JSON.stringify({
6323
6324
  prompt: n,
6324
6325
  system_prompt: o,
@@ -6326,15 +6327,20 @@ const xv = async (t, e, n, o, i, c) => {
6326
6327
  temperature: c || 0.7
6327
6328
  })
6328
6329
  });
6329
- if (!p.ok) {
6330
- const u = await p.json().catch(() => ({}));
6330
+ if (!u.ok) {
6331
+ const y = await u.json().catch(() => ({}));
6331
6332
  throw new $f(
6332
- u.detail || `DevDive API 오류: ${p.status}`,
6333
- u.code,
6334
- p.status
6333
+ y.detail || `DevDive API 오류: ${u.status}`,
6334
+ y.code,
6335
+ u.status
6335
6336
  );
6336
6337
  }
6337
- return p.json();
6338
+ const A = await u.json();
6339
+ return A.result && !A.content ? {
6340
+ content: {
6341
+ text: typeof A.result == "string" ? A.result : JSON.stringify(A.result)
6342
+ }
6343
+ } : A;
6338
6344
  }, $S = async (t, e) => {
6339
6345
  const o = `당신은 프레젠테이션 콘텐츠 작성 전문가입니다. ${{
6340
6346
  title: "제목으로 사용할 짧고 임팩트 있는",