আপনি ইনলাইন (বেস৬৪-এনকোডেড) অথবা ইউআরএল-এর মাধ্যমে প্রদান করা ডকুমেন্ট ফাইল (যেমন পিডিএফ এবং প্লেইন-টেক্সট ফাইল) বিশ্লেষণ করার জন্য একটি জেমিনি মডেলকে অনুরোধ করতে পারেন। যখন আপনি ফায়ারবেস এআই লজিক ব্যবহার করেন, তখন আপনি সরাসরি আপনার অ্যাপ থেকে এই অনুরোধটি করতে পারেন।
এই সক্ষমতা দিয়ে আপনি নিম্নলিখিত কাজগুলো করতে পারবেন:
- ডকুমেন্টের ভেতরের ডায়াগ্রাম, চার্ট এবং টেবিল বিশ্লেষণ করুন।
- তথ্যকে কাঠামোগত আউটপুট ফরম্যাটে রূপান্তর করুন
- ডকুমেন্টের ভিজ্যুয়াল এবং টেক্সট বিষয়বস্তু সম্পর্কে প্রশ্নের উত্তর দিন।
- নথিগুলির সারসংক্ষেপ করুন
- পরবর্তী অ্যাপ্লিকেশনগুলিতে (যেমন RAG পাইপলাইনে) ব্যবহারের জন্য, লেআউট এবং ফরম্যাটিং অক্ষুণ্ণ রেখে ডকুমেন্টের বিষয়বস্তু প্রতিলিপি করুন (উদাহরণস্বরূপ, HTML-এ)।
কোড যান। স্ট্রিম করা প্রতিক্রিয়াগুলির জন্য কোডে যান
| ডকুমেন্ট (যেমন পিডিএফ) নিয়ে কাজ করার জন্য অতিরিক্ত বিকল্প জানতে অন্যান্য নির্দেশিকা দেখুন। কাঠামোগত আউটপুট তৈরি করুন একাধিক পালা চ্যাট |
শুরু করার আগে
এই পৃষ্ঠায় প্রদানকারী-নির্দিষ্ট বিষয়বস্তু এবং কোড দেখতে আপনার জেমিনি এপিআই প্রদানকারীর উপর ক্লিক করুন। |
যদি আপনি ইতিমধ্যে তা না করে থাকেন, তাহলে ‘ গেটিং স্টার্টেড গাইড’টি সম্পূর্ণ করুন, যেখানে আপনার Firebase প্রজেক্ট সেট আপ করা, আপনার অ্যাপকে Firebase-এর সাথে সংযুক্ত করা, SDK যোগ করা, আপনার নির্বাচিত Gemini API প্রোভাইডারের জন্য ব্যাকএন্ড সার্ভিস ইনিশিয়ালাইজ করা এবং একটি GenerativeModel ইনস্ট্যান্স তৈরি করার পদ্ধতি বর্ণনা করা হয়েছে।
আপনি
application/pdfMIME টাইপের এই সর্বজনীনভাবে উপলব্ধ ফাইলটি ব্যবহার করতে পারেন ( ফাইলটি দেখুন বা ডাউনলোড করুন )।https://storage.googleapis.com/cloud-samples-data/generative-ai/pdf/2403.05530.pdf
পিডিএফ ফাইল থেকে টেক্সট তৈরি করুন (বেস৬৪-এনকোডেড)
| এই নমুনাটি চেষ্টা করার আগে, আপনার প্রজেক্ট ও অ্যাপ সেট আপ করার জন্য এই গাইডের ' শুরু করার আগে ' অংশটি সম্পূর্ণ করুন। সেই বিভাগে, আপনি আপনার নির্বাচিত জেমিনি এপিআই প্রোভাইডারের জন্য একটি বোতামেও ক্লিক করবেন, যাতে আপনি এই পৃষ্ঠায় প্রোভাইডার-নির্দিষ্ট বিষয়বস্তু দেখতে পান । |
আপনি প্রতিটি ইনপুট ফাইলের mimeType ) এবং ফাইলটি নিজে প্রদান করে টেক্সট ও পিডিএফ ফাইল দিয়ে একটি জেমিনি মডেলকে টেক্সট তৈরি করতে বলতে পারেন। এই পৃষ্ঠার পরবর্তী অংশে ইনপুট ফাইলের জন্য প্রয়োজনীয়তা এবং সুপারিশসমূহ খুঁজে নিন।
সুইফট
আপনি টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে generateContent() কল করতে পারেন।
import FirebaseAILogic
// Initialize the Gemini Developer API backend service
let ai = FirebaseAI.firebaseAI(backend: .googleAI())
// Create a `GenerativeModel` instance with a model that supports your use case
let model = ai.generativeModel(modelName: "gemini-3-flash-preview")
// Provide the PDF as `Data` with the appropriate MIME type
let pdf = try InlineDataPart(data: Data(contentsOf: pdfURL), mimeType: "application/pdf")
// Provide a text prompt to include with the PDF file
let prompt = "Summarize the important results in this report."
// To generate text output, call `generateContent` with the PDF file and text prompt
let response = try await model.generateContent(pdf, prompt)
// Print the generated text, handling the case where it might be nil
print(response.text ?? "No text in response.")
Kotlin
আপনি টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে generateContent() কল করতে পারেন।
// Initialize the Gemini Developer API backend service
// Create a `GenerativeModel` instance with a model that supports your use case
val model = Firebase.ai(backend = GenerativeBackend.googleAI())
.generativeModel("gemini-3-flash-preview")
val contentResolver = applicationContext.contentResolver
// Provide the URI for the PDF file you want to send to the model
val inputStream = contentResolver.openInputStream(pdfUri)
if (inputStream != null) { // Check if the PDF file loaded successfully
inputStream.use { stream ->
// Provide a prompt that includes the PDF file specified above and text
val prompt = content {
inlineData(
bytes = stream.readBytes(),
mimeType = "application/pdf" // Specify the appropriate PDF file MIME type
)
text("Summarize the important results in this report.")
}
// To generate text output, call `generateContent` with the prompt
val response = model.generateContent(prompt)
// Log the generated text, handling the case where it might be null
Log.d(TAG, response.text ?: "")
}
} else {
Log.e(TAG, "Error getting input stream for file.")
// Handle the error appropriately
}
Java
আপনি টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে generateContent() কল করতে পারেন।
ListenableFuture রিটার্ন করে।
// Initialize the Gemini Developer API backend service
// Create a `GenerativeModel` instance with a model that supports your use case
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.googleAI())
.generativeModel("gemini-3-flash-preview");
// Use the GenerativeModelFutures Java compatibility layer which offers
// support for ListenableFuture and Publisher APIs
GenerativeModelFutures model = GenerativeModelFutures.from(ai);
ContentResolver resolver = getApplicationContext().getContentResolver();
// Provide the URI for the PDF file you want to send to the model
try (InputStream stream = resolver.openInputStream(pdfUri)) {
if (stream != null) {
byte[] audioBytes = stream.readAllBytes();
stream.close();
// Provide a prompt that includes the PDF file specified above and text
Content prompt = new Content.Builder()
.addInlineData(audioBytes, "application/pdf") // Specify the appropriate PDF file MIME type
.addText("Summarize the important results in this report.")
.build();
// To generate text output, call `generateContent` with the prompt
ListenableFuture<GenerateContentResponse> response = model.generateContent(prompt);
Futures.addCallback(response, new FutureCallback<GenerateContentResponse>() {
@Override
public void onSuccess(GenerateContentResponse result) {
String text = result.getText();
Log.d(TAG, (text == null) ? "" : text);
}
@Override
public void onFailure(Throwable t) {
Log.e(TAG, "Failed to generate a response", t);
}
}, executor);
} else {
Log.e(TAG, "Error getting input stream for file.");
// Handle the error appropriately
}
} catch (IOException e) {
Log.e(TAG, "Failed to read the pdf file", e);
} catch (URISyntaxException e) {
Log.e(TAG, "Invalid pdf file", e);
}
Web
আপনি টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে generateContent() কল করতে পারেন।
import { initializeApp } from "firebase/app";
import { getAI, getGenerativeModel, GoogleAIBackend } from "firebase/ai";
// TODO(developer) Replace the following with your app's Firebase configuration
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
// ...
};
// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);
// Initialize the Gemini Developer API backend service
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });
// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(ai, { model: "gemini-3-flash-preview" });
// Converts a File object to a Part object.
async function fileToGenerativePart(file) {
const base64EncodedDataPromise = new Promise((resolve) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result.split(','));
reader.readAsDataURL(file);
});
return {
inlineData: { data: await base64EncodedDataPromise, mimeType: file.type },
};
}
async function run() {
// Provide a text prompt to include with the PDF file
const prompt = "Summarize the important results in this report.";
// Prepare PDF file for input
const fileInputEl = document.querySelector("input[type=file]");
const pdfPart = await fileToGenerativePart(fileInputEl.files);
// To generate text output, call `generateContent` with the text and PDF file
const result = await model.generateContent([prompt, pdfPart]);
// Log the generated text, handling the case where it might be undefined
console.log(result.response.text() ?? "No text in response.");
}
run();
Dart
আপনি টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে generateContent() কল করতে পারেন।
import 'package:firebase_ai/firebase_ai.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
// Initialize FirebaseApp
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
// Initialize the Gemini Developer API backend service
// Create a `GenerativeModel` instance with a model that supports your use case
final model =
FirebaseAI.googleAI().generativeModel(model: 'gemini-3-flash-preview');
// Provide a text prompt to include with the PDF file
final prompt = TextPart("Summarize the important results in this report.");
// Prepare the PDF file for input
final doc = await File('document0.pdf').readAsBytes();
// Provide the PDF file as `Data` with the appropriate PDF file MIME type
final docPart = InlineDataPart('application/pdf', doc);
// To generate text output, call `generateContent` with the text and PDF file
final response = await model.generateContent([
Content.multi([prompt,docPart])
]);
// Print the generated text
print(response.text);
ঐক্য
টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে আপনি GenerateContentAsync() কল করতে পারেন।
using Firebase;
using Firebase.AI;
// Initialize the Gemini Developer API backend service
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());
// Create a `GenerativeModel` instance with a model that supports your use case
var model = ai.GetGenerativeModel(modelName: "gemini-3-flash-preview");
// Provide a text prompt to include with the PDF file
var prompt = ModelContent.Text("Summarize the important results in this report.");
// Provide the PDF file as `data` with the appropriate PDF file MIME type
var doc = ModelContent.InlineData("application/pdf",
System.IO.File.ReadAllBytes(System.IO.Path.Combine(
UnityEngine.Application.streamingAssetsPath, "document0.pdf")));
// To generate text output, call `GenerateContentAsync` with the text and PDF file
var response = await model.GenerateContentAsync(new [] { prompt, doc });
// Print the generated text
UnityEngine.Debug.Log(response.Text ?? "No text in response.");
কীভাবে একটি মডেল বেছে নিতে হয় তা জানুনআপনার ব্যবহারের ক্ষেত্র এবং অ্যাপের জন্য উপযুক্ত।
প্রতিক্রিয়াটি স্ট্রিম করুন
| এই নমুনাটি চেষ্টা করার আগে, আপনার প্রজেক্ট ও অ্যাপ সেট আপ করার জন্য এই গাইডের ' শুরু করার আগে ' অংশটি সম্পূর্ণ করুন। সেই বিভাগে, আপনি আপনার নির্বাচিত জেমিনি এপিআই প্রোভাইডারের জন্য একটি বোতামেও ক্লিক করবেন, যাতে আপনি এই পৃষ্ঠায় প্রোভাইডার-নির্দিষ্ট বিষয়বস্তু দেখতে পান । |
মডেল জেনারেশনের সম্পূর্ণ ফলাফলের জন্য অপেক্ষা না করে, তার পরিবর্তে আংশিক ফলাফল হ্যান্ডেল করার জন্য স্ট্রিমিং ব্যবহার করে আপনি আরও দ্রুত ইন্টারঅ্যাকশন অর্জন করতে পারেন। রেসপন্সটি স্ট্রিম করতে, generateContentStream কল করুন।
সুইফট
টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে তৈরি করা টেক্সট স্ট্রিম করতে আপনি generateContentStream() কল করতে পারেন।
import FirebaseAILogic
// Initialize the Gemini Developer API backend service
let ai = FirebaseAI.firebaseAI(backend: .googleAI())
// Create a `GenerativeModel` instance with a model that supports your use case
let model = ai.generativeModel(modelName: "gemini-3-flash-preview")
// Provide the PDF as `Data` with the appropriate MIME type
let pdf = try InlineDataPart(data: Data(contentsOf: pdfURL), mimeType: "application/pdf")
// Provide a text prompt to include with the PDF file
let prompt = "Summarize the important results in this report."
// To stream generated text output, call `generateContentStream` with the PDF file and text prompt
let contentStream = try model.generateContentStream(pdf, prompt)
// Print the generated text, handling the case where it might be nil
for try await chunk in contentStream {
if let text = chunk.text {
print(text)
}
}
Kotlin
টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে তৈরি করা টেক্সট স্ট্রিম করতে আপনি generateContentStream() কল করতে পারেন।
// Initialize the Gemini Developer API backend service
// Create a `GenerativeModel` instance with a model that supports your use case
val model = Firebase.ai(backend = GenerativeBackend.googleAI())
.generativeModel("gemini-3-flash-preview")
val contentResolver = applicationContext.contentResolver
// Provide the URI for the PDF you want to send to the model
val inputStream = contentResolver.openInputStream(pdfUri)
if (inputStream != null) { // Check if the PDF file loaded successfully
inputStream.use { stream ->
// Provide a prompt that includes the PDF file specified above and text
val prompt = content {
inlineData(
bytes = stream.readBytes(),
mimeType = "application/pdf" // Specify the appropriate PDF file MIME type
)
text("Summarize the important results in this report.")
}
// To stream generated text output, call `generateContentStream` with the prompt
var fullResponse = ""
model.generateContentStream(prompt).collect { chunk ->
// Log the generated text, handling the case where it might be null
val chunkText = chunk.text ?: ""
Log.d(TAG, chunkText)
fullResponse += chunkText
}
}
} else {
Log.e(TAG, "Error getting input stream for file.")
// Handle the error appropriately
}
Java
টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে তৈরি করা টেক্সট স্ট্রিম করতে আপনি generateContentStream() কল করতে পারেন।
Publisher টাইপ রিটার্ন করে।
// Initialize the Gemini Developer API backend service
// Create a `GenerativeModel` instance with a model that supports your use case
GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.googleAI())
.generativeModel("gemini-3-flash-preview");
// Use the GenerativeModelFutures Java compatibility layer which offers
// support for ListenableFuture and Publisher APIs
GenerativeModelFutures model = GenerativeModelFutures.from(ai);
ContentResolver resolver = getApplicationContext().getContentResolver();
// Provide the URI for the PDF file you want to send to the model
try (InputStream stream = resolver.openInputStream(pdfUri)) {
if (stream != null) {
byte[] audioBytes = stream.readAllBytes();
stream.close();
// Provide a prompt that includes the PDF file specified above and text
Content prompt = new Content.Builder()
.addInlineData(audioBytes, "application/pdf") // Specify the appropriate PDF file MIME type
.addText("Summarize the important results in this report.")
.build();
// To stream generated text output, call `generateContentStream` with the prompt
Publisher<GenerateContentResponse> streamingResponse =
model.generateContentStream(prompt);
StringBuilder fullResponse = new StringBuilder();
streamingResponse.subscribe(new Subscriber<GenerateContentResponse>() {
@Override
public void onNext(GenerateContentResponse generateContentResponse) {
String chunk = generateContentResponse.getText();
String text = (chunk == null) ? "" : chunk;
Log.d(TAG, text);
fullResponse.append(text);
}
@Override
public void onComplete() {
Log.d(TAG, fullResponse.toString());
}
@Override
public void onError(Throwable t) {
Log.e(TAG, "Failed to generate a response", t);
}
@Override
public void onSubscribe(Subscription s) {
}
});
} else {
Log.e(TAG, "Error getting input stream for file.");
// Handle the error appropriately
}
} catch (IOException e) {
Log.e(TAG, "Failed to read the pdf file", e);
} catch (URISyntaxException e) {
Log.e(TAG, "Invalid pdf file", e);
}
Web
টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে তৈরি করা টেক্সট স্ট্রিম করতে আপনি generateContentStream() কল করতে পারেন।
import { initializeApp } from "firebase/app";
import { getAI, getGenerativeModel, GoogleAIBackend } from "firebase/ai";
// TODO(developer) Replace the following with your app's Firebase configuration
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
// ...
};
// Initialize FirebaseApp
const firebaseApp = initializeApp(firebaseConfig);
// Initialize the Gemini Developer API backend service
const ai = getAI(firebaseApp, { backend: new GoogleAIBackend() });
// Create a `GenerativeModel` instance with a model that supports your use case
const model = getGenerativeModel(ai, { model: "gemini-3-flash-preview" });
// Converts a File object to a Part object.
async function fileToGenerativePart(file) {
const base64EncodedDataPromise = new Promise((resolve) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result.split(','));
reader.readAsDataURL(file);
});
return {
inlineData: { data: await base64EncodedDataPromise, mimeType: file.type },
};
}
async function run() {
// Provide a text prompt to include with the PDF file
const prompt = "Summarize the important results in this report.";
// Prepare PDF file for input
const fileInputEl = document.querySelector("input[type=file]");
const pdfPart = await fileToGenerativePart(fileInputEl.files);
// To stream generated text output, call `generateContentStream` with the text and PDF file
const result = await model.generateContentStream([prompt, pdfPart]);
// Log the generated text
for await (const chunk of result.stream) {
const chunkText = chunk.text();
console.log(chunkText);
}
}
run();
Dart
টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে তৈরি করা টেক্সট স্ট্রিম করতে আপনি generateContentStream() কল করতে পারেন।
import 'package:firebase_ai/firebase_ai.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
// Initialize FirebaseApp
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
// Initialize the Gemini Developer API backend service
// Create a `GenerativeModel` instance with a model that supports your use case
final model =
FirebaseAI.googleAI().generativeModel(model: 'gemini-3-flash-preview');
// Provide a text prompt to include with the PDF file
final prompt = TextPart("Summarize the important results in this report.");
// Prepare the PDF file for input
final doc = await File('document0.pdf').readAsBytes();
// Provide the PDF file as `Data` with the appropriate PDF file MIME type
final docPart = InlineDataPart('application/pdf', doc);
// To generate text output, call `generateContentStream` with the text and PDF file
final response = await model.generateContentStream([
Content.multi([prompt,docPart])
]);
// Print the generated text
await for (final chunk in response) {
print(chunk.text);
}
ঐক্য
টেক্সট এবং পিডিএফ-এর মাল্টিমোডাল ইনপুট থেকে তৈরি করা টেক্সট স্ট্রিম করতে আপনি GenerateContentStreamAsync() কল করতে পারেন।
using Firebase;
using Firebase.AI;
// Initialize the Gemini Developer API backend service
var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.GoogleAI());
// Create a `GenerativeModel` instance with a model that supports your use case
var model = ai.GetGenerativeModel(modelName: "gemini-3-flash-preview");
// Provide a text prompt to include with the PDF file
var prompt = ModelContent.Text("Summarize the important results in this report.");
// Provide the PDF file as `data` with the appropriate PDF file MIME type
var doc = ModelContent.InlineData("application/pdf",
System.IO.File.ReadAllBytes(System.IO.Path.Combine(
UnityEngine.Application.streamingAssetsPath, "document0.pdf")));
// To stream generated text output, call `GenerateContentStreamAsync` with the text and PDF file
var responseStream = model.GenerateContentStreamAsync(new [] { prompt, doc });
// Print the generated text
await foreach (var response in responseStream) {
if (!string.IsNullOrWhiteSpace(response.Text)) {
UnityEngine.Debug.Log(response.Text);
}
}
কীভাবে একটি মডেল বেছে নিতে হয় তা জানুনআপনার ব্যবহারের ক্ষেত্র এবং অ্যাপের জন্য উপযুক্ত।
ইনপুট নথির জন্য প্রয়োজনীয়তা এবং সুপারিশসমূহ
মনে রাখবেন যে, ইনলাইন ডেটা হিসেবে দেওয়া কোনো ফাইল স্থানান্তরের সময় বেস৬৪-এ এনকোড করা হয়, যা রিকোয়েস্টের আকার বাড়িয়ে দেয়। রিকোয়েস্টটি অতিরিক্ত বড় হলে আপনি একটি HTTP 413 এরর পাবেন।
নিম্নলিখিত বিষয়গুলো সম্পর্কে বিস্তারিত তথ্য জানতে 'সমর্থিত ইনপুট ফাইল এবং প্রয়োজনীয়তা' পৃষ্ঠাটি দেখুন:
- অনুরোধে ফাইল প্রদানের বিভিন্ন বিকল্প (ইনলাইন অথবা ফাইলের URL বা URI ব্যবহার করে)
- ডকুমেন্ট ফাইলের জন্য প্রয়োজনীয়তা এবং সর্বোত্তম অনুশীলন
সমর্থিত ডকুমেন্ট MIME প্রকার
জেমিনি মাল্টিমোডাল মডেলগুলো নিম্নলিখিত ডকুমেন্ট MIME টাইপগুলো সমর্থন করে:
- পিডিএফ -
application/pdf - টেক্সট -
text/plain
অনুরোধ প্রতি সীমা
পিডিএফ ফাইলকে ছবি হিসেবে গণ্য করা হয়, তাই একটি পিডিএফ-এর একটি পৃষ্ঠাকে একটি ছবি হিসেবে বিবেচনা করা হয়। একটি প্রম্পটে অনুমোদিত পৃষ্ঠার সংখ্যা, জেমিনি মাল্টিমোডাল মডেলগুলো যতগুলো ছবি সমর্থন করতে পারে, তার সংখ্যার মধ্যে সীমাবদ্ধ থাকে।
- প্রতি অনুরোধে সর্বোচ্চ ফাইলের সংখ্যা: ৩,০০০টি
- প্রতি ফাইলে সর্বোচ্চ পৃষ্ঠা সংখ্যা: ১,০০০ পৃষ্ঠা
- প্রতিটি ফাইলের সর্বোচ্চ আকার: ৫০ মেগাবাইট
তুমি আর কী করতে পারো?
- মডেলে দীর্ঘ প্রম্পট পাঠানোর আগে টোকেন গণনা করার পদ্ধতি শিখে নিন।
- Cloud Storage for Firebase সেট আপ করুন , যাতে আপনি আপনার মাল্টিমোডাল অনুরোধগুলিতে বড় ফাইল অন্তর্ভুক্ত করতে পারেন এবং প্রম্পটে ফাইল সরবরাহ করার জন্য একটি আরও সুসংগঠিত সমাধান পেতে পারেন। ফাইলগুলির মধ্যে ছবি, পিডিএফ, ভিডিও এবং অডিও অন্তর্ভুক্ত থাকতে পারে।
- উৎপাদনের প্রস্তুতি নিয়ে ভাবতে শুরু করুন ( উৎপাদন চেকলিস্টটি দেখুন):
- অননুমোদিত ক্লায়েন্টদের অপব্যবহার থেকে জেমিনি এপিআই-কে সুরক্ষিত রাখতে যত তাড়াতাড়ি সম্ভব Firebase App Check সেট আপ করুন ।
- নতুন অ্যাপ সংস্করণ প্রকাশ না করেই আপনার অ্যাপের মান (যেমন মডেলের নাম) আপডেট করতে Firebase Remote Config সংযুক্ত করুন ।
অন্যান্য ক্ষমতাগুলো পরীক্ষা করে দেখুন
- একাধিক পালাবিশিষ্ট কথোপকথন (চ্যাট) গড়ে তুলুন।
- শুধুমাত্র পাঠ্য-ভিত্তিক প্রম্পট থেকে টেক্সট তৈরি করুন।
- টেক্সট এবং মাল্টিমোডাল প্রম্পট উভয় থেকেই কাঠামোগত আউটপুট (যেমন JSON) তৈরি করুন ।
- টেক্সট এবং মাল্টিমোডাল প্রম্পট উভয় থেকেই ছবি তৈরি ও সম্পাদনা করুন ।
- একটি জেমিনি মডেলকে আপনার অ্যাপের অন্যান্য অংশ এবং বাহ্যিক সিস্টেম ও তথ্যের সাথে সংযুক্ত করতে বিভিন্ন টুল (যেমন ফাংশন কলিং এবং গুগল সার্চের মাধ্যমে গ্রাউন্ডিং ) ব্যবহার করুন।
কন্টেন্ট তৈরি নিয়ন্ত্রণ করার উপায় জানুন
- প্রম্পট ডিজাইন বুঝুন , যার মধ্যে রয়েছে সর্বোত্তম অনুশীলন, কৌশল এবং উদাহরণমূলক প্রম্পট।
- তাপমাত্রা এবং সর্বোচ্চ আউটপুট টোকেনের মতো মডেল প্যারামিটারগুলো কনফিগার করুন ।
- ক্ষতিকর বলে বিবেচিত হতে পারে এমন প্রতিক্রিয়া পাওয়ার সম্ভাবনা নিয়ন্ত্রণ করতে সুরক্ষা সেটিংস ব্যবহার করুন ।
সমর্থিত মডেলগুলো সম্পর্কে আরও জানুন
বিভিন্ন ব্যবহারের জন্য উপলব্ধ মডেল এবং সেগুলোর কোটা ও মূল্য সম্পর্কে জানুন।Firebase AI Logic ব্যবহারের অভিজ্ঞতা সম্পর্কে মতামত দিন।