আপনি একটি জেমিনি মডেলকে ইনলাইন (base64-এনকোডেড) অথবা URL এর মাধ্যমে প্রদত্ত ডকুমেন্ট ফাইল (যেমন PDF এবং প্লেইন-টেক্সট ফাইল) বিশ্লেষণ করতে বলতে পারেন। যখন আপনি Firebase AI Logic ব্যবহার করেন, তখন আপনি সরাসরি আপনার অ্যাপ থেকে এই অনুরোধটি করতে পারেন।
এই ক্ষমতা ব্যবহার করে, আপনি নিম্নলিখিত কাজগুলি করতে পারেন:
- ডকুমেন্টের ভেতরে ডায়াগ্রাম, চার্ট এবং টেবিল বিশ্লেষণ করুন
- কাঠামোগত আউটপুট ফর্ম্যাটে তথ্য বের করুন
- নথিতে ভিজ্যুয়াল এবং টেক্সট বিষয়বস্তু সম্পর্কে প্রশ্নের উত্তর দিন
- নথির সারসংক্ষেপ করুন
- ডাউনস্ট্রিম অ্যাপ্লিকেশনগুলিতে ব্যবহারের জন্য (যেমন RAG পাইপলাইনে) ডকুমেন্টের বিষয়বস্তু (উদাহরণস্বরূপ, HTML-এ) ট্রান্সক্রাইব করুন, লেআউট এবং ফর্ম্যাটিং সংরক্ষণ করুন।
কোড নমুনায় যান স্ট্রিম করা প্রতিক্রিয়াগুলির জন্য কোডে যান
| ডকুমেন্ট (যেমন পিডিএফ) নিয়ে কাজ করার জন্য অতিরিক্ত বিকল্পগুলির জন্য অন্যান্য নির্দেশিকা দেখুন। স্ট্রাকচার্ড আউটপুট তৈরি করুন মাল্টি-টার্ন চ্যাট |
শুরু করার আগে
এই পৃষ্ঠায় প্রোভাইডার-নির্দিষ্ট কন্টেন্ট এবং কোড দেখতে আপনার জেমিনি API প্রোভাইডারে ক্লিক করুন। |
যদি আপনি ইতিমধ্যেই না করে থাকেন, তাহলে শুরু করার নির্দেশিকাটি সম্পূর্ণ করুন, যেখানে বর্ণনা করা হয়েছে কিভাবে আপনার Firebase প্রকল্প সেট আপ করবেন, আপনার অ্যাপটি Firebase-এর সাথে সংযুক্ত করবেন, SDK যোগ করবেন, আপনার নির্বাচিত Gemini API প্রদানকারীর জন্য ব্যাকএন্ড পরিষেবা শুরু করবেন এবং একটি GenerativeModel ইনস্ট্যান্স তৈরি করবেন।
আপনি এই সর্বজনীনভাবে উপলব্ধ ফাইলটি MIME ধরণের
application/pdf( ফাইল দেখুন বা ডাউনলোড করুন ) দিয়ে ব্যবহার করতে পারেন।https://storage.googleapis.com/cloud-samples-data/generative-ai/pdf/2403.05530.pdf
PDF ফাইল থেকে টেক্সট তৈরি করুন (base64-এনকোডেড)
| এই নমুনাটি চেষ্টা করার আগে, আপনার প্রকল্প এবং অ্যাপ সেট আপ করতে এই নির্দেশিকার "শুরু করার আগে" বিভাগটি সম্পূর্ণ করুন। সেই বিভাগে, আপনি আপনার নির্বাচিত Gemini API প্রদানকারীর জন্য একটি বোতামে ক্লিক করবেন যাতে আপনি এই পৃষ্ঠায় প্রদানকারী-নির্দিষ্ট সামগ্রী দেখতে পান । |
আপনি একটি জেমিনি মডেলকে টেক্সট এবং পিডিএফ দিয়ে টেক্সট তৈরি করতে বলতে পারেন—প্রতিটি ইনপুট ফাইলের mimeType এবং ফাইলটি নিজেই প্রদান করে। এই পৃষ্ঠায় পরে ইনপুট ফাইলের জন্য প্রয়োজনীয়তা এবং সুপারিশগুলি খুঁজুন।
সুইফট
টেক্সট এবং পিডিএফের মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে আপনি generateContent() কল করতে পারেন।
import FirebaseAI
// 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-2.5-flash")
// 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-2.5-flash")
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-2.5-flash");
// 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-2.5-flash" });
// 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-2.5-flash');
// 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);
ঐক্য
টেক্সট এবং PDF এর মাল্টিমোডাল ইনপুট থেকে টেক্সট তৈরি করতে আপনি 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-2.5-flash");
// 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.");
মডেল কীভাবে নির্বাচন করবেন তা শিখুনআপনার ব্যবহারের ক্ষেত্রে এবং অ্যাপের জন্য উপযুক্ত।
প্রতিক্রিয়া স্ট্রিম করুন
| এই নমুনাটি চেষ্টা করার আগে, আপনার প্রকল্প এবং অ্যাপ সেট আপ করতে এই নির্দেশিকার "শুরু করার আগে" বিভাগটি সম্পূর্ণ করুন। সেই বিভাগে, আপনি আপনার নির্বাচিত Gemini API প্রদানকারীর জন্য একটি বোতামে ক্লিক করবেন যাতে আপনি এই পৃষ্ঠায় প্রদানকারী-নির্দিষ্ট সামগ্রী দেখতে পান । |
মডেল জেনারেশন থেকে সম্পূর্ণ ফলাফলের জন্য অপেক্ষা না করে এবং আংশিক ফলাফল পরিচালনা করার জন্য স্ট্রিমিং ব্যবহার করে আপনি দ্রুত ইন্টারঅ্যাকশন অর্জন করতে পারেন। প্রতিক্রিয়া স্ট্রিম করতে, generateContentStream কল করুন।
সুইফট
টেক্সট এবং পিডিএফের মাল্টিমোডাল ইনপুট থেকে জেনারেট করা টেক্সট স্ট্রিম করার জন্য আপনি generateContentStream() কল করতে পারেন।
import FirebaseAI
// 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-2.5-flash")
// 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-2.5-flash")
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-2.5-flash");
// 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-2.5-flash" });
// 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-2.5-flash');
// 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-2.5-flash");
// 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);
}
}
মডেল কীভাবে নির্বাচন করবেন তা শিখুনআপনার ব্যবহারের ক্ষেত্রে এবং অ্যাপের জন্য উপযুক্ত।
ইনপুট ডকুমেন্টের জন্য প্রয়োজনীয়তা এবং সুপারিশ
মনে রাখবেন যে ইনলাইন ডেটা হিসেবে প্রদত্ত একটি ফাইল ট্রানজিটের সময় base64 এ এনকোড করা থাকে, যা অনুরোধের আকার বৃদ্ধি করে। যদি একটি অনুরোধ খুব বড় হয় তবে আপনি একটি HTTP 413 ত্রুটি পাবেন।
নিম্নলিখিত বিষয়গুলি সম্পর্কে বিস্তারিত তথ্য জানতে "সমর্থিত ইনপুট ফাইল এবং প্রয়োজনীয়তা" পৃষ্ঠাটি দেখুন:
- একটি অনুরোধে ফাইল সরবরাহের জন্য বিভিন্ন বিকল্প (ইনলাইন অথবা ফাইলের URL বা URI ব্যবহার করে)
- ডকুমেন্ট ফাইলের জন্য প্রয়োজনীয়তা এবং সর্বোত্তম অনুশীলন
সমর্থিত নথির MIME প্রকারগুলি
জেমিনি মাল্টিমোডাল মডেলগুলি নিম্নলিখিত MIME ধরণের ডকুমেন্ট সমর্থন করে:
- পিডিএফ -
application/pdf - টেক্সট -
text/plain
প্রতি অনুরোধের সীমা
পিডিএফ ফাইলগুলিকে ছবি হিসেবে বিবেচনা করা হয়, তাই একটি পিডিএফের একটি পৃষ্ঠাকে একটি ছবি হিসেবে বিবেচনা করা হয়। একটি প্রম্পটে অনুমোদিত পৃষ্ঠার সংখ্যা জেমিনি মাল্টিমোডাল মডেলগুলি কতগুলি ছবি সমর্থন করতে পারে তার মধ্যে সীমাবদ্ধ।
- প্রতি অনুরোধে সর্বোচ্চ ফাইল: ৩,০০০ ফাইল
- প্রতি ফাইলে সর্বোচ্চ পৃষ্ঠা: প্রতি ফাইলে ১,০০০ পৃষ্ঠা
- প্রতিটি ফাইলের সর্বোচ্চ আকার: ৫০ এমবি
তুমি আর কি করতে পারো?
- মডেলটিতে দীর্ঘ প্রম্পট পাঠানোর আগে টোকেন গণনা শিখুন।
- Cloud Storage for Firebase সেট আপ করুন যাতে আপনি আপনার মাল্টিমোডাল অনুরোধগুলিতে বড় ফাইলগুলি অন্তর্ভুক্ত করতে পারেন এবং প্রম্পটে ফাইল সরবরাহ করার জন্য আরও পরিচালিত সমাধান পেতে পারেন। ফাইলগুলিতে ছবি, PDF, ভিডিও এবং অডিও অন্তর্ভুক্ত থাকতে পারে।
- উৎপাদনের প্রস্তুতি সম্পর্কে চিন্তাভাবনা শুরু করুন ( উৎপাদন চেকলিস্ট দেখুন), যার মধ্যে রয়েছে:
- অননুমোদিত ক্লায়েন্টদের অপব্যবহার থেকে জেমিনি API রক্ষা করার জন্য Firebase App Check সেট আপ করা হচ্ছে ।
- নতুন অ্যাপ সংস্করণ প্রকাশ না করেই আপনার অ্যাপের মান (যেমন মডেলের নাম) আপডেট করার জন্য Firebase Remote Config একীভূত করা ।
অন্যান্য ক্ষমতা চেষ্টা করে দেখুন
- বহু-পালা কথোপকথন (চ্যাট) তৈরি করুন।
- শুধুমাত্র টেক্সট প্রম্পট থেকে টেক্সট তৈরি করুন।
- টেক্সট এবং মাল্টিমোডাল প্রম্পট উভয় থেকেই স্ট্রাকচার্ড আউটপুট (যেমন JSON) তৈরি করুন।
- টেক্সট প্রম্পট ( জেমিনি বা ইমেজেন ) থেকে ছবি তৈরি করুন।
- আপনার অ্যাপের অন্যান্য অংশ এবং বহিরাগত সিস্টেম এবং তথ্যের সাথে একটি জেমিনি মডেল সংযোগ করতে সরঞ্জামগুলি (যেমন গুগল সার্চের সাথে ফাংশন কলিং এবং গ্রাউন্ডিং) ব্যবহার করুন।
কন্টেন্ট তৈরি কীভাবে নিয়ন্ত্রণ করতে হয় তা শিখুন
- সর্বোত্তম অনুশীলন, কৌশল এবং উদাহরণ প্রম্পট সহ দ্রুত নকশা বুঝুন ।
- তাপমাত্রা এবং সর্বোচ্চ আউটপুট টোকেন ( জেমিনির জন্য) অথবা আকৃতির অনুপাত এবং ব্যক্তি প্রজন্ম ( ইমেজেনের জন্য) এর মতো মডেল প্যারামিটারগুলি কনফিগার করুন ।
- ক্ষতিকারক বলে বিবেচিত হতে পারে এমন প্রতিক্রিয়া পাওয়ার সম্ভাবনা সামঞ্জস্য করতে নিরাপত্তা সেটিংস ব্যবহার করুন ।
সমর্থিত মডেলগুলি সম্পর্কে আরও জানুন
বিভিন্ন ব্যবহারের ক্ষেত্রে উপলব্ধ মডেল এবং তাদের কোটা এবং মূল্য সম্পর্কে জানুন।Firebase AI Logic এর সাথে আপনার অভিজ্ঞতা সম্পর্কে মতামত দিন।