flutter_cohere

Last updated:

0 purchases

flutter_cohere Image
flutter_cohere Images
Add to Cart

Description:

flutter cohere

Flutter Cohere #
Cohere empowers every developer and enterprise to build amazing products and capture true business value with language AI.
This package provides a powerful bridge between your Flutter application and Cohere AI. It empowers you to seamlessly integrate Cohere's capabilities into your app, unlocking possibilities for building innovative, intelligent, and engaging experiences that redefine user interaction.
Package #

Table of content


Flutter Cohere
Features
Getting started
Installation
Import
Initialize Cohere
Content-based APIs



Features #

Text-only input scroll
Multi-turn conversations (chat) scroll

Getting started #
To use the Cohere API, you'll need an API key. If you don't already have one, create a key in Cohere's official website. Get an API key.
Installation #
Add flutter_cohere as a dependency in your pubspec.yaml file.
dependencies:
flutter_cohere: ^0.0.1
copied to clipboard
Import #
Import the package into your Dart code.
import 'package:flutter_cohere/flutter_cohere.dart';
copied to clipboard
Initialize Cohere #
For initialization, you must call the CohereClient constructor for Flutter Cohere.
void myFunction() {

/// Add this line
var co = CohereClient(apiKey: '--- Your Cohere Api Key ---');

}
copied to clipboard
Content-based APIs #
Text-only input #
This feature lets you perform natural language processing (NLP) tasks such as text generation and completion.
var co = CohereClient(apiKey: '--- Your Cohere Api Key ---');

co.generate(
prompt: "Write a story about a magic backpack.",)
.then((value) => print( value.values.first )) /// or value?.values.first
.catchError((e) => print(e));
copied to clipboard
Multi-turn conversations (chat) #
Using Cohere, you can build freeform conversations across multiple turns.
var co = CohereClient(apiKey: '--- Your Cohere Api Key ---');

co.chat([
{"role": "USER", "message": "Who discovered gravity?"},
{"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
])
.then((value) => log(value.values.first ?? 'without output'))
.catchError((e) => log('chat', error: e));
copied to clipboard
Stream Generate Content #
soon
embed #
soon
embed-jobs #
soon
rerank #
soon
classify #
soon
datasets #
soon
summarize #
soon
tokenize #
soon
detokenize #
soon
connectors #
soon
Flutter Cohere widgets #
soon

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.