비공식 ChatGPT API용 Dart 클라이언트로, v1/completions 엔드포인트를 통해 텍스트 완성 및 스트리밍 응답을 가능하게 합니다. Flutter 앱을 위한 것으로, Android, iOS, Web, macOS, Windows, Linux 등 다양한 플랫폼을 지원합니다. 이 패키지는 ChatGPT의 텍스트 생성 기능과의 통합을 간소화하여 개발자가 실시간으로 AI 생성 콘텐츠를 가져올 수 있도록 도와줍니다. 채팅 인터페이스, 콘텐츠 어시스턴트, 자연어 처리가 필요한 상호작용형 애플리케이션에 적합합니다.
사용 사례
실시간 채팅 애플리케이션
AI 기반 콘텐츠 생성
상호작용 학습 도구
자동 응답 시스템
코드 제안 기능
주요 기능
텍스트 완성 지원
실시간으로 응답 스트리밍
크로스 플랫폼 호환성
간단한 API 인터페이스
공식이 아닌 그러나 기능적인 ChatGPT 접근
적합한 대상
AI 챗 기능을 구축하는 플러터 개발자
실시간 텍스트 생성이 필요한 앱
빠른 AI 통합이 필요한 프로토타입
고려 사항
비공식 API — 업데이트 시 작동이 중단될 수 있습니다
레이트 제한 및 안정성은 외부 서비스에 따라 달라집니다
OpenAI의 공식 지원 없음
API 키 관리가 필요합니다
완료 엔드포인트에 한정되며 전체 대화 기록은 포함되지 않음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Dart client for the unofficial ChatGPT API. Support Text Completeion and stream response from v1/completions.
Features
Text completions without stream response
Text completions with stream response
Getting started
Install package
flutter pub add chatgpt_completions
Usage
Initialize instance
/// Generate api key from openai console: https://platform.openai.com/account/api-keysChatGPTCompletions.instance.initialize(apiKey: "api_key_here");
Text completions without stream response (stream: false)
// Using GPT-3.5-TurboawaitChatGPTCompletions.instance.textCompletions(
TextCompletionsParams(
// using messagesTurbo insteal of prompt
messagesTurbo: [
MessageTurbo(
role: TurboRole.user,
content: "What's Flutter?",
),
],
model: GPTModel.gpt3p5turbo, // --> switch to gpt-3.5-turbo model
),
onStreamValue: (characters) {
responseWithStream += characters;
print(responseWithStream);
},
onStreamCreated: (subscription) {
responseSubscription = subscription;
},
// Debounce 100ms for receive next value
debounce: constDuration(milliseconds: 100),
);
License - lambiengcode
MIT License
Copyright (c) 2023 lambiengcode
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.