Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev0.0.7

openai_client

Um cliente não oficial e independente de plataforma para acessar diferentes modelos de IA desenvolvidos pela OpenAI.

AndroidiOSmacOSWindowsLinux
Downloads em 30 dias
101
Curtidas
49
Pontos Pub
140

Instalar pacote

flutter pub add openai_client

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

O pacote openai_client é um cliente Dart não oficial e independente de plataforma para interagir com os modelos de IA da OpenAI. Ele permite que desenvolvedores integrem capacidades de IA gerativa — como geração de texto e respostas de chat — em aplicativos Flutter para Android, iOS, macOS, Windows e Linux. Projetado para simplicidade e flexibilidade, suporta vários pontos finais da OpenAI sem exigir código específico de plataforma. O cliente abstrai as interações HTTP, tornando fácil autenticar e enviar solicitações usando chaves de API. Ideal para criar funcionalidades baseadas em IA em aplicativos multiplataforma.

Casos de uso

  • Integrando chatbots em aplicativos móveis e de desktop
  • Gerando conteúdo usando modelos GPT
  • Construindo assistentes de IA com processamento de linguagem natural
  • Habilitar conclusão de texto em tempo real
  • Criando ferramentas de tradução multilíngue

Principais recursos

  • Compatibilidade multiplataforma
  • API simples para endpoints do OpenAI
  • Suporte para autenticação por chave de API
  • Tratamento de solicitação assíncrona
  • Leve e fácil de integrar

Indicado para

  • Desenvolvedores Flutter construindo aplicativos com inteligência artificial
  • Equipes que precisam de integração de IA multiplataforma
  • Projetos que exigem capacidades de texto gerativo
  • Prototipagem rápida de recursos de IA
  • Aplicativos direcionados para usuários móveis e de desktop

Considerações

  • Cliente não oficial—pode exigir atualizações após alterações na API do OpenAI
  • Requer gerenciamento adequado das chaves da API
  • Dependente de conexão estável com a internet
  • Limitado aos modelos disponíveis do OpenAI
  • Não adequado para cargas de trabalho de IA de alta frequência ou críticas

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

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.

Categorias

Dependências

Lista de dependências 3 itens

Repositório-fonte

Projetos que usam este pacote

Ainda não há dados.