nano_banana_pro_prompt

Crates.ionano_banana_pro_prompt
lib.rsnano_banana_pro_prompt
version68.0.75
created_at2026-01-16 10:28:00.19008+00
updated_at2026-01-16 10:28:00.19008+00
descriptionHigh-quality integration for https://supermaker.ai/blog/nano-banana-pro-prompt-use-cases-ready-to-copy-paste/
homepagehttps://supermaker.ai/blog/nano-banana-pro-prompt-use-cases-ready-to-copy-paste/
repositoryhttps://github.com/qy-upup/nano-banana-pro-prompt
max_upload_size
id2048389
size12,013
(qy-upup)

documentation

README

nano-banana-pro-prompt

A lightweight Rust crate for generating structured prompts tailored for various applications. Simplifies prompt engineering with a focus on clarity and efficiency.

Installation

Add the following to your Cargo.toml file under the [dependencies] section: toml nano-banana-pro-prompt = "0.1.0" # Replace with the latest version

Usage Examples

Here are a few examples demonstrating how to use nano-banana-pro-prompt to generate prompts for different scenarios:

1. Generating a Marketing Slogan: rust use nano_banana_pro_prompt::PromptGenerator;

fn main() { let mut generator = PromptGenerator::new(); generator.add_instruction("Generate a catchy slogan for a new brand of organic coffee."); generator.add_context("Brand name: 'Sunrise Brew'"); generator.add_constraint("Slogan must be under 10 words.");

let prompt = generator.build();
println!("{}", prompt);

}

This will produce a prompt suitable for a large language model to generate marketing slogans for an organic coffee brand.

2. Summarizing a Research Paper: rust use nano_banana_pro_prompt::PromptGenerator;

fn main() { let mut generator = PromptGenerator::new(); generator.add_instruction("Summarize the following research paper."); generator.add_context("Paper Title: 'Advances in Neural Network Architectures'\nAbstract: [Insert Abstract Here]"); generator.add_constraint("Summary should be concise and highlight key findings."); generator.add_output_format("Bullet points");

let prompt = generator.build();
println!("{}", prompt);

}

This example demonstrates how to create a prompt that instructs a language model to summarize a research paper, specifying the desired output format.

3. Translating Code Comments: rust use nano_banana_pro_prompt::PromptGenerator;

fn main() { let mut generator = PromptGenerator::new(); generator.add_instruction("Translate the following code comments from English to Spanish."); generator.add_context("// This function calculates the factorial of a given number.\n// It handles edge cases like negative numbers."); generator.add_constraint("Ensure the translation is accurate and preserves the meaning of the original comments.");

let prompt = generator.build();
println!("{}", prompt);

}

This generates a prompt for translating code comments, ensuring accuracy and meaning preservation.

4. Creating a Customer Service Response: rust use nano_banana_pro_prompt::PromptGenerator;

fn main() { let mut generator = PromptGenerator::new(); generator.add_instruction("Generate a polite and helpful response to the following customer inquiry."); generator.add_context("Customer Inquiry: 'I am having trouble logging into my account. I have tried resetting my password but still cannot access it.'"); generator.add_constraint("Response should acknowledge the customer's issue and offer steps to resolve it."); generator.add_tone("Friendly and professional");

let prompt = generator.build();
println!("{}", prompt);

}

This example shows how to build a prompt for generating customer service responses, specifying tone and desired outcomes.

5. Generating a Creative Story Idea: rust use nano_banana_pro_prompt::PromptGenerator;

fn main() { let mut generator = PromptGenerator::new(); generator.add_instruction("Generate a creative story idea based on the following theme."); generator.add_context("Theme: 'A sentient AI discovers the meaning of friendship.'"); generator.add_constraint("The story idea should be original and captivating."); generator.add_style("Science Fiction");

let prompt = generator.build();
println!("{}", prompt);

}

This demonstrates the use of nano-banana-pro-prompt to create prompts for generating creative story ideas, specifying theme and style.

Feature Summary

  • Structured Prompt Generation: Easily create prompts with instructions, context, constraints, output formats, and tone specifications.
  • Simple API: A straightforward and intuitive API for building prompts programmatically.
  • Lightweight Dependency: Minimal dependencies ensuring a small footprint.
  • Customizable: Adaptable to various prompt engineering needs.

License

MIT

This crate is part of the nano-banana-pro-prompt ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/blog/nano-banana-pro-prompt-use-cases-ready-to-copy-paste/

Commit count: 0

cargo fmt