@gendive/slide 0.1.11 → 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.
@@ -171,7 +171,7 @@ ${String(y)}`)}return s&&c&&A.path.startsWith("http")?yield new Promise((y,x)=>{
171
171
  이미지 포함: ${t.includeImages?"예 (imagePrompt 포함)":"아니오"}
172
172
  언어: ${t.language==="ko"?"한국어":"English"}
173
173
 
174
- 위 조건에 맞는 슬라이드 구조를 JSON으로 생성해주세요.`,c=((h=(d=(await mx("/chat/completions",e,{model:e.model||"glm-4.7",messages:[{role:"system",content:v6},{role:"user",content:s}],max_tokens:2e3,temperature:.8})).choices[0])==null?void 0:d.message)==null?void 0:h.content)||"[]";try{const p=c.match(/\[[\s\S]*\]/);if(!p)throw new Error("JSON 배열을 찾을 수 없습니다.");return{slides:JSON.parse(p[0])}}catch{throw new iA("슬라이드 생성 응답 파싱 실패")}},$y={generateText:g6,generateSlides:y6},x6="https://prd-gtw.devdive.ai/model/text-generation/v1";class Tf extends Error{constructor(e,n,s){super(e),this.code=n,this.status=s,this.name="DevDiveApiError"}}const Wg=async(t,e,n,s,i,c)=>{const h=`${e.baseUrl||x6}/${t}`,p={"Content-Type":"application/json"};!e.skipAuth&&e.apiKey&&(p["X-API-KEY"]=e.apiKey),e.customHeaders&&Object.assign(p,e.customHeaders);const u=await fetch(h,{method:"POST",headers:p,body:JSON.stringify({prompt:n,system_prompt:s,max_tokens:i||1e3,temperature:c||.7})});if(!u.ok){const A=await u.json().catch(()=>({}));throw new Tf(A.detail||`DevDive API 오류: ${u.status}`,A.code,u.status)}return u.json()},b6=async(t,e)=>{const s=`당신은 프레젠테이션 콘텐츠 작성 전문가입니다. ${{title:"제목으로 사용할 짧고 임팩트 있는",subtitle:"소제목으로 적합한",body:"본문 내용으로 적합한",caption:"캡션으로 사용할 간결한"}[t.style]||""} 텍스트를 생성해주세요. ${t.language==="ko"?"한국어로 작성하세요.":"Write in English."}`,i=e.model||"gpt-4o";return{content:(await Wg(i,e,t.prompt,s,t.maxLength||500,.7)).content.text||""}},S6=`당신은 IR(Investor Relations) 스타일 프레젠테이션 전문가입니다.
174
+ 위 조건에 맞는 슬라이드 구조를 JSON으로 생성해주세요.`,c=((h=(d=(await mx("/chat/completions",e,{model:e.model||"glm-4.7",messages:[{role:"system",content:v6},{role:"user",content:s}],max_tokens:2e3,temperature:.8})).choices[0])==null?void 0:d.message)==null?void 0:h.content)||"[]";try{const p=c.match(/\[[\s\S]*\]/);if(!p)throw new Error("JSON 배열을 찾을 수 없습니다.");return{slides:JSON.parse(p[0])}}catch{throw new iA("슬라이드 생성 응답 파싱 실패")}},$y={generateText:g6,generateSlides:y6},x6="https://prd-gtw.devdive.ai/model/text-generation/v1";class Tf extends Error{constructor(e,n,s){super(e),this.code=n,this.status=s,this.name="DevDiveApiError"}}const Wg=async(t,e,n,s,i,c)=>{const h=`${e.baseUrl||x6}/${t}`,p={"Content-Type":"application/json"};!e.skipAuth&&e.apiKey&&(p["X-API-KEY"]=e.apiKey),e.customHeaders&&Object.assign(p,e.customHeaders);const u=await fetch(h,{method:"POST",headers:p,body:JSON.stringify({prompt:n,system_prompt:s,max_tokens:i||1e3,temperature:c||.7})});if(!u.ok){const y=await u.json().catch(()=>({}));throw new Tf(y.detail||`DevDive API 오류: ${u.status}`,y.code,u.status)}const A=await u.json();return A.result&&!A.content?{content:{text:typeof A.result=="string"?A.result:JSON.stringify(A.result)}}:A},b6=async(t,e)=>{const s=`당신은 프레젠테이션 콘텐츠 작성 전문가입니다. ${{title:"제목으로 사용할 짧고 임팩트 있는",subtitle:"소제목으로 적합한",body:"본문 내용으로 적합한",caption:"캡션으로 사용할 간결한"}[t.style]||""} 텍스트를 생성해주세요. ${t.language==="ko"?"한국어로 작성하세요.":"Write in English."}`,i=e.model||"gpt-4o";return{content:(await Wg(i,e,t.prompt,s,t.maxLength||500,.7)).content.text||""}},S6=`당신은 IR(Investor Relations) 스타일 프레젠테이션 전문가입니다.
175
175
 
176
176
  ## 핵심 설계 원칙
177
177
  - **Visual First**: 텍스트보다 시각 요소 중심 구성