@gendive/chatllm 0.3.0 → 0.4.0

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.
package/README.md CHANGED
@@ -488,6 +488,89 @@ const customActions = [
488
488
  />
489
489
  ```
490
490
 
491
+ ### 5.6 마크다운 렌더링 (v0.3.0+)
492
+
493
+ AI 응답에서 마크다운이 자동으로 렌더링됩니다.
494
+
495
+ **지원 문법:**
496
+ - 헤딩 (`#`, `##`, `###`)
497
+ - 굵게 (`**text**`)
498
+ - 기울임 (`*text*`)
499
+ - 인라인 코드 (`` `code` ``)
500
+ - 코드 블록 (```language)
501
+ - 링크 (`[text](url)`)
502
+ - 리스트 (`-`, `*`, `1.`)
503
+ - 인용 (`>`)
504
+ - 수평선 (`---`)
505
+
506
+ ```tsx
507
+ import { MarkdownRenderer } from '@gendive/chatllm/react'
508
+
509
+ <MarkdownRenderer content="**Hello** World!" />
510
+ ```
511
+
512
+ ### 5.7 출처 링크 칩 (v0.3.0+)
513
+
514
+ 출처 링크가 자동으로 칩 형태로 표시됩니다.
515
+
516
+ ```
517
+ **출처:** [`1. brave`](https://...) [`2. brave`](https://...)
518
+ ```
519
+
520
+ 위와 같은 패턴이 아래처럼 렌더링됩니다:
521
+
522
+ ```
523
+ ┌────────────────────────────────────────────┐
524
+ │ 출처: [1 brave ↗] [2 brave ↗] [3 brave ↗] │
525
+ └────────────────────────────────────────────┘
526
+ ```
527
+
528
+ 개별 사용:
529
+ ```tsx
530
+ import { LinkChip } from '@gendive/chatllm/react'
531
+
532
+ <LinkChip text="1. Wikipedia" url="https://wikipedia.org" />
533
+ ```
534
+
535
+ ### 5.8 설정 모달 (v0.3.0+)
536
+
537
+ 내장 설정 모달 컴포넌트:
538
+
539
+ ```tsx
540
+ import { SettingsModal } from '@gendive/chatllm/react'
541
+
542
+ function App() {
543
+ const [isOpen, setIsOpen] = useState(false)
544
+ const [personalization, setPersonalization] = useState(defaultConfig)
545
+
546
+ return (
547
+ <>
548
+ <button onClick={() => setIsOpen(true)}>설정</button>
549
+
550
+ <SettingsModal
551
+ isOpen={isOpen}
552
+ onClose={() => setIsOpen(false)}
553
+ personalization={personalization}
554
+ onPersonalizationChange={setPersonalization}
555
+ apiKey={apiKey}
556
+ onApiKeyChange={setApiKey}
557
+ onClearAllData={() => {
558
+ setSessions([])
559
+ localStorage.clear()
560
+ }}
561
+ apiKeyLabel="DevDive API Key"
562
+ apiKeyDescription="Cloud 모델 사용에 필요합니다"
563
+ />
564
+ </>
565
+ )
566
+ }
567
+ ```
568
+
569
+ **SettingsModal 탭:**
570
+ - **일반**: 언어, 기본값 초기화, API 키
571
+ - **개인 맞춤 설정**: 닉네임, 직업, 응답 스타일
572
+ - **데이터 제어**: 메모리 토글, 전체 삭제
573
+
491
574
  ---
492
575
 
493
576
  ## 6. 타입 정의
@@ -866,8 +949,4 @@ const response = await fetch(
866
949
  )
867
950
  ```
868
951
 
869
- ---
870
-
871
- ## 라이선스
872
-
873
- MIT
952
+ ---
@@ -116,6 +116,8 @@ interface ChatUIProps {
116
116
  personalization?: Partial<PersonalizationConfig>;
117
117
  /** API 키 (DevDive 등 외부 프로바이더용) */
118
118
  apiKey?: string;
119
+ /** API 키 변경 핸들러 */
120
+ onApiKeyChange?: (key: string) => void;
119
121
  /** API 엔드포인트 */
120
122
  apiEndpoint?: string;
121
123
  /** 테마 설정 */
@@ -189,6 +191,8 @@ interface MessageListProps {
189
191
  onEdit: (message: ChatMessage) => void;
190
192
  onRegenerate: (id: string) => void;
191
193
  onQuote: (text: string) => void;
194
+ onAskOtherModel?: (messageId: string, targetModel: string) => void;
195
+ models?: ModelConfig[];
192
196
  copiedId: string | null;
193
197
  editingId: string | null;
194
198
  }
@@ -201,6 +205,8 @@ interface MessageBubbleProps {
201
205
  onEdit: () => void;
202
206
  onRegenerate?: () => void;
203
207
  onQuote?: (text: string) => void;
208
+ onAskOtherModel?: (targetModel: string) => void;
209
+ models?: ModelConfig[];
204
210
  alternatives?: AlternativeResponse[];
205
211
  activeAlternativeIndex?: number;
206
212
  onAlternativeChange?: (index: number) => void;
@@ -279,7 +285,9 @@ interface UseChatUIReturn {
279
285
  cancelEdit: () => void;
280
286
  saveEdit: (content: string) => Promise<void>;
281
287
  regenerate: (messageId: string) => Promise<void>;
288
+ askOtherModel: (messageId: string, targetModel: string) => Promise<void>;
282
289
  updatePersonalization: (config: Partial<PersonalizationConfig>) => void;
290
+ models: ModelConfig[];
283
291
  }
284
292
 
285
293
  /**
@@ -116,6 +116,8 @@ interface ChatUIProps {
116
116
  personalization?: Partial<PersonalizationConfig>;
117
117
  /** API 키 (DevDive 등 외부 프로바이더용) */
118
118
  apiKey?: string;
119
+ /** API 키 변경 핸들러 */
120
+ onApiKeyChange?: (key: string) => void;
119
121
  /** API 엔드포인트 */
120
122
  apiEndpoint?: string;
121
123
  /** 테마 설정 */
@@ -189,6 +191,8 @@ interface MessageListProps {
189
191
  onEdit: (message: ChatMessage) => void;
190
192
  onRegenerate: (id: string) => void;
191
193
  onQuote: (text: string) => void;
194
+ onAskOtherModel?: (messageId: string, targetModel: string) => void;
195
+ models?: ModelConfig[];
192
196
  copiedId: string | null;
193
197
  editingId: string | null;
194
198
  }
@@ -201,6 +205,8 @@ interface MessageBubbleProps {
201
205
  onEdit: () => void;
202
206
  onRegenerate?: () => void;
203
207
  onQuote?: (text: string) => void;
208
+ onAskOtherModel?: (targetModel: string) => void;
209
+ models?: ModelConfig[];
204
210
  alternatives?: AlternativeResponse[];
205
211
  activeAlternativeIndex?: number;
206
212
  onAlternativeChange?: (index: number) => void;
@@ -279,7 +285,9 @@ interface UseChatUIReturn {
279
285
  cancelEdit: () => void;
280
286
  saveEdit: (content: string) => Promise<void>;
281
287
  regenerate: (messageId: string) => Promise<void>;
288
+ askOtherModel: (messageId: string, targetModel: string) => Promise<void>;
282
289
  updatePersonalization: (config: Partial<PersonalizationConfig>) => void;
290
+ models: ModelConfig[];
283
291
  }
284
292
 
285
293
  /**