openai_client 패키지는 OpenAI의 AI 모델과 상호작용하기 위한 공식이 아닌 플랫폼 독립적인 Dart 클라이언트입니다. 개발자들이 안드로이드, iOS, macOS, Windows 및 리눅스에서 Flutter 애플리케이션에 텍스트 생성 및 채팅 응답과 같은 생성형 AI 기능을 통합할 수 있도록 합니다. 간단함과 유연성을 고려하여 다양한 OpenAI 엔드포인트를 지원하며, 플랫폼별 코드 없이도 작동합니다. 클라이언트는 HTTP 상호작용을 추상화하여 API 키를 사용한 인증 및 요청 전송을 쉽게 만듭니다. 크로스플랫폼 앱에서 AI 기반 기능을 구축하는 데 이상적입니다.
사용 사례
모바일 및 데스크톱 앱에 챗봇 통합하기
GPT 모델을 사용하여 콘텐츠 생성
자연어 처리를 사용하여 AI 어시스턴트 구축하기
실시간 텍스트 완성 활성화
다국어 번역 도구 만들기
주요 기능
크로스 플랫폼 호환성
OpenAI 엔드포인트를 위한 간단한 API
API 키를 통한 인증 지원
비동기 요청 처리
가볍고 통합하기 쉬움
적합한 대상
AI 기반 앱을 개발하는 플러터 개발자
다중 플랫폼 AI 통합이 필요한 팀
생성 텍스트 기능이 필요한 프로젝트
빠르게 AI 기능 프로토타입 만들기
모바일 및 데스크톱 사용자를 모두 대상으로 하는 앱
고려 사항
비공식 클라이언트—OpenAI API 변경 후 업데이트가 필요할 수 있습니다
API 키의 적절한 관리가 필요합니다
안정적인 인터넷 연결에 의존
OpenAI의 사용 가능한 모델에 제한됨
고주파 또는 미션 크리티컬 AI 워크로드에 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
The OpenAI API can be applied to virtually any task that involves understanding or generating natural language or code. They offer a spectrum of models with different levels of power suitable for different tasks, as well as the ability to fine-tune your own custom models.
ℹ️ Info
This is an unofficial client, written purely in Dart that allows you to easily use the API in your Dart or Flutter projects.
You can install the package by adding it to your pubspec.yaml file.
dependencies:openai_client:last_version
After the installation you would just need to import the package in your project.
import'package:openai_client/openai_client.dart';
🚀 Getting Started
In order to use the API, you need to have an API key. You can get one here and once you have it, you can use it in the client passing the key itself in the OpenAIConfiguration constructor.
// Create the configurationfinal conf = OpenAIConfiguration(
apiKey: 'Your API key',
organizationId: 'Your organization ID', // Optional
);
// Create a new clientfinal client = OpenAIClient(configuration: conf);
🐛 Debugging
For testing and debugging purposes, you can use the built-in Logger to more easily check the status of requests and responses.
By default, the Logger is disabled. You can enable it by setting the enableLogging property to true.
// The instance of the client with the logger enabledfinal client = OpenAIClient(
...
enableLogging: true,
);
🎯 Examples
The provided example is a simple command line application that allows you to test the client. You can find it in the example folder.
📚 Documentation
The full documentation of the project is available here. All the methods are documented, and you can easily check the parameters that you can pass to them.
🤝 Contributing
If you want to contribute to openai_client, please make sure to review the contribution guidelines.
This project makes use of GitHub issues for
tracking requests and bugs only, so please don't use issues for general questions and discussion.