Basic
Easily Generate Text with AI in your app using 🌊 Floom.
Learning time 🕙: 2 minutes
Create Pipeline
Create a YAML file named 'text-generation.yaml' using your favorite editor.
kind: floom/pipeline/1.2
pipeline:
name: text-generation
prompt:
template:
package: floom/prompt/template/default
system: "Be polite and concise"
Deploy
Deploy the AI Pipeline with Floom CLI to ☁️ Floom Cloud or local 🐳 Floom Docker.
- ☁️ Floom Cloud
- 🐳 Docker
floom deploy text-generation.yaml
floom deploy -endpoint=<YOUR-FLOOM-ADDRESS> -f text-generation.yaml
Copy the deployed pipeline URI:
Deploying pipeline 'text-generation'...
Deployed to text-generation-28g4fj82.pl.floom.ai
Run
Run the pipeline from your app using Floom SDK.
- Python
- Node
- .NET
- Java
- Golang
- Rust
from floom import FloomClient
floom_client = FloomClient()
floom_client.run(
pipeline="text-generation-28g4fj82.pl.floom.ai",
prompt="Your query here"
)
import { FloomClient } from '../FloomClient';
const floomClient = new FloomClient();
const response = await floomClient.run(
"text-generation-28g4fj82.pl.floom.ai",
"Your query here",
);
var floomClient = new FloomClient();
var response = await floomClient.Run(
pipeline: "text-generation-28g4fj82.pl.floom.ai",
prompt: "Your query here"
);
import ai.floom.FloomClient;
FloomClient floomClient = new FloomClient();
FloomResponse response = floomClient.run(
"text-generation-28g4fj82.pl.floom.ai",
"Your query here"
);
import (
"fmt"
"github.com/FloomAI/FloomSDK-Go"
)
floomClient := floom.NewFloomClient()
response, err := floomClient.Run(
"text-generation-28g4fj82.pl.floom.ai",
"Your query here"
)
extern crate floom;
use floom::FloomClient;
let mut floom_client = FloomClient::new();
let response = floom_client.run(
"text-generation-28g4fj82.pl.floom.ai",
"Your query here",
);
Production Improvements
including Plugins: Caching, Cost Management, Prompt Validation and Response Validation executed on OpenAI GPT-3.5.