パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.7

openai_client

OpenAIが開発したさまざまなAIモデルにアクセスするための公式ではない、プラットフォームに依存しないクライアント。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
101
いいね数
49
Pub ポイント
140

パッケージをインストール

flutter pub add openai_client

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

openai_client パッケージは、OpenAI の AI モデルとやり取りするための公式ではない、プラットフォームに依存しない Dart クライアントです。開発者は、Android、iOS、macOS、Windows、Linux における Flutter アプリケーションに、テキスト生成やチャット応答などの生成型 AI 機能を統合できます。シンプルさと柔軟性を重視して設計されており、プラットフォーム固有のコードなしでさまざまな OpenAI エンドポイントに対応しています。HTTP 操作を抽象化しており、API キーを使用した認証とリクエスト送信が簡単です。クロスプラットフォームアプリに AI 機能を搭載するのに最適です。

用途

  • モバイルおよびデスクトップアプリへのチャットボットの統合
  • GPTモデルを用いたコンテンツの生成
  • 自然言語処理を用いたAIアシスタントの構築
  • リアルタイムテキスト補完の有効化
  • 多言語翻訳ツールの作成

主な機能

  • クロスプラットフォーム互換性
  • OpenAI エンドポイント用のシンプルな API
  • APIキーによる認証のサポート
  • 非同期リクエスト処理
  • 軽量で統合が簡単

適している対象

  • AIを活用したアプリを開発するFlutter開発者
  • マルチプラットフォームAI統合が必要なチーム
  • 生成テキスト機能を必要とするプロジェクト
  • 迅速にAI機能のプロトタイプを作成する
  • モバイルおよびデスクトップユーザーをターゲットにしたアプリ

注意事項

  • 非公式クライアント—OpenAI API の変更後に更新が必要になる場合があります
  • API キーの適切な管理が必要です
  • 安定したインターネット接続に依存
  • OpenAIの利用可能なモデルに限定
  • 高頻度またはミッションクリティカルなAIワークロードには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

alt Banner of the openai_client project

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.

APIs Dart class Implementation status
Models OpenAIModels ✅
Completions OpenAICompletions ✅
Chat OpenAIChat ✅
Edits OpenAIEdits ✅
Images OpenAIImages ✅
Embeddings OpenAIEmbeddings ✅
Files Not present ❌
Fine-tunes Not present ❌
Moderations OpenAIModerations ✅

🧰 Installation

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 configuration
final conf = OpenAIConfiguration(
    apiKey: 'Your API key',
    organizationId: 'Your organization ID', // Optional
);

// Create a new client
final 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 enabled
final 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.

🪪 License

This project is licensed under the BSD-3-Clause.

Furthermore, it's not affiliated with OpenAI in any way.

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。