시작
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-llm`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/llm/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 기능을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins다음 명령어를 사용하여 플러그인을 설치하고 플랫폼에 따라 다음 명령어를 실행하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-llm` plugin in my project.만약 Manual Setup을 선호한다면, 다음 명령어를 실행하고 아래에 플랫폼에 따라 설명된 지침을 따르세요:
bun add @capgo/capacitor-llmbunx cap syncImport
"Import"라는 제목의 섹션import { CapgoLLM } from '@capgo/capacitor-llm';API 개요
"API 개요"라는 제목의 섹션createChat
"createChat"라는 제목의 섹션새로운 채팅 세션을 생성합니다.
import { CapgoLLM } from '@capgo/capacitor-llm';
await CapgoLLM.createChat();sendMessage
"sendMessage"라는 제목의 섹션AI에게 특정 채팅 세션에서 메시지를 전송합니다.
import { CapgoLLM } from '@capgo/capacitor-llm';
await CapgoLLM.sendMessage({} as { chatId: string; message: string });getReadiness
준비 상태를 얻는 섹션LLM의 준비 상태를 가져옵니다.
import { CapgoLLM } from '@capgo/capacitor-llm';
await CapgoLLM.getReadiness();setModel
모델 설정을 하는 섹션모델 설정을 합니다.
- iOS: 시스템 모델을 사용하려면 "Apple Intelligence" 경로를 사용하거나 MediaPipe 모델의 경로를 제공하세요.
- Android: MediaPipe 모델 파일의 경로 (자산 또는 파일 디렉토리)
import { CapgoLLM } from '@capgo/capacitor-llm';
await CapgoLLM.setModel({} as ModelOptions);downloadModel
섹션 제목 "다운로드 모델"URL에서 모델을 다운로드하고 적절한 위치에 저장합니다.
- iOS: 앱의 문서 디렉토리에 다운로드합니다.
- 안드로이드: 다운로드는 앱의 파일 디렉토리로 이동합니다.
import { CapgoLLM } from '@capgo/capacitor-llm';
await CapgoLLM.downloadModel({} as DownloadModelOptions);타입 참조
타입 참조ModelOptions
모델 옵션모델 구성 옵션입니다.
export interface ModelOptions { /** Model path or "Apple Intelligence" for iOS system model */ path: string; /** Model file type/extension (e.g., "task", "bin", "litertlm"). If not provided, will be extracted from path. */ modelType?: string; /** Maximum number of tokens the model handles */ maxTokens?: number; /** Number of tokens the model considers at each step */ topk?: number; /** Amount of randomness in generation (0.0-1.0) */ temperature?: number; /** Random seed for generation */ randomSeed?: number;}DownloadModelOptions
다운로드 모델 옵션모델 다운로드에 대한 옵션입니다.
export interface DownloadModelOptions { /** URL of the model file to download */ url: string; /** Optional: URL of companion file (e.g., .litertlm for Android) */ companionUrl?: string; /** Optional: Custom filename (defaults to filename from URL) */ filename?: string;}DownloadModelResult
다운로드 모델 결과모델 다운로드 결과입니다.
export interface DownloadModelResult { /** Path where the model was saved */ path: string; /** Path where the companion file was saved (if applicable) */ companionPath?: string;}TextFromAiEvent
__CAPGO_KEEP_1____CAPGO_KEEP_2__
export interface TextFromAiEvent { /** The text content from AI - this is an incremental chunk, not the full text */ text: string; /** The chat session ID */ chatId: string; /** Whether this is a complete chunk (true) or partial streaming data (false) */ isChunk?: boolean;}AiFinishedEvent
__CAPGO_KEEP_1____CAPGO_KEEP_3__
export interface AiFinishedEvent { /** The chat session ID that finished */ chatId: string;}DownloadProgressEvent
__CAPGO_KEEP_1____CAPGO_KEEP_4__
export interface DownloadProgressEvent { /** Percentage of download completed (0-100) */ progress: number; /** Total bytes to download */ totalBytes?: number; /** Bytes downloaded so far */ downloadedBytes?: number;}ReadinessChangeEvent
__CAPGO_KEEP_1____CAPGO_KEEP_5__
export interface ReadinessChangeEvent { /** The readiness status */ readiness: string;}실질적인 출처
실질적인 출처이 페이지는 플러그인의 src/definitions.ts업스트림에서 공개 API이 변경되었을 때 다시 싱크를 실행하세요.
Getting Started
실질적인 출처Getting Started 계획 대시보드 및 __CAPGO_KEEP_0__ 운영을 위해 Capgo/@API/__CAPGO_KEEP_1__-llm Capgo/@capgo/capacitor-llm Capgo/@capgo/capacitor-llm API 개요 API 개요의 구현 세부 사항에 대해 소개 소개의 구현 세부 사항에 대해 API 키 API 키의 구현 세부 사항에 대해, 및 장치 장치의 구현 세부 사항에 대해.