Generating content

জেমিনি এপিআই ছবি, অডিও, কোড, টুলস এবং আরও অনেক কিছু দিয়ে কন্টেন্ট তৈরি করা সমর্থন করে। এই প্রতিটি ফিচারের বিস্তারিত জানতে, পড়তে থাকুন এবং নির্দিষ্ট কাজের জন্য তৈরি স্যাম্পল কোডগুলো দেখুন, অথবা বিশদ গাইডগুলো পড়ুন।

পদ্ধতি: models.generateContent

GenerateContentRequest ইনপুটের ভিত্তিতে একটি মডেল রেসপন্স তৈরি করে। বিস্তারিত ব্যবহারবিধির জন্য টেক্সট জেনারেশন গাইড দেখুন। টিউনড মডেল সহ বিভিন্ন মডেলের ইনপুট ক্ষমতা ভিন্ন হয়ে থাকে। বিস্তারিত তথ্যের জন্য মডেল গাইড এবং টিউনিং গাইড দেখুন।

এন্ডপয়েন্ট

পোস্ট https: / /generativelanguage.googleapis.com /v1beta /{model=models /*}:generateContent

পথের পরামিতি

model string

আবশ্যক। সমাপ্তি তৈরির জন্য ব্যবহৃত Model নাম।

ফর্ম্যাট: models/{model} । এটি models/{model} আকারে থাকে।

অনুরোধকারী শরীর

অনুরোধের মূল অংশে নিম্নলিখিত কাঠামোসহ ডেটা থাকে:

ক্ষেত্র
contents[] object ( Content )

প্রয়োজনীয়। মডেলের সাথে বর্তমান কথোপকথনের বিষয়বস্তু।

একক-বারিক কোয়েরির ক্ষেত্রে, এটি একটি একক ইনস্ট্যান্স। চ্যাটের মতো একাধিক-বারিক কোয়েরির ক্ষেত্রে, এটি একটি পুনরাবৃত্ত ক্ষেত্র যা কথোপকথনের ইতিহাস এবং সর্বশেষ অনুরোধ ধারণ করে।

tools[] object ( Tool )

ঐচ্ছিক। পরবর্তী প্রতিক্রিয়া তৈরি করতে Model Tools ব্যবহার করতে পারে তার একটি তালিকা।

Tool হলো এক খণ্ড কোড যা সিস্টেমকে বাহ্যিক সিস্টেমের সাথে যোগাযোগ করে Model জ্ঞান ও পরিধির বাইরে কোনো একটি বা একাধিক কাজ সম্পাদন করতে সক্ষম করে। সমর্থিত Tool হলো Function এবং codeExecution । আরও জানতে ফাংশন কলিং এবং কোড এক্সিকিউশন গাইডগুলো দেখুন।

toolConfig object ( ToolConfig )

ঐচ্ছিক। অনুরোধে উল্লেখিত যেকোনো Tool জন্য টুল কনফিগারেশন। ব্যবহারের উদাহরণের জন্য ফাংশন কলিং গাইড দেখুন।

safetySettings[] object ( SafetySetting )

ঐচ্ছিক। অনিরাপদ কন্টেন্ট ব্লক করার জন্য স্বতন্ত্র SafetySetting ইনস্ট্যান্সগুলোর একটি তালিকা।

এটি GenerateContentRequest.contents এবং GenerateContentResponse.candidates এর উপর প্রয়োগ করা হবে। প্রতিটি SafetyCategory টাইপের জন্য একাধিক সেটিং থাকা উচিত নয়। এই সেটিংগুলো দ্বারা নির্ধারিত থ্রেশহোল্ড পূরণ করতে ব্যর্থ হলে API সেই সমস্ত কন্টেন্ট এবং রেসপন্স ব্লক করে দেবে। এই তালিকাটি safetySettings-এ উল্লেখিত প্রতিটি SafetyCategory জন্য ডিফল্ট সেটিংগুলোকে ওভাররাইড করে। তালিকায় কোনো নির্দিষ্ট SafetyCategory জন্য SafetySetting না থাকলে, API সেই ক্যাটাগরির জন্য ডিফল্ট সেফটি সেটিং ব্যবহার করবে। HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY, HARM_CATEGORY_JAILBREAK হার্ম ক্যাটাগরিগুলো সমর্থিত। উপলব্ধ সেফটি সেটিংস সম্পর্কে বিস্তারিত তথ্যের জন্য গাইডটি দেখুন। আপনার এআই অ্যাপ্লিকেশনগুলিতে কীভাবে নিরাপত্তা সংক্রান্ত বিষয়গুলি অন্তর্ভুক্ত করবেন তা জানতে নিরাপত্তা নির্দেশিকাটিও দেখুন।

systemInstruction object ( Content )

ঐচ্ছিক। ডেভেলপার কর্তৃক নির্ধারিত সিস্টেম নির্দেশাবলী । বর্তমানে, শুধুমাত্র টেক্সট আকারে উপলব্ধ।

generationConfig object ( GenerationConfig )

ঐচ্ছিক। মডেল তৈরি এবং আউটপুটের জন্য কনফিগারেশন বিকল্পসমূহ।

cachedContent string

ঐচ্ছিক। প্রেডিকশন পরিবেশনের জন্য কনটেক্সট হিসেবে ব্যবহার করার জন্য ক্যাশ করা কন্টেন্টের নাম। ফরম্যাট: cachedContents/{cachedContent}

serviceTier enum ( ServiceTier )

ঐচ্ছিক। অনুরোধটির পরিষেবা স্তর।

boolean store

ঐচ্ছিক। এটি একটি নির্দিষ্ট অনুরোধের জন্য লগিং আচরণ নির্ধারণ করে। সেট করা হলে, এটি প্রজেক্ট-স্তরের লগিং কনফিগারেশনের চেয়ে অগ্রাধিকার পায়।

উদাহরণ অনুরোধ

পাঠ্য

পাইথন

from google import genai

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.5-flash", contents="Write a story about a magic backpack."
)
print(response.text)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const response = await ai.models.generateContent({
  model: "gemini-3.5-flash",
  contents: "Write a story about a magic backpack.",
});
console.log(response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}
contents := []*genai.Content{
	genai.NewContentFromText("Write a story about a magic backpack.", genai.RoleUser),
}
response, err := client.Models.GenerateContent(ctx, "gemini-3.5-flash", contents, nil)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

খোলস

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[{"text": "Write a story about a magic backpack."}]
        }]
       }' 2> /dev/null

জাভা

Client client = new Client();

GenerateContentResponse response =
        client.models.generateContent(
                "gemini-3.5-flash",
                "Write a story about a magic backpack.",
                null);

System.out.println(response.text());

ছবি

পাইথন

from google import genai
import PIL.Image

client = genai.Client()
organ = PIL.Image.open(media / "organ.jpg")
response = client.models.generate_content(
    model="gemini-3.5-flash", contents=["Tell me about this instrument", organ]
)
print(response.text)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const organ = await ai.files.upload({
  file: path.join(media, "organ.jpg"),
});

const response = await ai.models.generateContent({
  model: "gemini-3.5-flash",
  contents: [
    createUserContent([
      "Tell me about this instrument", 
      createPartFromUri(organ.uri, organ.mimeType)
    ]),
  ],
});
console.log(response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "organ.jpg"), 
	&genai.UploadFileConfig{
		MIMEType : "image/jpeg",
	},
)
if err != nil {
	log.Fatal(err)
}
parts := []*genai.Part{
	genai.NewPartFromText("Tell me about this instrument"),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}
contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}

response, err := client.Models.GenerateContent(ctx, "gemini-3.5-flash", contents, nil)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

খোলস

# Use a temporary file to hold the base64 encoded image data
TEMP_B64=$(mktemp)
trap 'rm -f "$TEMP_B64"' EXIT
base64 $B64FLAGS $IMG_PATH > "$TEMP_B64"

# Use a temporary file to hold the JSON payload
TEMP_JSON=$(mktemp)
trap 'rm -f "$TEMP_JSON"' EXIT

cat > "$TEMP_JSON" << EOF
{
  "contents": [{
    "parts":[
      {"text": "Tell me about this instrument"},
      {
        "inline_data": {
          "mime_type":"image/jpeg",
          "data": "$(cat "$TEMP_B64")"
        }
      }
    ]
  }]
}
EOF

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d "@$TEMP_JSON" 2> /dev/null

জাভা

Client client = new Client();

String path = media_path + "organ.jpg";
byte[] imageData = Files.readAllBytes(Paths.get(path));

Content content =
        Content.fromParts(
                Part.fromText("Tell me about this instrument."),
                Part.fromBytes(imageData, "image/jpeg"));

GenerateContentResponse response = client.models.generateContent("gemini-3.5-flash", content, null);

System.out.println(response.text());

অডিও

পাইথন

from google import genai

client = genai.Client()
sample_audio = client.files.upload(file=media / "sample.mp3")
response = client.models.generate_content(
    model="gemini-3.5-flash",
    contents=["Give me a summary of this audio file.", sample_audio],
)
print(response.text)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const audio = await ai.files.upload({
  file: path.join(media, "sample.mp3"),
});

const response = await ai.models.generateContent({
  model: "gemini-3.5-flash",
  contents: [
    createUserContent([
      "Give me a summary of this audio file.",
      createPartFromUri(audio.uri, audio.mimeType),
    ]),
  ],
});
console.log(response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "sample.mp3"), 
	&genai.UploadFileConfig{
		MIMEType : "audio/mpeg",
	},
)
if err != nil {
	log.Fatal(err)
}

parts := []*genai.Part{
	genai.NewPartFromText("Give me a summary of this audio file."),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}

contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}

response, err := client.Models.GenerateContent(ctx, "gemini-3.5-flash", contents, nil)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

খোলস

# Use File API to upload audio data to API request.
MIME_TYPE=$(file -b --mime-type "${AUDIO_PATH}")
NUM_BYTES=$(wc -c < "${AUDIO_PATH}")
DISPLAY_NAME=AUDIO

tmp_header_file=upload-header.tmp

# Initial resumable request defining metadata.
# The upload url is in the response headers dump them to a file.
curl "${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}" \
  -D upload-header.tmp \
  -H "X-Goog-Upload-Protocol: resumable" \
  -H "X-Goog-Upload-Command: start" \
  -H "X-Goog-Upload-Header-Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Header-Content-Type: ${MIME_TYPE}" \
  -H "Content-Type: application/json" \
  -d "{'file': {'display_name': '${DISPLAY_NAME}'}}" 2> /dev/null

upload_url=$(grep -i "x-goog-upload-url: " "${tmp_header_file}" | cut -d" " -f2 | tr -d "\r")
rm "${tmp_header_file}"

# Upload the actual bytes.
curl "${upload_url}" \
  -H "Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Offset: 0" \
  -H "X-Goog-Upload-Command: upload, finalize" \
  --data-binary "@${AUDIO_PATH}" 2> /dev/null > file_info.json

file_uri=$(jq ".file.uri" file_info.json)
echo file_uri=$file_uri

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[
          {"text": "Please describe this file."},
          {"file_data":{"mime_type": "audio/mpeg", "file_uri": '$file_uri'}}]
        }]
       }' 2> /dev/null > response.json

cat response.json
echo

jq ".candidates[].content.parts[].text" response.json

ভিডিও

পাইথন

from google import genai
import time

client = genai.Client()
# Video clip (CC BY 3.0) from https://peach.blender.org/download/
myfile = client.files.upload(file=media / "Big_Buck_Bunny.mp4")
print(f"{myfile=}")

# Poll until the video file is completely processed (state becomes ACTIVE).
while not myfile.state or myfile.state.name != "ACTIVE":
    print("Processing video...")
    print("File state:", myfile.state)
    time.sleep(5)
    myfile = client.files.get(name=myfile.name)

response = client.models.generate_content(
    model="gemini-3.5-flash", contents=[myfile, "Describe this video clip"]
)
print(f"{response.text=}")

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

let video = await ai.files.upload({
  file: path.join(media, 'Big_Buck_Bunny.mp4'),
});

// Poll until the video file is completely processed (state becomes ACTIVE).
while (!video.state || video.state.toString() !== 'ACTIVE') {
  console.log('Processing video...');
  console.log('File state: ', video.state);
  await sleep(5000);
  video = await ai.files.get({name: video.name});
}

const response = await ai.models.generateContent({
  model: "gemini-3.5-flash",
  contents: [
    createUserContent([
      "Describe this video clip",
      createPartFromUri(video.uri, video.mimeType),
    ]),
  ],
});
console.log(response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "Big_Buck_Bunny.mp4"), 
	&genai.UploadFileConfig{
		MIMEType : "video/mp4",
	},
)
if err != nil {
	log.Fatal(err)
}

// Poll until the video file is completely processed (state becomes ACTIVE).
for file.State == genai.FileStateUnspecified || file.State != genai.FileStateActive {
	fmt.Println("Processing video...")
	fmt.Println("File state:", file.State)
	time.Sleep(5 * time.Second)

	file, err = client.Files.Get(ctx, file.Name, nil)
	if err != nil {
		log.Fatal(err)
	}
}

parts := []*genai.Part{
	genai.NewPartFromText("Describe this video clip"),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}

contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}

response, err := client.Models.GenerateContent(ctx, "gemini-3.5-flash", contents, nil)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

খোলস

# Use File API to upload audio data to API request.
MIME_TYPE=$(file -b --mime-type "${VIDEO_PATH}")
NUM_BYTES=$(wc -c < "${VIDEO_PATH}")
DISPLAY_NAME=VIDEO

# Initial resumable request defining metadata.
# The upload url is in the response headers dump them to a file.
curl "${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}" \
  -D "${tmp_header_file}" \
  -H "X-Goog-Upload-Protocol: resumable" \
  -H "X-Goog-Upload-Command: start" \
  -H "X-Goog-Upload-Header-Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Header-Content-Type: ${MIME_TYPE}" \
  -H "Content-Type: application/json" \
  -d "{'file': {'display_name': '${DISPLAY_NAME}'}}" 2> /dev/null

upload_url=$(grep -i "x-goog-upload-url: " "${tmp_header_file}" | cut -d" " -f2 | tr -d "\r")
rm "${tmp_header_file}"

# Upload the actual bytes.
curl "${upload_url}" \
  -H "Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Offset: 0" \
  -H "X-Goog-Upload-Command: upload, finalize" \
  --data-binary "@${VIDEO_PATH}" 2> /dev/null > file_info.json

file_uri=$(jq ".file.uri" file_info.json)
echo file_uri=$file_uri

state=$(jq ".file.state" file_info.json)
echo state=$state

name=$(jq ".file.name" file_info.json)
echo name=$name

while [[ "($state)" = *"PROCESSING"* ]];
do
  echo "Processing video..."
  sleep 5
  # Get the file of interest to check state
  curl https://generativelanguage.googleapis.com/v1beta/files/$name > file_info.json
  state=$(jq ".file.state" file_info.json)
done

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[
          {"text": "Transcribe the audio from this video, giving timestamps for salient events in the video. Also provide visual descriptions."},
          {"file_data":{"mime_type": "video/mp4", "file_uri": '$file_uri'}}]
        }]
       }' 2> /dev/null > response.json

cat response.json
echo

jq ".candidates[].content.parts[].text" response.json

পিডিএফ

পাইথন

from google import genai

client = genai.Client()
sample_pdf = client.files.upload(file=media / "test.pdf")
response = client.models.generate_content(
    model="gemini-3.5-flash",
    contents=["Give me a summary of this document:", sample_pdf],
)
print(f"{response.text=}")

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "test.pdf"), 
	&genai.UploadFileConfig{
		MIMEType : "application/pdf",
	},
)
if err != nil {
	log.Fatal(err)
}

parts := []*genai.Part{
	genai.NewPartFromText("Give me a summary of this document:"),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}

contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}

response, err := client.Models.GenerateContent(ctx, "gemini-3.5-flash", contents, nil)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

খোলস

MIME_TYPE=$(file -b --mime-type "${PDF_PATH}")
NUM_BYTES=$(wc -c < "${PDF_PATH}")
DISPLAY_NAME=TEXT


echo $MIME_TYPE
tmp_header_file=upload-header.tmp

# Initial resumable request defining metadata.
# The upload url is in the response headers dump them to a file.
curl "${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}" \
  -D upload-header.tmp \
  -H "X-Goog-Upload-Protocol: resumable" \
  -H "X-Goog-Upload-Command: start" \
  -H "X-Goog-Upload-Header-Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Header-Content-Type: ${MIME_TYPE}" \
  -H "Content-Type: application/json" \
  -d "{'file': {'display_name': '${DISPLAY_NAME}'}}" 2> /dev/null

upload_url=$(grep -i "x-goog-upload-url: " "${tmp_header_file}" | cut -d" " -f2 | tr -d "\r")
rm "${tmp_header_file}"

# Upload the actual bytes.
curl "${upload_url}" \
  -H "Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Offset: 0" \
  -H "X-Goog-Upload-Command: upload, finalize" \
  --data-binary "@${PDF_PATH}" 2> /dev/null > file_info.json

file_uri=$(jq ".file.uri" file_info.json)
echo file_uri=$file_uri

# Now generate content using that file
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[
          {"text": "Can you add a few more lines to this poem?"},
          {"file_data":{"mime_type": "application/pdf", "file_uri": '$file_uri'}}]
        }]
       }' 2> /dev/null > response.json

cat response.json
echo

jq ".candidates[].content.parts[].text" response.json

চ্যাট

পাইথন

from google import genai
from google.genai import types

client = genai.Client()
# Pass initial history using the "history" argument
chat = client.chats.create(
    model="gemini-3.5-flash",
    history=[
        types.Content(role="user", parts=[types.Part(text="Hello")]),
        types.Content(
            role="model",
            parts=[
                types.Part(
                    text="Great to meet you. What would you like to know?"
                )
            ],
        ),
    ],
)
response = chat.send_message(message="I have 2 dogs in my house.")
print(response.text)
response = chat.send_message(message="How many paws are in my house?")
print(response.text)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const chat = ai.chats.create({
  model: "gemini-3.5-flash",
  history: [
    {
      role: "user",
      parts: [{ text: "Hello" }],
    },
    {
      role: "model",
      parts: [{ text: "Great to meet you. What would you like to know?" }],
    },
  ],
});

const response1 = await chat.sendMessage({
  message: "I have 2 dogs in my house.",
});
console.log("Chat response 1:", response1.text);

const response2 = await chat.sendMessage({
  message: "How many paws are in my house?",
});
console.log("Chat response 2:", response2.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

// Pass initial history using the History field.
history := []*genai.Content{
	genai.NewContentFromText("Hello", genai.RoleUser),
	genai.NewContentFromText("Great to meet you. What would you like to know?", genai.RoleModel),
}

chat, err := client.Chats.Create(ctx, "gemini-3.5-flash", nil, history)
if err != nil {
	log.Fatal(err)
}

firstResp, err := chat.SendMessage(ctx, genai.Part{Text: "I have 2 dogs in my house."})
if err != nil {
	log.Fatal(err)
}
fmt.Println(firstResp.Text())

secondResp, err := chat.SendMessage(ctx, genai.Part{Text: "How many paws are in my house?"})
if err != nil {
	log.Fatal(err)
}
fmt.Println(secondResp.Text())

খোলস

curl https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [
        {"role":"user",
         "parts":[{
           "text": "Hello"}]},
        {"role": "model",
         "parts":[{
           "text": "Great to meet you. What would you like to know?"}]},
        {"role":"user",
         "parts":[{
           "text": "I have two dogs in my house. How many paws are in my house?"}]},
      ]
    }' 2> /dev/null | grep "text"

জাভা

Client client = new Client();

Content userContent = Content.fromParts(Part.fromText("Hello"));
Content modelContent =
        Content.builder()
                .role("model")
                .parts(
                        Collections.singletonList(
                                Part.fromText("Great to meet you. What would you like to know?")
                        )
                ).build();

Chat chat = client.chats.create(
        "gemini-3.5-flash",
        GenerateContentConfig.builder()
                .systemInstruction(userContent)
                .systemInstruction(modelContent)
                .build()
);

GenerateContentResponse response1 = chat.sendMessage("I have 2 dogs in my house.");
System.out.println(response1.text());

GenerateContentResponse response2 = chat.sendMessage("How many paws are in my house?");
System.out.println(response2.text());

ক্যাশে

পাইথন

from google import genai
from google.genai import types

client = genai.Client()
document = client.files.upload(file=media / "a11.txt")
model_name = "gemini-3.5-flash"

cache = client.caches.create(
    model=model_name,
    config=types.CreateCachedContentConfig(
        contents=[document],
        system_instruction="You are an expert analyzing transcripts.",
    ),
)
print(cache)

response = client.models.generate_content(
    model=model_name,
    contents="Please summarize this transcript",
    config=types.GenerateContentConfig(cached_content=cache.name),
)
print(response.text)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const filePath = path.join(media, "a11.txt");
const document = await ai.files.upload({
  file: filePath,
  config: { mimeType: "text/plain" },
});
console.log("Uploaded file name:", document.name);
const modelName = "gemini-3.5-flash";

const contents = [
  createUserContent(createPartFromUri(document.uri, document.mimeType)),
];

const cache = await ai.caches.create({
  model: modelName,
  config: {
    contents: contents,
    systemInstruction: "You are an expert analyzing transcripts.",
  },
});
console.log("Cache created:", cache);

const response = await ai.models.generateContent({
  model: modelName,
  contents: "Please summarize this transcript",
  config: { cachedContent: cache.name },
});
console.log("Response text:", response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"), 
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

modelName := "gemini-3.5-flash"
document, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "a11.txt"), 
	&genai.UploadFileConfig{
		MIMEType : "text/plain",
	},
)
if err != nil {
	log.Fatal(err)
}
parts := []*genai.Part{
	genai.NewPartFromURI(document.URI, document.MIMEType),
}
contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}
cache, err := client.Caches.Create(ctx, modelName, &genai.CreateCachedContentConfig{
	Contents: contents,
	SystemInstruction: genai.NewContentFromText(
		"You are an expert analyzing transcripts.", genai.RoleUser,
	),
})
if err != nil {
	log.Fatal(err)
}
fmt.Println("Cache created:")
fmt.Println(cache)

// Use the cache for generating content.
response, err := client.Models.GenerateContent(
	ctx,
	modelName,
	genai.Text("Please summarize this transcript"),
	&genai.GenerateContentConfig{
		CachedContent: cache.Name,
	},
)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

টিউনড মডেল

পাইথন

# With Gemini 2 we're launching a new SDK. See the following doc for details.
# https://ai.google.dev/gemini-api/docs/migrate

JSON মোড

পাইথন

from google import genai
from google.genai import types
from typing_extensions import TypedDict

class Recipe(TypedDict):
    recipe_name: str
    ingredients: list[str]

client = genai.Client()
result = client.models.generate_content(
    model="gemini-3.5-flash",
    contents="List a few popular cookie recipes.",
    config=types.GenerateContentConfig(
        response_mime_type="application/json", response_schema=list[Recipe]
    ),
)
print(result)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const response = await ai.models.generateContent({
  model: "gemini-3.5-flash",
  contents: "List a few popular cookie recipes.",
  config: {
    responseMimeType: "application/json",
    responseSchema: {
      type: "array",
      items: {
        type: "object",
        properties: {
          recipeName: { type: "string" },
          ingredients: { type: "array", items: { type: "string" } },
        },
        required: ["recipeName", "ingredients"],
      },
    },
  },
});
console.log(response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"), 
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

schema := &genai.Schema{
	Type: genai.TypeArray,
	Items: &genai.Schema{
		Type: genai.TypeObject,
		Properties: map[string]*genai.Schema{
			"recipe_name": {Type: genai.TypeString},
			"ingredients": {
				Type:  genai.TypeArray,
				Items: &genai.Schema{Type: genai.TypeString},
			},
		},
		Required: []string{"recipe_name"},
	},
}

config := &genai.GenerateContentConfig{
	ResponseMIMEType: "application/json",
	ResponseSchema:   schema,
}

response, err := client.Models.GenerateContent(
	ctx,
	"gemini-3.5-flash",
	genai.Text("List a few popular cookie recipes."),
	config,
)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

খোলস

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
    "contents": [{
      "parts":[
        {"text": "List 5 popular cookie recipes"}
        ]
    }],
    "generationConfig": {
        "response_mime_type": "application/json",
        "response_schema": {
          "type": "ARRAY",
          "items": {
            "type": "OBJECT",
            "properties": {
              "recipe_name": {"type":"STRING"},
            }
          }
        }
    }
}' 2> /dev/null | head

জাভা

Client client = new Client();

Schema recipeSchema = Schema.builder()
        .type(Array.class.getSimpleName())
        .items(Schema.builder()
                .type(Object.class.getSimpleName())
                .properties(
                        Map.of("recipe_name", Schema.builder()
                                        .type(String.class.getSimpleName())
                                        .build(),
                                "ingredients", Schema.builder()
                                        .type(Array.class.getSimpleName())
                                        .items(Schema.builder()
                                                .type(String.class.getSimpleName())
                                                .build())
                                        .build())
                )
                .required(List.of("recipe_name", "ingredients"))
                .build())
        .build();

GenerateContentConfig config =
        GenerateContentConfig.builder()
                .responseMimeType("application/json")
                .responseSchema(recipeSchema)
                .build();

GenerateContentResponse response =
        client.models.generateContent(
                "gemini-3.5-flash",
                "List a few popular cookie recipes.",
                config);

System.out.println(response.text());

কোড এক্সিকিউশন

পাইথন

from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.5-flash",
    contents=(
        "Write and execute code that calculates the sum of the first 50 prime numbers. "
        "Ensure that only the executable code and its resulting output are generated."
    ),
)
# Each part may contain text, executable code, or an execution result.
for part in response.candidates[0].content.parts:
    print(part, "\n")

print("-" * 80)
# The .text accessor concatenates the parts into a markdown-formatted text.
print("\n", response.text)

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

response, err := client.Models.GenerateContent(
	ctx,
	"gemini-3.5-flash",
	genai.Text(
		`Write and execute code that calculates the sum of the first 50 prime numbers.
		 Ensure that only the executable code and its resulting output are generated.`,
	),
	&genai.GenerateContentConfig{},
)
if err != nil {
	log.Fatal(err)
}

// Print the response.
printResponse(response)

fmt.Println("--------------------------------------------------------------------------------")
fmt.Println(response.Text())

জাভা

Client client = new Client();

String prompt = """
        Write and execute code that calculates the sum of the first 50 prime numbers.
        Ensure that only the executable code and its resulting output are generated.
        """;

GenerateContentResponse response =
        client.models.generateContent(
                "gemini-3.5-flash",
                prompt,
                null);

for (Part part : response.candidates().get().getFirst().content().get().parts().get()) {
    System.out.println(part + "\n");
}

System.out.println("-".repeat(80));
System.out.println(response.text());

ফাংশন কলিং

পাইথন

from google import genai
from google.genai import types

client = genai.Client()

def add(a: float, b: float) -> float:
    """returns a + b."""
    return a + b

def subtract(a: float, b: float) -> float:
    """returns a - b."""
    return a - b

def multiply(a: float, b: float) -> float:
    """returns a * b."""
    return a * b

def divide(a: float, b: float) -> float:
    """returns a / b."""
    return a / b

# Create a chat session; function calling (via tools) is enabled in the config.
chat = client.chats.create(
    model="gemini-3.5-flash",
    config=types.GenerateContentConfig(tools=[add, subtract, multiply, divide]),
)
response = chat.send_message(
    message="I have 57 cats, each owns 44 mittens, how many mittens is that in total?"
)
print(response.text)

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}
modelName := "gemini-3.5-flash"

// Create the function declarations for arithmetic operations.
addDeclaration := createArithmeticToolDeclaration("addNumbers", "Return the result of adding two numbers.")
subtractDeclaration := createArithmeticToolDeclaration("subtractNumbers", "Return the result of subtracting the second number from the first.")
multiplyDeclaration := createArithmeticToolDeclaration("multiplyNumbers", "Return the product of two numbers.")
divideDeclaration := createArithmeticToolDeclaration("divideNumbers", "Return the quotient of dividing the first number by the second.")

// Group the function declarations as a tool.
tools := []*genai.Tool{
	{
		FunctionDeclarations: []*genai.FunctionDeclaration{
			addDeclaration,
			subtractDeclaration,
			multiplyDeclaration,
			divideDeclaration,
		},
	},
}

// Create the content prompt.
contents := []*genai.Content{
	genai.NewContentFromText(
		"I have 57 cats, each owns 44 mittens, how many mittens is that in total?", genai.RoleUser,
	),
}

// Set up the generate content configuration with function calling enabled.
config := &genai.GenerateContentConfig{
	Tools: tools,
	ToolConfig: &genai.ToolConfig{
		FunctionCallingConfig: &genai.FunctionCallingConfig{
			// The mode equivalent to FunctionCallingConfigMode.ANY in JS.
			Mode: genai.FunctionCallingConfigModeAny,
		},
	},
}

genContentResp, err := client.Models.GenerateContent(ctx, modelName, contents, config)
if err != nil {
	log.Fatal(err)
}

// Assume the response includes a list of function calls.
if len(genContentResp.FunctionCalls()) == 0 {
	log.Println("No function call returned from the AI.")
	return nil
}
functionCall := genContentResp.FunctionCalls()[0]
log.Printf("Function call: %+v\n", functionCall)

// Marshal the Args map into JSON bytes.
argsMap, err := json.Marshal(functionCall.Args)
if err != nil {
	log.Fatal(err)
}

// Unmarshal the JSON bytes into the ArithmeticArgs struct.
var args ArithmeticArgs
if err := json.Unmarshal(argsMap, &args); err != nil {
	log.Fatal(err)
}

// Map the function name to the actual arithmetic function.
var result float64
switch functionCall.Name {
	case "addNumbers":
		result = add(args.FirstParam, args.SecondParam)
	case "subtractNumbers":
		result = subtract(args.FirstParam, args.SecondParam)
	case "multiplyNumbers":
		result = multiply(args.FirstParam, args.SecondParam)
	case "divideNumbers":
		result = divide(args.FirstParam, args.SecondParam)
	default:
		return fmt.Errorf("unimplemented function: %s", functionCall.Name)
}
log.Printf("Function result: %v\n", result)

// Prepare the final result message as content.
resultContents := []*genai.Content{
	genai.NewContentFromText("The final result is " + fmt.Sprintf("%v", result), genai.RoleUser),
}

// Use GenerateContent to send the final result.
finalResponse, err := client.Models.GenerateContent(ctx, modelName, resultContents, &genai.GenerateContentConfig{})
if err != nil {
	log.Fatal(err)
}

printResponse(finalResponse)

নোড.জেএস

  // Make sure to include the following import:
  // import {GoogleGenAI} from '@google/genai';
  const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

  /**
   * The add function returns the sum of two numbers.
   * @param {number} a
   * @param {number} b
   * @returns {number}
   */
  function add(a, b) {
    return a + b;
  }

  /**
   * The subtract function returns the difference (a - b).
   * @param {number} a
   * @param {number} b
   * @returns {number}
   */
  function subtract(a, b) {
    return a - b;
  }

  /**
   * The multiply function returns the product of two numbers.
   * @param {number} a
   * @param {number} b
   * @returns {number}
   */
  function multiply(a, b) {
    return a * b;
  }

  /**
   * The divide function returns the quotient of a divided by b.
   * @param {number} a
   * @param {number} b
   * @returns {number}
   */
  function divide(a, b) {
    return a / b;
  }

  const addDeclaration = {
    name: "addNumbers",
    parameters: {
      type: "object",
      description: "Return the result of adding two numbers.",
      properties: {
        firstParam: {
          type: "number",
          description:
            "The first parameter which can be an integer or a floating point number.",
        },
        secondParam: {
          type: "number",
          description:
            "The second parameter which can be an integer or a floating point number.",
        },
      },
      required: ["firstParam", "secondParam"],
    },
  };

  const subtractDeclaration = {
    name: "subtractNumbers",
    parameters: {
      type: "object",
      description:
        "Return the result of subtracting the second number from the first.",
      properties: {
        firstParam: {
          type: "number",
          description: "The first parameter.",
        },
        secondParam: {
          type: "number",
          description: "The second parameter.",
        },
      },
      required: ["firstParam", "secondParam"],
    },
  };

  const multiplyDeclaration = {
    name: "multiplyNumbers",
    parameters: {
      type: "object",
      description: "Return the product of two numbers.",
      properties: {
        firstParam: {
          type: "number",
          description: "The first parameter.",
        },
        secondParam: {
          type: "number",
          description: "The second parameter.",
        },
      },
      required: ["firstParam", "secondParam"],
    },
  };

  const divideDeclaration = {
    name: "divideNumbers",
    parameters: {
      type: "object",
      description:
        "Return the quotient of dividing the first number by the second.",
      properties: {
        firstParam: {
          type: "number",
          description: "The first parameter.",
        },
        secondParam: {
          type: "number",
          description: "The second parameter.",
        },
      },
      required: ["firstParam", "secondParam"],
    },
  };

  // Step 1: Call generateContent with function calling enabled.
  const generateContentResponse = await ai.models.generateContent({
    model: "gemini-3.5-flash",
    contents:
      "I have 57 cats, each owns 44 mittens, how many mittens is that in total?",
    config: {
      toolConfig: {
        functionCallingConfig: {
          mode: FunctionCallingConfigMode.ANY,
        },
      },
      tools: [
        {
          functionDeclarations: [
            addDeclaration,
            subtractDeclaration,
            multiplyDeclaration,
            divideDeclaration,
          ],
        },
      ],
    },
  });

  // Step 2: Extract the function call.(
  // Assuming the response contains a 'functionCalls' array.
  const functionCall =
    generateContentResponse.functionCalls &&
    generateContentResponse.functionCalls[0];
  console.log(functionCall);

  // Parse the arguments.
  const args = functionCall.args;
  // Expected args format: { firstParam: number, secondParam: number }

  // Step 3: Invoke the actual function based on the function name.
  const functionMapping = {
    addNumbers: add,
    subtractNumbers: subtract,
    multiplyNumbers: multiply,
    divideNumbers: divide,
  };
  const func = functionMapping[functionCall.name];
  if (!func) {
    console.error("Unimplemented error:", functionCall.name);
    return generateContentResponse;
  }
  const resultValue = func(args.firstParam, args.secondParam);
  console.log("Function result:", resultValue);

  // Step 4: Use the chat API to send the result as the final answer.
  const chat = ai.chats.create({ model: "gemini-3.5-flash" });
  const chatResponse = await chat.sendMessage({
    message: "The final result is " + resultValue,
  });
  console.log(chatResponse.text);
  return chatResponse;
}

খোলস


cat > tools.json << EOF
{
  "function_declarations": [
    {
      "name": "enable_lights",
      "description": "Turn on the lighting system."
    },
    {
      "name": "set_light_color",
      "description": "Set the light color. Lights must be enabled for this to work.",
      "parameters": {
        "type": "object",
        "properties": {
          "rgb_hex": {
            "type": "string",
            "description": "The light color as a 6-digit hex string, e.g. ff0000 for red."
          }
        },
        "required": [
          "rgb_hex"
        ]
      }
    },
    {
      "name": "stop_lights",
      "description": "Turn off the lighting system."
    }
  ]
} 
EOF

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
  -H 'Content-Type: application/json' \
  -d @<(echo '
  {
    "system_instruction": {
      "parts": {
        "text": "You are a helpful lighting system bot. You can turn lights on and off, and you can set the color. Do not perform any other tasks."
      }
    },
    "tools": ['$(cat tools.json)'],

    "tool_config": {
      "function_calling_config": {"mode": "auto"}
    },

    "contents": {
      "role": "user",
      "parts": {
        "text": "Turn on the lights please."
      }
    }
  }
') 2>/dev/null |sed -n '/"content"/,/"finishReason"/p'

জাভা

Client client = new Client();

FunctionDeclaration addFunction =
        FunctionDeclaration.builder()
                .name("addNumbers")
                .parameters(
                        Schema.builder()
                                .type("object")
                                .properties(Map.of(
                                        "firstParam", Schema.builder().type("number").description("First number").build(),
                                        "secondParam", Schema.builder().type("number").description("Second number").build()))
                                .required(Arrays.asList("firstParam", "secondParam"))
                                .build())
                .build();

FunctionDeclaration subtractFunction =
        FunctionDeclaration.builder()
                .name("subtractNumbers")
                .parameters(
                        Schema.builder()
                                .type("object")
                                .properties(Map.of(
                                        "firstParam", Schema.builder().type("number").description("First number").build(),
                                        "secondParam", Schema.builder().type("number").description("Second number").build()))
                                .required(Arrays.asList("firstParam", "secondParam"))
                                .build())
                .build();

FunctionDeclaration multiplyFunction =
        FunctionDeclaration.builder()
                .name("multiplyNumbers")
                .parameters(
                        Schema.builder()
                                .type("object")
                                .properties(Map.of(
                                        "firstParam", Schema.builder().type("number").description("First number").build(),
                                        "secondParam", Schema.builder().type("number").description("Second number").build()))
                                .required(Arrays.asList("firstParam", "secondParam"))
                                .build())
                .build();

FunctionDeclaration divideFunction =
        FunctionDeclaration.builder()
                .name("divideNumbers")
                .parameters(
                        Schema.builder()
                                .type("object")
                                .properties(Map.of(
                                        "firstParam", Schema.builder().type("number").description("First number").build(),
                                        "secondParam", Schema.builder().type("number").description("Second number").build()))
                                .required(Arrays.asList("firstParam", "secondParam"))
                                .build())
                .build();

GenerateContentConfig config = GenerateContentConfig.builder()
        .toolConfig(ToolConfig.builder().functionCallingConfig(
                FunctionCallingConfig.builder().mode("ANY").build()
        ).build())
        .tools(
                Collections.singletonList(
                        Tool.builder().functionDeclarations(
                                Arrays.asList(
                                        addFunction,
                                        subtractFunction,
                                        divideFunction,
                                        multiplyFunction
                                )
                        ).build()

                )
        )
        .build();

GenerateContentResponse response =
        client.models.generateContent(
                "gemini-3.5-flash",
                "I have 57 cats, each owns 44 mittens, how many mittens is that in total?",
                config);


if (response.functionCalls() == null || response.functionCalls().isEmpty()) {
    System.err.println("No function call received");
    return null;
}

var functionCall = response.functionCalls().getFirst();
String functionName = functionCall.name().get();
var arguments = functionCall.args();

Map<String, BiFunction<Double, Double, Double>> functionMapping = new HashMap<>();
functionMapping.put("addNumbers", (a, b) -> a + b);
functionMapping.put("subtractNumbers", (a, b) -> a - b);
functionMapping.put("multiplyNumbers", (a, b) -> a * b);
functionMapping.put("divideNumbers", (a, b) -> b != 0 ? a / b : Double.NaN);

BiFunction<Double, Double, Double> function = functionMapping.get(functionName);

Number firstParam = (Number) arguments.get().get("firstParam");
Number secondParam = (Number) arguments.get().get("secondParam");
Double result = function.apply(firstParam.doubleValue(), secondParam.doubleValue());

System.out.println(result);

জেনারেশন কনফিগারেশন

পাইথন

from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.5-flash",
    contents="Tell me a story about a magic backpack.",
    config=types.GenerateContentConfig(
        candidate_count=1,
        stop_sequences=["x"],
        max_output_tokens=20,
        temperature=1.0,
    ),
)
print(response.text)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const response = await ai.models.generateContent({
  model: "gemini-3.5-flash",
  contents: "Tell me a story about a magic backpack.",
  config: {
    candidateCount: 1,
    stopSequences: ["x"],
    maxOutputTokens: 20,
    temperature: 1.0,
  },
});

console.log(response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

// Create local variables for parameters.
candidateCount := int32(1)
maxOutputTokens := int32(20)
temperature := float32(1.0)

response, err := client.Models.GenerateContent(
	ctx,
	"gemini-3.5-flash",
	genai.Text("Tell me a story about a magic backpack."),
	&genai.GenerateContentConfig{
		CandidateCount:  candidateCount,
		StopSequences:   []string{"x"},
		MaxOutputTokens: maxOutputTokens,
		Temperature:     &temperature,
	},
)
if err != nil {
	log.Fatal(err)
}

printResponse(response)

খোলস

curl https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
        "contents": [{
            "parts":[
                {"text": "Explain how AI works"}
            ]
        }],
        "generationConfig": {
            "stopSequences": [
                "Title"
            ],
            "temperature": 1.0,
            "maxOutputTokens": 800,
            "topP": 0.8,
            "topK": 10
        }
    }'  2> /dev/null | grep "text"

জাভা

Client client = new Client();

GenerateContentConfig config =
        GenerateContentConfig.builder()
                .candidateCount(1)
                .stopSequences(List.of("x"))
                .maxOutputTokens(20)
                .temperature(1.0F)
                .build();

GenerateContentResponse response =
        client.models.generateContent(
                "gemini-3.5-flash",
                "Tell me a story about a magic backpack.",
                config);

System.out.println(response.text());

নিরাপত্তা সেটিংস

পাইথন

from google import genai
from google.genai import types

client = genai.Client()
unsafe_prompt = (
    "I support Martians Soccer Club and I think Jupiterians Football Club sucks! "
    "Write a ironic phrase about them including expletives."
)
response = client.models.generate_content(
    model="gemini-3.5-flash",
    contents=unsafe_prompt,
    config=types.GenerateContentConfig(
        safety_settings=[
            types.SafetySetting(
                category="HARM_CATEGORY_HATE_SPEECH",
                threshold="BLOCK_MEDIUM_AND_ABOVE",
            ),
            types.SafetySetting(
                category="HARM_CATEGORY_HARASSMENT", threshold="BLOCK_ONLY_HIGH"
            ),
        ]
    ),
)
try:
    print(response.text)
except Exception:
    print("No information generated by the model.")

print(response.candidates[0].safety_ratings)

নোড.জেএস

  // Make sure to include the following import:
  // import {GoogleGenAI} from '@google/genai';
  const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
  const unsafePrompt =
    "I support Martians Soccer Club and I think Jupiterians Football Club sucks! Write a ironic phrase about them including expletives.";

  const response = await ai.models.generateContent({
    model: "gemini-3.5-flash",
    contents: unsafePrompt,
    config: {
      safetySettings: [
        {
          category: "HARM_CATEGORY_HATE_SPEECH",
          threshold: "BLOCK_MEDIUM_AND_ABOVE",
        },
        {
          category: "HARM_CATEGORY_HARASSMENT",
          threshold: "BLOCK_ONLY_HIGH",
        },
      ],
    },
  });

  try {
    console.log("Generated text:", response.text);
  } catch (error) {
    console.log("No information generated by the model.");
  }
  console.log("Safety ratings:", response.candidates[0].safetyRatings);
  return response;
}

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

unsafePrompt := "I support Martians Soccer Club and I think Jupiterians Football Club sucks! " +
	"Write a ironic phrase about them including expletives."

config := &genai.GenerateContentConfig{
	SafetySettings: []*genai.SafetySetting{
		{
			Category:  "HARM_CATEGORY_HATE_SPEECH",
			Threshold: "BLOCK_MEDIUM_AND_ABOVE",
		},
		{
			Category:  "HARM_CATEGORY_HARASSMENT",
			Threshold: "BLOCK_ONLY_HIGH",
		},
	},
}
contents := []*genai.Content{
	genai.NewContentFromText(unsafePrompt, genai.RoleUser),
}
response, err := client.Models.GenerateContent(ctx, "gemini-3.5-flash", contents, config)
if err != nil {
	log.Fatal(err)
}

// Print the generated text.
text := response.Text()
fmt.Println("Generated text:", text)

// Print the and safety ratings from the first candidate.
if len(response.Candidates) > 0 {
	fmt.Println("Finish reason:", response.Candidates[0].FinishReason)
	safetyRatings, err := json.MarshalIndent(response.Candidates[0].SafetyRatings, "", "  ")
	if err != nil {
		return err
	}
	fmt.Println("Safety ratings:", string(safetyRatings))
} else {
	fmt.Println("No candidate returned.")
}

খোলস

echo '{
    "safetySettings": [
        {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_ONLY_HIGH"},
        {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_MEDIUM_AND_ABOVE"}
    ],
    "contents": [{
        "parts":[{
            "text": "'I support Martians Soccer Club and I think Jupiterians Football Club sucks! Write a ironic phrase about them.'"}]}]}' > request.json

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d @request.json 2> /dev/null

জাভা

Client client = new Client();

String unsafePrompt = """
         I support Martians Soccer Club and I think Jupiterians Football Club sucks!
         Write a ironic phrase about them including expletives.
        """;

GenerateContentConfig config =
        GenerateContentConfig.builder()
                .safetySettings(Arrays.asList(
                        SafetySetting.builder()
                                .category("HARM_CATEGORY_HATE_SPEECH")
                                .threshold("BLOCK_MEDIUM_AND_ABOVE")
                                .build(),
                        SafetySetting.builder()
                                .category("HARM_CATEGORY_HARASSMENT")
                                .threshold("BLOCK_ONLY_HIGH")
                                .build()
                )).build();

GenerateContentResponse response =
        client.models.generateContent(
                "gemini-3.5-flash",
                unsafePrompt,
                config);

try {
    System.out.println(response.text());
} catch (Exception e) {
    System.out.println("No information generated by the model");
}

System.out.println(response.candidates().get().getFirst().safetyRatings());

System Instruction

পাইথন

from google import genai
from google.genai import types

client = genai.Client()
response = client.models.generate_content(
    model="gemini-3.5-flash",
    contents="Good morning! How are you?",
    config=types.GenerateContentConfig(
        system_instruction="You are a cat. Your name is Neko."
    ),
)
print(response.text)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const response = await ai.models.generateContent({
  model: "gemini-3.5-flash",
  contents: "Good morning! How are you?",
  config: {
    systemInstruction: "You are a cat. Your name is Neko.",
  },
});
console.log(response.text);

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

// Construct the user message contents.
contents := []*genai.Content{
	genai.NewContentFromText("Good morning! How are you?", genai.RoleUser),
}

// Set the system instruction as a *genai.Content.
config := &genai.GenerateContentConfig{
	SystemInstruction: genai.NewContentFromText("You are a cat. Your name is Neko.", genai.RoleUser),
}

response, err := client.Models.GenerateContent(ctx, "gemini-3.5-flash", contents, config)
if err != nil {
	log.Fatal(err)
}
printResponse(response)

খোলস

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=$GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{ "system_instruction": {
    "parts":
      { "text": "You are a cat. Your name is Neko."}},
    "contents": {
      "parts": {
        "text": "Hello there"}}}'

জাভা

Client client = new Client();

Part textPart = Part.builder().text("You are a cat. Your name is Neko.").build();

Content content = Content.builder().role("system").parts(ImmutableList.of(textPart)).build();

GenerateContentConfig config = GenerateContentConfig.builder()
        .systemInstruction(content)
        .build();

GenerateContentResponse response =
        client.models.generateContent(
                "gemini-3.5-flash",
                "Good morning! How are you?",
                config);

System.out.println(response.text());

প্রতিক্রিয়া সংস্থা

সফল হলে, রেসপন্স বডিতে GenerateContentResponse এর একটি ইনস্ট্যান্স থাকে।

পদ্ধতি: models.streamGenerateContent

GenerateContentRequest ইনপুটের ভিত্তিতে মডেল থেকে একটি স্ট্রিমড রেসপন্স তৈরি করে।

এন্ডপয়েন্ট

পোস্ট https: / /generativelanguage.googleapis.com /v1beta /{model=models /*}:streamGenerateContent

পথের পরামিতি

model string

আবশ্যক। সমাপ্তি তৈরির জন্য ব্যবহৃত Model নাম।

ফর্ম্যাট: models/{model} । এটি models/{model} আকারে থাকে।

অনুরোধকারী শরীর

অনুরোধের মূল অংশে নিম্নলিখিত কাঠামোসহ ডেটা থাকে:

ক্ষেত্র
contents[] object ( Content )

প্রয়োজনীয়। মডেলের সাথে বর্তমান কথোপকথনের বিষয়বস্তু।

একক-বারিক কোয়েরির ক্ষেত্রে, এটি একটি একক ইনস্ট্যান্স। চ্যাটের মতো একাধিক-বারিক কোয়েরির ক্ষেত্রে, এটি একটি পুনরাবৃত্ত ক্ষেত্র যা কথোপকথনের ইতিহাস এবং সর্বশেষ অনুরোধ ধারণ করে।

tools[] object ( Tool )

ঐচ্ছিক। পরবর্তী প্রতিক্রিয়া তৈরি করতে Model Tools ব্যবহার করতে পারে তার একটি তালিকা।

Tool হলো এক খণ্ড কোড যা সিস্টেমকে বাহ্যিক সিস্টেমের সাথে যোগাযোগ করে Model জ্ঞান ও পরিধির বাইরে কোনো একটি বা একাধিক কাজ সম্পাদন করতে সক্ষম করে। সমর্থিত Tool হলো Function এবং codeExecution । আরও জানতে ফাংশন কলিং এবং কোড এক্সিকিউশন গাইডগুলো দেখুন।

toolConfig object ( ToolConfig )

ঐচ্ছিক। অনুরোধে উল্লেখিত যেকোনো Tool জন্য টুল কনফিগারেশন। ব্যবহারের উদাহরণের জন্য ফাংশন কলিং গাইড দেখুন।

safetySettings[] object ( SafetySetting )

ঐচ্ছিক। অনিরাপদ কন্টেন্ট ব্লক করার জন্য স্বতন্ত্র SafetySetting ইনস্ট্যান্সগুলোর একটি তালিকা।

এটি GenerateContentRequest.contents এবং GenerateContentResponse.candidates এর উপর প্রয়োগ করা হবে। প্রতিটি SafetyCategory টাইপের জন্য একাধিক সেটিং থাকা উচিত নয়। এই সেটিংগুলো দ্বারা নির্ধারিত থ্রেশহোল্ড পূরণ করতে ব্যর্থ হলে API সেই সমস্ত কন্টেন্ট এবং রেসপন্স ব্লক করে দেবে। এই তালিকাটি safetySettings-এ উল্লেখিত প্রতিটি SafetyCategory জন্য ডিফল্ট সেটিংগুলোকে ওভাররাইড করে। তালিকায় কোনো নির্দিষ্ট SafetyCategory জন্য SafetySetting না থাকলে, API সেই ক্যাটাগরির জন্য ডিফল্ট সেফটি সেটিং ব্যবহার করবে। HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY, HARM_CATEGORY_JAILBREAK হার্ম ক্যাটাগরিগুলো সমর্থিত। উপলব্ধ সেফটি সেটিংস সম্পর্কে বিস্তারিত তথ্যের জন্য গাইডটি দেখুন। আপনার এআই অ্যাপ্লিকেশনগুলিতে কীভাবে নিরাপত্তা সংক্রান্ত বিষয়গুলি অন্তর্ভুক্ত করবেন তা জানতে নিরাপত্তা নির্দেশিকাটিও দেখুন।

systemInstruction object ( Content )

ঐচ্ছিক। ডেভেলপার কর্তৃক নির্ধারিত সিস্টেম নির্দেশাবলী । বর্তমানে, শুধুমাত্র টেক্সট আকারে উপলব্ধ।

generationConfig object ( GenerationConfig )

ঐচ্ছিক। মডেল তৈরি এবং আউটপুটের জন্য কনফিগারেশন বিকল্পসমূহ।

cachedContent string

ঐচ্ছিক। প্রেডিকশন পরিবেশনের জন্য কনটেক্সট হিসেবে ব্যবহার করার জন্য ক্যাশ করা কন্টেন্টের নাম। ফরম্যাট: cachedContents/{cachedContent}

serviceTier enum ( ServiceTier )

ঐচ্ছিক। অনুরোধটির পরিষেবা স্তর।

boolean store

ঐচ্ছিক। এটি একটি নির্দিষ্ট অনুরোধের জন্য লগিং আচরণ নির্ধারণ করে। সেট করা হলে, এটি প্রজেক্ট-স্তরের লগিং কনফিগারেশনের চেয়ে অগ্রাধিকার পায়।

উদাহরণ অনুরোধ

পাঠ্য

পাইথন

from google import genai

client = genai.Client()
response = client.models.generate_content_stream(
    model="gemini-3.5-flash", contents="Write a story about a magic backpack."
)
for chunk in response:
    print(chunk.text)
    print("_" * 80)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const response = await ai.models.generateContentStream({
  model: "gemini-3.5-flash",
  contents: "Write a story about a magic backpack.",
});
let text = "";
for await (const chunk of response) {
  console.log(chunk.text);
  text += chunk.text;
}

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}
contents := []*genai.Content{
	genai.NewContentFromText("Write a story about a magic backpack.", genai.RoleUser),
}
for response, err := range client.Models.GenerateContentStream(
	ctx,
	"gemini-3.5-flash",
	contents,
	nil,
) {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(response.Candidates[0].Content.Parts[0].Text)
}

খোলস

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse&key=${GEMINI_API_KEY}" \
        -H 'Content-Type: application/json' \
        --no-buffer \
        -d '{ "contents":[{"parts":[{"text": "Write a story about a magic backpack."}]}]}'

জাভা

Client client = new Client();

ResponseStream<GenerateContentResponse> responseStream =
        client.models.generateContentStream(
                "gemini-3.5-flash",
                "Write a story about a magic backpack.",
                null);

StringBuilder response = new StringBuilder();
for (GenerateContentResponse res : responseStream) {
    System.out.print(res.text());
    response.append(res.text());
}

responseStream.close();

ছবি

পাইথন

from google import genai
import PIL.Image

client = genai.Client()
organ = PIL.Image.open(media / "organ.jpg")
response = client.models.generate_content_stream(
    model="gemini-3.5-flash", contents=["Tell me about this instrument", organ]
)
for chunk in response:
    print(chunk.text)
    print("_" * 80)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const organ = await ai.files.upload({
  file: path.join(media, "organ.jpg"),
});

const response = await ai.models.generateContentStream({
  model: "gemini-3.5-flash",
  contents: [
    createUserContent([
      "Tell me about this instrument", 
      createPartFromUri(organ.uri, organ.mimeType)
    ]),
  ],
});
let text = "";
for await (const chunk of response) {
  console.log(chunk.text);
  text += chunk.text;
}

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}
file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "organ.jpg"), 
	&genai.UploadFileConfig{
		MIMEType : "image/jpeg",
	},
)
if err != nil {
	log.Fatal(err)
}
parts := []*genai.Part{
	genai.NewPartFromText("Tell me about this instrument"),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}
contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}
for response, err := range client.Models.GenerateContentStream(
	ctx,
	"gemini-3.5-flash",
	contents,
	nil,
) {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(response.Candidates[0].Content.Parts[0].Text)
}

খোলস

cat > "$TEMP_JSON" << EOF
{
  "contents": [{
    "parts":[
      {"text": "Tell me about this instrument"},
      {
        "inline_data": {
          "mime_type":"image/jpeg",
          "data": "$(cat "$TEMP_B64")"
        }
      }
    ]
  }]
}
EOF

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse&key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d "@$TEMP_JSON" 2> /dev/null

জাভা

Client client = new Client();

String path = media_path + "organ.jpg";
byte[] imageData = Files.readAllBytes(Paths.get(path));

Content content =
        Content.fromParts(
                Part.fromText("Tell me about this instrument."),
                Part.fromBytes(imageData, "image/jpeg"));


ResponseStream<GenerateContentResponse> responseStream =
        client.models.generateContentStream(
                "gemini-3.5-flash",
                content,
                null);

StringBuilder response = new StringBuilder();
for (GenerateContentResponse res : responseStream) {
    System.out.print(res.text());
    response.append(res.text());
}

responseStream.close();

অডিও

পাইথন

from google import genai

client = genai.Client()
sample_audio = client.files.upload(file=media / "sample.mp3")
response = client.models.generate_content_stream(
    model="gemini-3.5-flash",
    contents=["Give me a summary of this audio file.", sample_audio],
)
for chunk in response:
    print(chunk.text)
    print("_" * 80)

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "sample.mp3"), 
	&genai.UploadFileConfig{
		MIMEType : "audio/mpeg",
	},
)
if err != nil {
	log.Fatal(err)
}

parts := []*genai.Part{
	genai.NewPartFromText("Give me a summary of this audio file."),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}

contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}

for result, err := range client.Models.GenerateContentStream(
	ctx,
	"gemini-3.5-flash",
	contents,
	nil,
) {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(result.Candidates[0].Content.Parts[0].Text)
}

খোলস

# Use File API to upload audio data to API request.
MIME_TYPE=$(file -b --mime-type "${AUDIO_PATH}")
NUM_BYTES=$(wc -c < "${AUDIO_PATH}")
DISPLAY_NAME=AUDIO

tmp_header_file=upload-header.tmp

# Initial resumable request defining metadata.
# The upload url is in the response headers dump them to a file.
curl "${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}" \
  -D upload-header.tmp \
  -H "X-Goog-Upload-Protocol: resumable" \
  -H "X-Goog-Upload-Command: start" \
  -H "X-Goog-Upload-Header-Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Header-Content-Type: ${MIME_TYPE}" \
  -H "Content-Type: application/json" \
  -d "{'file': {'display_name': '${DISPLAY_NAME}'}}" 2> /dev/null

upload_url=$(grep -i "x-goog-upload-url: " "${tmp_header_file}" | cut -d" " -f2 | tr -d "\r")
rm "${tmp_header_file}"

# Upload the actual bytes.
curl "${upload_url}" \
  -H "Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Offset: 0" \
  -H "X-Goog-Upload-Command: upload, finalize" \
  --data-binary "@${AUDIO_PATH}" 2> /dev/null > file_info.json

file_uri=$(jq ".file.uri" file_info.json)
echo file_uri=$file_uri

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse&key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[
          {"text": "Please describe this file."},
          {"file_data":{"mime_type": "audio/mpeg", "file_uri": '$file_uri'}}]
        }]
       }' 2> /dev/null > response.json

cat response.json
echo

ভিডিও

পাইথন

from google import genai
import time

client = genai.Client()
# Video clip (CC BY 3.0) from https://peach.blender.org/download/
myfile = client.files.upload(file=media / "Big_Buck_Bunny.mp4")
print(f"{myfile=}")

# Poll until the video file is completely processed (state becomes ACTIVE).
while not myfile.state or myfile.state.name != "ACTIVE":
    print("Processing video...")
    print("File state:", myfile.state)
    time.sleep(5)
    myfile = client.files.get(name=myfile.name)

response = client.models.generate_content_stream(
    model="gemini-3.5-flash", contents=[myfile, "Describe this video clip"]
)
for chunk in response:
    print(chunk.text)
    print("_" * 80)

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

let video = await ai.files.upload({
  file: path.join(media, 'Big_Buck_Bunny.mp4'),
});

// Poll until the video file is completely processed (state becomes ACTIVE).
while (!video.state || video.state.toString() !== 'ACTIVE') {
  console.log('Processing video...');
  console.log('File state: ', video.state);
  await sleep(5000);
  video = await ai.files.get({name: video.name});
}

const response = await ai.models.generateContentStream({
  model: "gemini-3.5-flash",
  contents: [
    createUserContent([
      "Describe this video clip",
      createPartFromUri(video.uri, video.mimeType),
    ]),
  ],
});
let text = "";
for await (const chunk of response) {
  console.log(chunk.text);
  text += chunk.text;
}

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "Big_Buck_Bunny.mp4"), 
	&genai.UploadFileConfig{
		MIMEType : "video/mp4",
	},
)
if err != nil {
	log.Fatal(err)
}

// Poll until the video file is completely processed (state becomes ACTIVE).
for file.State == genai.FileStateUnspecified || file.State != genai.FileStateActive {
	fmt.Println("Processing video...")
	fmt.Println("File state:", file.State)
	time.Sleep(5 * time.Second)

	file, err = client.Files.Get(ctx, file.Name, nil)
	if err != nil {
		log.Fatal(err)
	}
}

parts := []*genai.Part{
	genai.NewPartFromText("Describe this video clip"),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}

contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}

for result, err := range client.Models.GenerateContentStream(
	ctx,
	"gemini-3.5-flash",
	contents,
	nil,
) {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(result.Candidates[0].Content.Parts[0].Text)
}

খোলস

# Use File API to upload audio data to API request.
MIME_TYPE=$(file -b --mime-type "${VIDEO_PATH}")
NUM_BYTES=$(wc -c < "${VIDEO_PATH}")
DISPLAY_NAME=VIDEO_PATH

# Initial resumable request defining metadata.
# The upload url is in the response headers dump them to a file.
curl "${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}" \
  -D upload-header.tmp \
  -H "X-Goog-Upload-Protocol: resumable" \
  -H "X-Goog-Upload-Command: start" \
  -H "X-Goog-Upload-Header-Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Header-Content-Type: ${MIME_TYPE}" \
  -H "Content-Type: application/json" \
  -d "{'file': {'display_name': '${DISPLAY_NAME}'}}" 2> /dev/null

upload_url=$(grep -i "x-goog-upload-url: " "${tmp_header_file}" | cut -d" " -f2 | tr -d "\r")
rm "${tmp_header_file}"

# Upload the actual bytes.
curl "${upload_url}" \
  -H "Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Offset: 0" \
  -H "X-Goog-Upload-Command: upload, finalize" \
  --data-binary "@${VIDEO_PATH}" 2> /dev/null > file_info.json

file_uri=$(jq ".file.uri" file_info.json)
echo file_uri=$file_uri

state=$(jq ".file.state" file_info.json)
echo state=$state

while [[ "($state)" = *"PROCESSING"* ]];
do
  echo "Processing video..."
  sleep 5
  # Get the file of interest to check state
  curl https://generativelanguage.googleapis.com/v1beta/files/$name > file_info.json
  state=$(jq ".file.state" file_info.json)
done

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse&key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[
          {"text": "Please describe this file."},
          {"file_data":{"mime_type": "video/mp4", "file_uri": '$file_uri'}}]
        }]
       }' 2> /dev/null > response.json

cat response.json
echo

পিডিএফ

পাইথন

from google import genai

client = genai.Client()
sample_pdf = client.files.upload(file=media / "test.pdf")
response = client.models.generate_content_stream(
    model="gemini-3.5-flash",
    contents=["Give me a summary of this document:", sample_pdf],
)

for chunk in response:
    print(chunk.text)
    print("_" * 80)

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

file, err := client.Files.UploadFromPath(
	ctx, 
	filepath.Join(getMedia(), "test.pdf"), 
	&genai.UploadFileConfig{
		MIMEType : "application/pdf",
	},
)
if err != nil {
	log.Fatal(err)
}

parts := []*genai.Part{
	genai.NewPartFromText("Give me a summary of this document:"),
	genai.NewPartFromURI(file.URI, file.MIMEType),
}

contents := []*genai.Content{
	genai.NewContentFromParts(parts, genai.RoleUser),
}

for result, err := range client.Models.GenerateContentStream(
	ctx,
	"gemini-3.5-flash",
	contents,
	nil,
) {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(result.Candidates[0].Content.Parts[0].Text)
}

খোলস

MIME_TYPE=$(file -b --mime-type "${PDF_PATH}")
NUM_BYTES=$(wc -c < "${PDF_PATH}")
DISPLAY_NAME=TEXT


echo $MIME_TYPE
tmp_header_file=upload-header.tmp

# Initial resumable request defining metadata.
# The upload url is in the response headers dump them to a file.
curl "${BASE_URL}/upload/v1beta/files?key=${GEMINI_API_KEY}" \
  -D upload-header.tmp \
  -H "X-Goog-Upload-Protocol: resumable" \
  -H "X-Goog-Upload-Command: start" \
  -H "X-Goog-Upload-Header-Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Header-Content-Type: ${MIME_TYPE}" \
  -H "Content-Type: application/json" \
  -d "{'file': {'display_name': '${DISPLAY_NAME}'}}" 2> /dev/null

upload_url=$(grep -i "x-goog-upload-url: " "${tmp_header_file}" | cut -d" " -f2 | tr -d "\r")
rm "${tmp_header_file}"

# Upload the actual bytes.
curl "${upload_url}" \
  -H "Content-Length: ${NUM_BYTES}" \
  -H "X-Goog-Upload-Offset: 0" \
  -H "X-Goog-Upload-Command: upload, finalize" \
  --data-binary "@${PDF_PATH}" 2> /dev/null > file_info.json

file_uri=$(jq ".file.uri" file_info.json)
echo file_uri=$file_uri

# Now generate content using that file
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse&key=$GEMINI_API_KEY" \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [{
        "parts":[
          {"text": "Can you add a few more lines to this poem?"},
          {"file_data":{"mime_type": "application/pdf", "file_uri": '$file_uri'}}]
        }]
       }' 2> /dev/null > response.json

cat response.json
echo

চ্যাট

পাইথন

from google import genai
from google.genai import types

client = genai.Client()
chat = client.chats.create(
    model="gemini-3.5-flash",
    history=[
        types.Content(role="user", parts=[types.Part(text="Hello")]),
        types.Content(
            role="model",
            parts=[
                types.Part(
                    text="Great to meet you. What would you like to know?"
                )
            ],
        ),
    ],
)
response = chat.send_message_stream(message="I have 2 dogs in my house.")
for chunk in response:
    print(chunk.text)
    print("_" * 80)
response = chat.send_message_stream(message="How many paws are in my house?")
for chunk in response:
    print(chunk.text)
    print("_" * 80)

print(chat.get_history())

নোড.জেএস

// Make sure to include the following import:
// import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const chat = ai.chats.create({
  model: "gemini-3.5-flash",
  history: [
    {
      role: "user",
      parts: [{ text: "Hello" }],
    },
    {
      role: "model",
      parts: [{ text: "Great to meet you. What would you like to know?" }],
    },
  ],
});

console.log("Streaming response for first message:");
const stream1 = await chat.sendMessageStream({
  message: "I have 2 dogs in my house.",
});
for await (const chunk of stream1) {
  console.log(chunk.text);
  console.log("_".repeat(80));
}

console.log("Streaming response for second message:");
const stream2 = await chat.sendMessageStream({
  message: "How many paws are in my house?",
});
for await (const chunk of stream2) {
  console.log(chunk.text);
  console.log("_".repeat(80));
}

console.log(chat.getHistory());

যান

ctx := context.Background()
client, err := genai.NewClient(ctx, &genai.ClientConfig{
	APIKey:  os.Getenv("GEMINI_API_KEY"),
	Backend: genai.BackendGeminiAPI,
})
if err != nil {
	log.Fatal(err)
}

history := []*genai.Content{
	genai.NewContentFromText("Hello", genai.RoleUser),
	genai.NewContentFromText("Great to meet you. What would you like to know?", genai.RoleModel),
}
chat, err := client.Chats.Create(ctx, "gemini-3.5-flash", nil, history)
if err != nil {
	log.Fatal(err)
}

for chunk, err := range chat.SendMessageStream(ctx, genai.Part{Text: "I have 2 dogs in my house."}) {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(chunk.Text())
	fmt.Println(strings.Repeat("_", 64))
}

for chunk, err := range chat.SendMessageStream(ctx, genai.Part{Text: "How many paws are in my house?"}) {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(chunk.Text())
	fmt.Println(strings.Repeat("_", 64))
}

fmt.Println(chat.History(false))

খোলস

curl https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse&key=$GEMINI_API_KEY \
    -H 'Content-Type: application/json' \
    -X POST \
    -d '{
      "contents": [
        {"role":"user",
         "parts":[{
           "text": "Hello"}]},
        {"role": "model",
         "parts":[{
           "text": "Great to meet you. What would you like to know?"}]},
        {"role":"user",
         "parts":[{
           "text": "I have two dogs in my house. How many paws are in my house?"}]},
      ]
    }' 2> /dev/null | grep "text"

প্রতিক্রিয়া সংস্থা

সফল হলে, রেসপন্স বডিতে GenerateContentResponse ইনস্ট্যান্সের একটি ধারা থাকে।

বিষয়বস্তু প্রতিক্রিয়া তৈরি করুন

একাধিক সম্ভাব্য প্রতিক্রিয়া সমর্থনকারী মডেল থেকে প্রাপ্ত প্রতিক্রিয়া।

GenerateContentResponse.prompt_feedback এ উভয় প্রম্পটের জন্য এবং finishReasonsafetyRatings এ প্রতিটি ক্যান্ডিডেটের জন্য সেফটি রেটিং এবং কন্টেন্ট ফিল্টারিং রিপোর্ট করা হয়। এপিআইটি: - অনুরোধ করা সমস্ত ক্যান্ডিডেট অথবা কোনোটিই রিটার্ন করে না - শুধুমাত্র প্রম্পটে কোনো সমস্যা থাকলে কোনো ক্যান্ডিডেটই রিটার্ন করে না ( promptFeedback চেক করুন) - finishReason এবং safetyRatings এ প্রতিটি ক্যান্ডিডেটের উপর ফিডব্যাক রিপোর্ট করে।

ক্ষেত্র
candidates[] object ( Candidate )

মডেল থেকে প্রাপ্ত সম্ভাব্য উত্তরসমূহ।

promptFeedback object ( PromptFeedback )

কন্টেন্ট ফিল্টারগুলো সম্পর্কিত প্রম্পটের প্রতিক্রিয়া ফেরত দেয়।

usageMetadata object ( UsageMetadata )

শুধুমাত্র আউটপুট। জেনারেশন অনুরোধগুলোর টোকেন ব্যবহারের মেটাডেটা।

modelVersion string

শুধুমাত্র আউটপুট। প্রতিক্রিয়া তৈরি করতে ব্যবহৃত মডেল সংস্করণ।

responseId string

শুধুমাত্র আউটপুট। প্রতিটি প্রতিক্রিয়া শনাক্ত করতে responseId ব্যবহার করা হয়।

modelStatus object ( ModelStatus )

শুধুমাত্র আউটপুট। এই মডেলটির বর্তমান অবস্থা।

JSON উপস্থাপনা
{
  "candidates": [
    {
      object (Candidate)
    }
  ],
  "promptFeedback": {
    object (PromptFeedback)
  },
  "usageMetadata": {
    object (UsageMetadata)
  },
  "modelVersion": string,
  "responseId": string,
  "modelStatus": {
    object (ModelStatus)
  }
}

প্রম্পটফিডব্যাক

GenerateContentRequest.content এ প্রম্পট দ্বারা নির্দিষ্ট করা ফিডব্যাক মেটাডেটার একটি সেট।

ক্ষেত্র
blockReason enum ( BlockReason )

ঐচ্ছিক। এটি সেট করা থাকলে, প্রম্পটটি ব্লক করা হয় এবং কোনো প্রার্থীকে ফেরত দেওয়া হয় না। প্রম্পটটি নতুন করে লিখুন।

safetyRatings[] object ( SafetyRating )

প্রম্পটের নিরাপত্তার জন্য রেটিং। প্রতিটি বিভাগে সর্বাধিক একটি রেটিং দেওয়া যাবে।

JSON উপস্থাপনা
{
  "blockReason": enum (BlockReason),
  "safetyRatings": [
    {
      object (SafetyRating)
    }
  ]
}

ব্লকরিজন

প্রম্পটটি ব্লক করার কারণ উল্লেখ করে।

এনাম
BLOCK_REASON_UNSPECIFIED ডিফল্ট মান। এই মানটি ব্যবহৃত হয় না।
SAFETY নিরাপত্তাজনিত কারণে প্রম্পটটি ব্লক করা হয়েছে। কোন নিরাপত্তা বিভাগের কারণে এটি ব্লক করা হয়েছে তা জানতে safetyRatings দেখুন।
OTHER অজ্ঞাত কারণে প্রম্পটটি ব্লক করা হয়েছিল।
BLOCKLIST পরিভাষা ব্লক তালিকায় অন্তর্ভুক্ত শব্দ থাকার কারণে প্রম্পটটি ব্লক করা হয়েছে।
PROHIBITED_CONTENT নিষিদ্ধ বিষয়বস্তুর কারণে প্রম্পটটি ব্লক করা হয়েছে।
IMAGE_SAFETY অনিরাপদ ছবি তৈরির কারণে প্রার্থীদের ব্লক করা হয়েছে।

ব্যবহার মেটাডেটা

জেনারেশন রিকোয়েস্টের টোকেন ব্যবহারের মেটাডেটা।

ক্ষেত্র
promptTokenCount integer

প্রম্পটে থাকা টোকেনের সংখ্যা। যখন cachedContent সেট করা থাকে, তখনও এটিই মোট কার্যকর প্রম্পট সাইজ হিসেবে গণ্য হয়, অর্থাৎ এর মধ্যে ক্যাশ করা কন্টেন্টে থাকা টোকেনের সংখ্যাও অন্তর্ভুক্ত থাকে।

cachedContentTokenCount integer

প্রম্পটের ক্যাশ করা অংশে (ক্যাশ করা বিষয়বস্তু) থাকা টোকেনের সংখ্যা

candidatesTokenCount integer

তৈরি হওয়া সমস্ত সম্ভাব্য উত্তর জুড়ে থাকা টোকেনের মোট সংখ্যা।

toolUsePromptTokenCount integer

শুধুমাত্র আউটপুট। টুল-ব্যবহারের প্রম্পট(গুলি)-তে উপস্থিত টোকেনের সংখ্যা।

thoughtsTokenCount integer

শুধুমাত্র আউটপুট। চিন্তন মডেলগুলোর জন্য চিন্তার টোকেনের সংখ্যা।

totalTokenCount integer

জেনারেশন অনুরোধের জন্য মোট টোকেন সংখ্যা (প্রম্পট + ভাবনা + সম্ভাব্য উত্তর)।

promptTokensDetails[] object ( ModalityTokenCount )

শুধুমাত্র আউটপুট। অনুরোধের ইনপুটে প্রক্রিয়াকৃত মোডালিটিগুলোর তালিকা।

cacheTokensDetails[] object ( ModalityTokenCount )

শুধুমাত্র আউটপুট। অনুরোধ ইনপুটে থাকা ক্যাশ করা কন্টেন্টের মোডালিটির তালিকা।

candidatesTokensDetails[] object ( ModalityTokenCount )

শুধুমাত্র আউটপুট। প্রতিক্রিয়ায় ফেরত আসা মোডালিটিগুলোর তালিকা।

toolUsePromptTokensDetails[] object ( ModalityTokenCount )

শুধুমাত্র আউটপুট। টুল-ব্যবহারের অনুরোধের ইনপুটগুলোর জন্য যে মোডালিটিগুলো প্রক্রিয়া করা হয়েছিল, তার তালিকা।

serviceTier enum ( ServiceTier )

শুধুমাত্র আউটপুট। অনুরোধটির পরিষেবা স্তর।

JSON উপস্থাপনা
{
  "promptTokenCount": integer,
  "cachedContentTokenCount": integer,
  "candidatesTokenCount": integer,
  "toolUsePromptTokenCount": integer,
  "thoughtsTokenCount": integer,
  "totalTokenCount": integer,
  "promptTokensDetails": [
    {
      object (ModalityTokenCount)
    }
  ],
  "cacheTokensDetails": [
    {
      object (ModalityTokenCount)
    }
  ],
  "candidatesTokensDetails": [
    {
      object (ModalityTokenCount)
    }
  ],
  "toolUsePromptTokensDetails": [
    {
      object (ModalityTokenCount)
    }
  ],
  "serviceTier": enum (ServiceTier)
}

মডেলস্ট্যাটাস

অন্তর্নিহিত মডেলের অবস্থা। এটি অন্তর্নিহিত মডেলের পর্যায় এবং প্রযোজ্য ক্ষেত্রে অবসরের সময় নির্দেশ করতে ব্যবহৃত হয়।

ক্ষেত্র
modelStage enum ( ModelStage )

অন্তর্নিহিত মডেলের পর্যায়।

retirementTime string ( Timestamp format)

যে সময়ে মডেলটি বন্ধ করে দেওয়া হবে।

RFC 3339 ব্যবহার করা হয়, যেখানে তৈরি হওয়া আউটপুট সর্বদা Z-নরম্যালাইজড হবে এবং এতে ০, ৩, ৬ বা ৯টি ভগ্নাংশীয় অঙ্ক ব্যবহৃত হবে। "Z" ছাড়াও অন্যান্য অফসেটও গ্রহণ করা হয়। উদাহরণ: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" অথবা "2014-10-02T15:01:23+05:30"

message string

মডেলের অবস্থা ব্যাখ্যা করে একটি বার্তা।

JSON উপস্থাপনা
{
  "modelStage": enum (ModelStage),
  "retirementTime": string,
  "message": string
}

মডেলস্টেজ

অন্তর্নিহিত মডেলের পর্যায়কে সংজ্ঞায়িত করে।

এনাম
MODEL_STAGE_UNSPECIFIED অনির্দিষ্ট মডেল পর্যায়।
UNSTABLE_EXPERIMENTAL

অন্তর্নিহিত মডেলটিতে অনেক পরিমার্জন করা হয়।

EXPERIMENTAL এই পর্যায়ের মডেলগুলো শুধুমাত্র পরীক্ষামূলক উদ্দেশ্যে ব্যবহৃত হবে।
PREVIEW এই পর্যায়ের মডেলগুলো পরীক্ষামূলক মডেলগুলোর চেয়ে বেশি পরিপক্ক।
STABLE এই পর্যায়ের মডেলগুলোকে স্থিতিশীল এবং উৎপাদনের জন্য প্রস্তুত বলে মনে করা হয়।
LEGACY মডেলটি এই পর্যায়ে থাকলে, এর অর্থ হলো অদূর ভবিষ্যতে এই মডেলটি বাতিল হতে চলেছে। শুধুমাত্র বিদ্যমান গ্রাহকরাই এই মডেলটি ব্যবহার করতে পারবেন।
DEPRECATED

এই পর্যায়ের মডেলগুলো অপ্রচলিত। এই মডেলগুলো ব্যবহার করা যাবে না।

RETIRED এই পর্যায়ের মডেলগুলো বাতিল করা হয়েছে। এই মডেলগুলো ব্যবহার করা যাবে না।

প্রার্থী

মডেল থেকে তৈরি একটি সম্ভাব্য প্রতিক্রিয়া।

ক্ষেত্র
content object ( Content )

শুধুমাত্র আউটপুট। মডেল থেকে প্রাপ্ত জেনারেটেড কন্টেন্ট।

finishReason enum ( FinishReason )

ঐচ্ছিক। শুধুমাত্র আউটপুট। মডেলটি কেন টোকেন তৈরি করা বন্ধ করে দিয়েছে তার কারণ।

খালি থাকলে, মডেলটি টোকেন তৈরি করা বন্ধ করেনি।

safetyRatings[] object ( SafetyRating )

একজন সাড়াদানকারী প্রার্থীর নিরাপত্তার রেটিং-এর তালিকা।

প্রতিটি বিভাগে সর্বাধিক একটি রেটিং থাকতে পারে।

citationMetadata object ( CitationMetadata )

শুধুমাত্র আউটপুট। মডেল-উৎপাদিত ক্যান্ডিডেটের জন্য উদ্ধৃতি তথ্য।

এই ক্ষেত্রটি content অন্তর্ভুক্ত যেকোনো পাঠ্যের আবৃত্তি সংক্রান্ত তথ্য দিয়ে পূরণ করা যেতে পারে। এগুলি হলো সেইসব অংশ যা মৌলিক এলএলএম (LLM) প্রশিক্ষণ ডেটার কপিরাইটযুক্ত উপাদান থেকে "আবৃত্তি" করা হয়।

tokenCount integer

শুধুমাত্র আউটপুট। এই ক্যান্ডিডেটের জন্য টোকেন সংখ্যা।

groundingAttributions[] object ( GroundingAttribution )

শুধুমাত্র আউটপুট। একটি সুপ্রতিষ্ঠিত উত্তর প্রদানে অবদান রাখা উৎসগুলোর স্বীকৃতিমূলক তথ্য।

GenerateAnswer কলগুলোর জন্য এই ফিল্ডটি পূরণ করা হয়।

groundingMetadata object ( GroundingMetadata )

শুধুমাত্র আউটপুট। প্রার্থীর জন্য গ্রাউন্ডিং মেটাডেটা।

GenerateContent কলগুলোর জন্য এই ফিল্ডটি পূরণ করা হয়।

avgLogprobs number

শুধুমাত্র আউটপুট। প্রার্থীর গড় লগ সম্ভাব্যতা স্কোর।

logprobsResult object ( LogprobsResult )

শুধুমাত্র আউটপুট। প্রতিক্রিয়া টোকেন এবং শীর্ষ টোকেনগুলির জন্য লগ-লাইকলিহুড স্কোর।

urlContextMetadata object ( UrlContextMetadata )

শুধুমাত্র আউটপুট। ইউআরএল কনটেক্সট পুনরুদ্ধার টুল সম্পর্কিত মেটাডেটা।

index integer

শুধুমাত্র আউটপুট। প্রতিক্রিয়া প্রার্থীদের তালিকায় প্রার্থীর সূচক।

finishMessage string

ঐচ্ছিক। শুধুমাত্র আউটপুট। মডেলটি কেন টোকেন তৈরি করা বন্ধ করেছে তার কারণ বিস্তারিতভাবে জানায়। এটি শুধুমাত্র তখনই পূরণ করা হয় যখন finishReason সেট করা থাকে।

JSON উপস্থাপনা
{
  "content": {
    object (Content)
  },
  "finishReason": enum (FinishReason),
  "safetyRatings": [
    {
      object (SafetyRating)
    }
  ],
  "citationMetadata": {
    object (CitationMetadata)
  },
  "tokenCount": integer,
  "groundingAttributions": [
    {
      object (GroundingAttribution)
    }
  ],
  "groundingMetadata": {
    object (GroundingMetadata)
  },
  "avgLogprobs": number,
  "logprobsResult": {
    object (LogprobsResult)
  },
  "urlContextMetadata": {
    object (UrlContextMetadata)
  },
  "index": integer,
  "finishMessage": string
}

ফিনিশরিজন

মডেলটি কেন টোকেন তৈরি করা বন্ধ করে দিয়েছে তার কারণ ব্যাখ্যা করে।

এনাম
FINISH_REASON_UNSPECIFIED ডিফল্ট মান। এই মানটি ব্যবহৃত হয় না।
STOP মডেলটির স্বাভাবিক সমাপ্তি বিন্দু অথবা প্রদত্ত সমাপ্তি ক্রম।
MAX_TOKENS অনুরোধে উল্লেখিত সর্বোচ্চ সংখ্যক টোকেন পূর্ণ হয়ে গেছে।
SAFETY নিরাপত্তাজনিত কারণে সম্ভাব্য প্রতিক্রিয়া বিষয়বস্তুটি চিহ্নিত করা হয়েছে।
RECITATION আবৃত্তির কারণে উত্তরটির সম্ভাব্য বিষয়বস্তু চিহ্নিত করা হয়েছে।
LANGUAGE অসমর্থিত ভাষা ব্যবহারের কারণে সম্ভাব্য প্রতিক্রিয়া বিষয়বস্তুটি চিহ্নিত করা হয়েছে।
OTHER অজ্ঞাত কারণ।
BLOCKLIST বিষয়বস্তুতে নিষিদ্ধ শব্দ থাকায় টোকেন তৈরি করা বন্ধ করা হয়েছে।
PROHIBITED_CONTENT সম্ভাব্য নিষিদ্ধ বিষয়বস্তু থাকার কারণে টোকেন তৈরি বন্ধ করা হয়েছে।
SPII বিষয়বস্তুটিতে সম্ভাব্য সংবেদনশীল ব্যক্তিগত শনাক্তকরণ তথ্য (SPII) থাকায় টোকেন তৈরি বন্ধ করা হয়েছে।
MALFORMED_FUNCTION_CALL মডেল দ্বারা তৈরি ফাংশন কলটি অবৈধ।
IMAGE_SAFETY তৈরি করা ছবিগুলোতে নিরাপত্তা লঙ্ঘন থাকায় টোকেন তৈরি বন্ধ করা হয়েছে।
IMAGE_PROHIBITED_CONTENT তৈরি করা ছবিগুলোতে অন্যান্য নিষিদ্ধ বিষয়বস্তু থাকায় ছবি তৈরি করা বন্ধ করা হয়েছে।
IMAGE_OTHER অন্যান্য বিবিধ সমস্যার কারণে ছবি তৈরি হওয়া বন্ধ হয়ে গেছে।
NO_IMAGE মডেলটি থেকে একটি ছবি তৈরি হওয়ার কথা ছিল, কিন্তু কোনো ছবি তৈরি হয়নি।
IMAGE_RECITATION আবৃত্তির কারণে চিত্র তৈরি বন্ধ হয়ে গেছে।
UNEXPECTED_TOOL_CALL মডেলটি একটি টুল কল তৈরি করেছে কিন্তু অনুরোধে কোনো টুল সক্রিয় করা হয়নি।
TOO_MANY_TOOL_CALLS মডেলটি পরপর অনেক বেশি টুল কল করায় সিস্টেমটি বন্ধ হয়ে গেছে।
MISSING_THOUGHT_SIGNATURE অনুরোধটিতে অন্তত একটি চিন্তার স্বাক্ষর অনুপস্থিত।
MALFORMED_RESPONSE ত্রুটিপূর্ণ প্রতিক্রিয়ার কারণে সমাপ্ত করা হয়েছে।
ESCALATION একটি এস্কেলেশন নিয়মের মাধ্যমে অনুরোধটি ফিল্টার করা হয়েছিল।

গ্রাউন্ডিং অ্যাট্রিবিউশন

উত্তর প্রদানে অবদান রাখা উৎসের স্বীকৃতি।

ক্ষেত্র
sourceId object ( AttributionSourceId )

শুধুমাত্র আউটপুট। এই অ্যাট্রিবিউশনে অবদানকারী উৎসের শনাক্তকারী।

content object ( Content )

এই অ্যাট্রিবিউশনটি গঠনকারী উৎস বিষয়বস্তুর ভিত্তি স্থাপন।

JSON উপস্থাপনা
{
  "sourceId": {
    object (AttributionSourceId)
  },
  "content": {
    object (Content)
  }
}

অ্যাট্রিবিউশনসোর্সআইডি

এই কৃতিত্ব প্রদানে অবদানকারী উৎসের শনাক্তকারী।

ক্ষেত্র
source Union type
source নিম্নলিখিতগুলির মধ্যে কেবল একটি হতে পারে:
groundingPassage object ( GroundingPassageId )

ইনলাইন অনুচ্ছেদের শনাক্তকারী।

semanticRetrieverChunk object ( SemanticRetrieverChunk )

সিমান্টিক রিট্রিভারের মাধ্যমে প্রাপ্ত একটি Chunk শনাক্তকারী।

JSON উপস্থাপনা
{

  // source
  "groundingPassage": {
    object (GroundingPassageId)
  },
  "semanticRetrieverChunk": {
    object (SemanticRetrieverChunk)
  }
  // Union type
}

গ্রাউন্ডিংপ্যাসেজআইডি

GroundingPassage অন্তর্গত কোনো অংশের শনাক্তকারী।

ক্ষেত্র
passageId string

শুধুমাত্র আউটপুট। GenerateAnswerRequest এর GroundingPassage.id সাথে মিলে যাওয়া প্যাসেজটির আইডি।

partIndex integer

শুধুমাত্র আউটপুট। GenerateAnswerRequest এর GroundingPassage.content এর অন্তর্গত অংশটির সূচী।

JSON উপস্থাপনা
{
  "passageId": string,
  "partIndex": integer
}

SemanticRetrieverChunk

SemanticRetrieverConfig ব্যবহার করে GenerateAnswerRequest এ নির্দিষ্ট করা Semantic Retriever-এর মাধ্যমে পুনরুদ্ধার করা একটি Chunk এর শনাক্তকারী।

ক্ষেত্র
source string

শুধুমাত্র আউটপুট। অনুরোধের SemanticRetrieverConfig.source এর সাথে মেলে এমন উৎসের নাম। উদাহরণ: corpora/123 অথবা corpora/123/documents/abc

chunk string

শুধুমাত্র আউটপুট। অ্যাট্রিবিউটেড টেক্সট ধারণকারী Chunk নাম। উদাহরণ: corpora/123/documents/abc/chunks/xyz

JSON উপস্থাপনা
{
  "source": string,
  "chunk": string
}

গ্রাউন্ডিংমেটাডেটা

গ্রাউন্ডিং সক্রিয় করা হলে মেটাডেটা ক্লায়েন্টকে ফেরত পাঠানো হয়।

ক্ষেত্র
groundingChunks[] object ( GroundingChunk )

নির্দিষ্ট গ্রাউন্ডিং উৎস থেকে প্রাপ্ত সহায়ক রেফারেন্সের তালিকা। স্ট্রিমিং করার সময়, এতে কেবল সেই গ্রাউন্ডিং চাঙ্কগুলো থাকে যেগুলো পূর্ববর্তী রেসপন্সগুলোর গ্রাউন্ডিং মেটাডেটাতে অন্তর্ভুক্ত করা হয়নি।

groundingSupports[] object ( GroundingSupport )

গ্রাউন্ডিং সাপোর্টের তালিকা।

webSearchQueries[] string

পরবর্তী ওয়েব অনুসন্ধানের জন্য ওয়েব অনুসন্ধান প্রশ্নাবলী।

imageSearchQueries[] string

গ্রাউন্ডিংয়ের জন্য ব্যবহৃত ইমেজ সার্চ কোয়েরি।

searchEntryPoint object ( SearchEntryPoint )

ঐচ্ছিক। পরবর্তী ওয়েব অনুসন্ধানের জন্য গুগল সার্চ এন্ট্রি।

retrievalMetadata object ( RetrievalMetadata )

গ্রাউন্ডিং ফ্লোতে পুনরুদ্ধার সম্পর্কিত মেটাডেটা।

googleMapsWidgetContextToken string

ঐচ্ছিক। গুগল ম্যাপস উইজেট কনটেক্সট টোকেনের রিসোর্স নাম, যা প্রাসঙ্গিক ডেটা রেন্ডার করার জন্য PlacesContextElement উইজেটের সাথে ব্যবহার করা যেতে পারে। শুধুমাত্র গুগল ম্যাপসের সাথে গ্রাউন্ডিং সক্রিয় করা থাকলেই এটি পূরণ করা হয়।

JSON উপস্থাপনা
{
  "groundingChunks": [
    {
      object (GroundingChunk)
    }
  ],
  "groundingSupports": [
    {
      object (GroundingSupport)
    }
  ],
  "webSearchQueries": [
    string
  ],
  "imageSearchQueries": [
    string
  ],
  "searchEntryPoint": {
    object (SearchEntryPoint)
  },
  "retrievalMetadata": {
    object (RetrievalMetadata)
  },
  "googleMapsWidgetContextToken": string
}

সার্চএন্ট্রি পয়েন্ট

গুগল অনুসন্ধানের প্রবেশপথ।

ক্ষেত্র
renderedContent string

ঐচ্ছিক। ওয়েব কন্টেন্ট স্নিপেট যা একটি ওয়েব পেজ বা অ্যাপ ওয়েবভিউতে এমবেড করা যায়।

sdkBlob string ( bytes format)

ঐচ্ছিক। <সার্চ টার্ম, সার্চ ইউআরএল> টাপলের অ্যারে উপস্থাপনকারী Base64 এনকোডেড JSON।

একটি বেস৬৪-এনকোডেড স্ট্রিং।

JSON উপস্থাপনা
{
  "renderedContent": string,
  "sdkBlob": string
}

গ্রাউন্ডিংচাঙ্ক

একটি GroundingChunk হলো সহায়ক প্রমাণের এমন একটি অংশ যা মডেলের প্রতিক্রিয়াকে ভিত্তি দেয়। এটি ওয়েব থেকে নেওয়া কোনো অংশ, কোনো ফাইল থেকে সংগৃহীত প্রাসঙ্গিক তথ্য, বা গুগল ম্যাপস থেকে প্রাপ্ত তথ্য হতে পারে।

ক্ষেত্র
chunk_type Union type
খণ্ডের ধরণ। chunk_type নিম্নলিখিতগুলির মধ্যে কেবল একটি হতে পারে:
web object ( Web )

ওয়েব থেকে খণ্ডাংশ গ্রাউন্ডিং করা হচ্ছে।

image object ( Image )

ঐচ্ছিক। ইমেজ সার্চ থেকে গ্রাউন্ডিং চাঙ্ক।

retrievedContext object ( RetrievedContext )

ঐচ্ছিক। ফাইল সার্চ টুল দ্বারা প্রাপ্ত কনটেক্সট থেকে চাঙ্ক গ্রাউন্ডিং করা।

maps object ( Maps )

ঐচ্ছিক। গুগল ম্যাপস থেকে গ্রাউন্ডিং চাঙ্ক।

JSON উপস্থাপনা
{

  // chunk_type
  "web": {
    object (Web)
  },
  "image": {
    object (Image)
  },
  "retrievedContext": {
    object (RetrievedContext)
  },
  "maps": {
    object (Maps)
  }
  // Union type
}

ওয়েব

ওয়েব থেকে নেওয়া অংশ।

ক্ষেত্র
uri string

শুধুমাত্র আউটপুট। চাঙ্কটির URI রেফারেন্স।

title string

শুধুমাত্র আউটপুট। ডেটা খণ্ডের শিরোনাম।

JSON উপস্থাপনা
{
  "uri": string,
  "title": string
}

ছবি

ইমেজ সার্চ থেকে প্রাপ্ত অংশ।

ক্ষেত্র
sourceUri string

কৃতিত্ব প্রদানের জন্য ওয়েব পেজের ইউআরআই।

imageUri string

ইমেজ অ্যাসেট ইউআরএল।

title string

যে ওয়েব পেজটি থেকে ছবিটি নেওয়া হয়েছে, তার শিরোনাম।

domain string

যে ওয়েব পেজটি থেকে ছবিটি নেওয়া হয়েছে, তার রুট ডোমেইন, যেমন 'example.com'।

JSON উপস্থাপনা
{
  "sourceUri": string,
  "imageUri": string,
  "title": string,
  "domain": string
}

পুনরুদ্ধারকৃত প্রসঙ্গ

ফাইল সার্চ টুল দ্বারা প্রাপ্ত কনটেক্সটের অংশবিশেষ।

ক্ষেত্র
customMetadata[] object ( CustomMetadata )

ঐচ্ছিক। সংগৃহীত কনটেক্সট সম্পর্কিত ব্যবহারকারী-প্রদত্ত মেটাডেটা।

uri string

ঐচ্ছিক। শব্দার্থগত পুনরুদ্ধার নথির URI রেফারেন্স।

title string

ঐচ্ছিক। নথির শিরোনাম।

text string

ঐচ্ছিক। অংশবিশেষের পাঠ্য।

fileSearchStore string

ঐচ্ছিক। যে FileSearchStore ডকুমেন্টটি রয়েছে তার নাম। উদাহরণ: fileSearchStores/123

pageNumber integer

ঐচ্ছিক। প্রাপ্ত কনটেক্সটের পৃষ্ঠা নম্বর, যদি প্রযোজ্য হয়।

mediaId string

ঐচ্ছিক। মাল্টিমোডাল ফাইল অনুসন্ধানের ফলাফলের জন্য মিডিয়া ব্লব রিসোর্সের নাম। ফরম্যাট: fileSearchStores/{file_search_store_id}/media/{blobId}

JSON উপস্থাপনা
{
  "customMetadata": [
    {
      object (CustomMetadata)
    }
  ],
  "uri": string,
  "title": string,
  "text": string,
  "fileSearchStore": string,
  "pageNumber": integer,
  "mediaId": string
}

কাস্টম মেটাডেটা

ব্যবহারকারী গ্রাউন্ডিংফ্যাক্ট সম্পর্কে মেটাডেটা প্রদান করেছেন।

ক্ষেত্র
key string

মেটাডেটার চাবি।

value Union type
মেটাডেটার মান। এটি একটি স্ট্রিং, স্ট্রিং-এর তালিকা বা একটি সংখ্যা হতে পারে। value নিম্নলিখিতগুলির মধ্যে কেবল একটি হতে পারে:
stringValue string

ঐচ্ছিক। মেটাডেটার স্ট্রিং মান।

stringListValue object ( StringList )

ঐচ্ছিক। মেটাডেটার জন্য স্ট্রিং মানগুলির একটি তালিকা।

numericValue number

ঐচ্ছিক। মেটাডেটার সাংখ্যিক মান। এই মানের প্রত্যাশিত পরিসীমা ব্যবহৃত নির্দিষ্ট key উপর নির্ভর করে।

JSON উপস্থাপনা
{
  "key": string,

  // value
  "stringValue": string,
  "stringListValue": {
    object (StringList)
  },
  "numericValue": number
  // Union type
}

স্ট্রিংলিস্ট

স্ট্রিং মানগুলির একটি তালিকা।

ক্ষেত্র
values[] string

তালিকার স্ট্রিং মানগুলো।

JSON উপস্থাপনা
{
  "values": [
    string
  ]
}

মানচিত্র

গুগল ম্যাপসের একটি গ্রাউন্ডিং চাঙ্ক। একটি ম্যাপস চাঙ্ক একটি একক স্থানকে নির্দেশ করে।

ক্ষেত্র
uri string

স্থানটির URI রেফারেন্স।

title string

স্থানটির নাম।

text string

স্থানটির উত্তরের পাঠ্য বিবরণ।

placeId string

স্থানটির আইডি, যা places/{placeId} ফরম্যাটে থাকে। একজন ব্যবহারকারী এই আইডি ব্যবহার করে সেই স্থানটি খুঁজে বের করতে পারেন।

placeAnswerSources object ( PlaceAnswerSources )

গুগল ম্যাপসে কোনো নির্দিষ্ট স্থানের বৈশিষ্ট্য সম্পর্কে উত্তর প্রদানকারী উৎসসমূহ।

JSON উপস্থাপনা
{
  "uri": string,
  "title": string,
  "text": string,
  "placeId": string,
  "placeAnswerSources": {
    object (PlaceAnswerSources)
  }
}

PlaceAnswerSources

গুগল ম্যাপসের কোনো নির্দিষ্ট স্থানের বৈশিষ্ট্য সম্পর্কে উত্তর প্রদানকারী উৎসসমূহের একটি সংগ্রহ। প্রতিটি PlaceAnswerSources বার্তা গুগল ম্যাপসের একটি নির্দিষ্ট স্থানের সাথে সম্পর্কিত। গুগল ম্যাপস টুলটি সেই স্থানের বৈশিষ্ট্য সম্পর্কিত প্রশ্নের উত্তর দেওয়ার জন্য এই উৎসগুলো ব্যবহার করে (যেমন: "বার ফু-তে কি ওয়াইফাই আছে?" অথবা "ফু বার কি হুইলচেয়ার ব্যবহারকারীদের জন্য প্রবেশযোগ্য?")। বর্তমানে আমরা উৎস হিসেবে শুধুমাত্র রিভিউ স্নিপেট সমর্থন করি।

ক্ষেত্র
reviewSnippets[] object ( ReviewSnippet )

গুগল ম্যাপসে কোনো নির্দিষ্ট স্থানের বৈশিষ্ট্য সম্পর্কে উত্তর তৈরি করতে ব্যবহৃত পর্যালোচনার অংশবিশেষ।

JSON উপস্থাপনা
{
  "reviewSnippets": [
    {
      object (ReviewSnippet)
    }
  ]
}

রিভিউস্নিপেট

গুগল ম্যাপসের কোনো নির্দিষ্ট স্থানের বৈশিষ্ট্য সম্পর্কে একটি প্রশ্নের উত্তর দেয় এমন ব্যবহারকারী পর্যালোচনার একটি অংশ এখানে তুলে ধরা হয়েছে।

ক্ষেত্র
reviewId string

রিভিউ স্নিপেটটির আইডি।

googleMapsUri string

গুগল ম্যাপস-এ ব্যবহারকারীর পর্যালোচনার সাথে সম্পর্কিত একটি লিঙ্ক।

title string

পর্যালোচনার শিরোনাম।

JSON উপস্থাপনা
{
  "reviewId": string,
  "googleMapsUri": string,
  "title": string
}

গ্রাউন্ডিং সাপোর্ট

গ্রাউন্ডিং সাপোর্ট।

ক্ষেত্র
groundingChunkIndices[] integer

ঐচ্ছিক। দাবির সাথে সম্পর্কিত উদ্ধৃতিগুলি নির্দিষ্ট করে এমন সূচকগুলির একটি তালিকা ( response.candidate.grounding_metadata এর 'grounding_chunk'-এ)। উদাহরণস্বরূপ, [1,3,4] এর অর্থ হল grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] হল দাবির জন্য নির্ধারিত পুনরুদ্ধার করা বিষয়বস্তু। যদি প্রতিক্রিয়াটি স্ট্রিমিং হয়, তাহলে groundingChunkIndices সমস্ত প্রতিক্রিয়া জুড়ে সূচকগুলিকে নির্দেশ করে। সমস্ত প্রতিক্রিয়া থেকে গ্রাউন্ডিং চাঙ্কগুলি (একই ক্রম বজায় রেখে) একত্রিত করা ক্লায়েন্টের দায়িত্ব।

confidenceScores[] number

ঐচ্ছিক। সাপোর্ট রেফারেন্সগুলোর নির্ভরযোগ্যতার স্কোর। এর সীমা ০ থেকে ১। ১ হলো সর্বোচ্চ নির্ভরযোগ্য। এই তালিকার আকার অবশ্যই groundingChunkIndices-এর সমান হতে হবে।

renderedParts[] integer

শুধুমাত্র আউটপুট। ক্যান্ডিডেটের কন্টেন্টের parts ফিল্ডের ইনডেক্সসমূহ। এই ইনডেক্সগুলো নির্দিষ্ট করে দেয় যে কোন রেন্ডার করা পার্টগুলো এই সাপোর্ট সোর্সের সাথে যুক্ত।

segment object ( Segment )

বিষয়বস্তুর যে অংশের সাথে এই সমর্থনটি সম্পর্কিত।

JSON উপস্থাপনা
{
  "groundingChunkIndices": [
    integer
  ],
  "confidenceScores": [
    number
  ],
  "renderedParts": [
    integer
  ],
  "segment": {
    object (Segment)
  }
}

সেগমেন্ট

বিষয়বস্তুর অংশ।

ক্ষেত্র
partIndex integer

কোনো প্যারেন্ট Content অবজেক্টের মধ্যে থাকা Part অবজেক্টের ইন্ডেক্স।

startIndex integer

প্রদত্ত পার্টের প্রারম্ভিক সূচক, যা বাইটে পরিমাপ করা হয়। পার্টের শুরু থেকে অফসেট, যা শূন্য থেকে শুরু হয় এবং শূন্য সহ গণনা করা হয়।

endIndex integer

প্রদত্ত পার্টের শেষ সূচক, যা বাইটে পরিমাপ করা হয়। পার্টের শুরু থেকে অফসেট, যা শূন্য থেকে শুরু হয় এবং এতে কোনো বাইটের প্রয়োজন হয় না।

text string

প্রতিক্রিয়া থেকে প্রাপ্ত অংশটির সাথে সম্পর্কিত পাঠ্য।

JSON উপস্থাপনা
{
  "partIndex": integer,
  "startIndex": integer,
  "endIndex": integer,
  "text": string
}

পুনরুদ্ধার মেটাডেটা

গ্রাউন্ডিং ফ্লোতে পুনরুদ্ধার সম্পর্কিত মেটাডেটা।

ক্ষেত্র
googleSearchDynamicRetrievalScore number

ঐচ্ছিক। এই স্কোরটি নির্দেশ করে যে, গুগল সার্চ থেকে প্রাপ্ত তথ্য প্রশ্নটির উত্তর দিতে কতটা সাহায্য করতে পারে। স্কোরটির পরিসর [0, 1], যেখানে 0 হলো সর্বনিম্ন সম্ভাবনা এবং 1 হলো সর্বোচ্চ সম্ভাবনা। এই স্কোরটি শুধুমাত্র তখনই প্রদর্শিত হয় যখন গুগল সার্চ গ্রাউন্ডিং এবং ডাইনামিক রিট্রিভাল সক্রিয় থাকে। গুগল সার্চ চালু করা হবে কিনা তা নির্ধারণ করতে এটিকে থ্রেশহোল্ডের সাথে তুলনা করা হবে।

JSON উপস্থাপনা
{
  "googleSearchDynamicRetrievalScore": number
}

লগপ্রবসরেজাল্ট

লগপ্রবস ফলাফল

ক্ষেত্র
topCandidates[] object ( TopCandidates )

দৈর্ঘ্য = ডিকোডিং ধাপের মোট সংখ্যা।

chosenCandidates[] object ( Candidate )

দৈর্ঘ্য = ডিকোডিং ধাপের মোট সংখ্যা। নির্বাচিত প্রার্থীরা শীর্ষ প্রার্থীদের তালিকায় থাকতেও পারেন, আবার নাও থাকতে পারেন।

logProbabilitySum number

সমস্ত টোকেনের লগ সম্ভাবনার যোগফল।

JSON উপস্থাপনা
{
  "topCandidates": [
    {
      object (TopCandidates)
    }
  ],
  "chosenCandidates": [
    {
      object (Candidate)
    }
  ],
  "logProbabilitySum": number
}

শীর্ষ প্রার্থীরা

প্রতিটি ডিকোডিং ধাপে সর্বোচ্চ লগ সম্ভাবনাসম্পন্ন প্রার্থীগণ।

ক্ষেত্র
candidates[] object ( Candidate )

লগ সম্ভাব্যতা অনুসারে অবরোহী ক্রমে সাজানো।

JSON উপস্থাপনা
{
  "candidates": [
    {
      object (Candidate)
    }
  ]
}

প্রার্থী

logprobs টোকেন এবং স্কোরের জন্য প্রার্থী।

ক্ষেত্র
token string

প্রার্থীর টোকেন স্ট্রিং মান।

tokenId integer

প্রার্থীর টোকেন আইডি মান।

logProbability number

প্রার্থীর লগ সম্ভাবনা।

JSON উপস্থাপনা
{
  "token": string,
  "tokenId": integer,
  "logProbability": number
}

ইউআরএলকনটেক্সটমেটাডেটা

ইউআরএল কনটেক্সট পুনরুদ্ধার টুল সম্পর্কিত মেটাডেটা।

ক্ষেত্র
urlMetadata[] object ( UrlMetadata )

ইউআরএল কনটেক্সটের তালিকা।

JSON উপস্থাপনা
{
  "urlMetadata": [
    {
      object (UrlMetadata)
    }
  ]
}

ইউআরএলমেটাডেটা

একটিমাত্র ইউআরএল পুনরুদ্ধারের প্রেক্ষাপট।

ক্ষেত্র
retrievedUrl string

টুলটির মাধ্যমে ইউআরএলটি সংগ্রহ করা হয়েছে।

urlRetrievalStatus enum ( UrlRetrievalStatus )

ইউআরএল পুনরুদ্ধারের অবস্থা।

JSON উপস্থাপনা
{
  "retrievedUrl": string,
  "urlRetrievalStatus": enum (UrlRetrievalStatus)
}

ইউআরএল পুনরুদ্ধার স্থিতি

ইউআরএল পুনরুদ্ধারের অবস্থা।

এনাম
URL_RETRIEVAL_STATUS_UNSPECIFIED ডিফল্ট মান। এই মানটি ব্যবহৃত হয় না।
URL_RETRIEVAL_STATUS_SUCCESS ইউআরএল পুনরুদ্ধার সফল হয়েছে।
URL_RETRIEVAL_STATUS_ERROR ত্রুটির কারণে ইউআরএল পুনরুদ্ধার করা সম্ভব হয়নি।
URL_RETRIEVAL_STATUS_PAYWALL কন্টেন্টটি পেওয়ালের আড়ালে থাকায় ইউআরএল পুনরুদ্ধার করা সম্ভব হয়নি।
URL_RETRIEVAL_STATUS_UNSAFE বিষয়বস্তু অনিরাপদ হওয়ায় ইউআরএল পুনরুদ্ধার করা সম্ভব হয়নি।

উদ্ধৃতি মেটাডেটা

কোনো একটি বিষয়বস্তুর উৎস উল্লেখসমূহের সংকলন।

ক্ষেত্র
citationSources[] object ( CitationSource )

একটি নির্দিষ্ট উত্তরের জন্য উৎসের উদ্ধৃতি।

JSON উপস্থাপনা
{
  "citationSources": [
    {
      object (CitationSource)
    }
  ]
}

উদ্ধৃতি উৎস

কোনো নির্দিষ্ট উত্তরের অংশের উৎসের উদ্ধৃতি।

ক্ষেত্র
startIndex integer

ঐচ্ছিক। প্রতিক্রিয়ার যে অংশটি এই উৎসের বলে গণ্য করা হবে, তার শুরু।

ইনডেক্স সেগমেন্টের শুরু নির্দেশ করে, যা বাইটে পরিমাপ করা হয়।

endIndex integer

ঐচ্ছিক। আরোপিত অংশের শেষ, স্বতন্ত্র।

uri string

ঐচ্ছিক। URI যা পাঠ্যের কোনো অংশের উৎস হিসেবে ব্যবহৃত হয়।

license string

ঐচ্ছিক। সেগমেন্টের উৎস হিসেবে ব্যবহৃত গিটহাব প্রজেক্টের লাইসেন্স।

কোড উদ্ধৃতির জন্য লাইসেন্সের তথ্য প্রয়োজন।

JSON উপস্থাপনা
{
  "startIndex": integer,
  "endIndex": integer,
  "uri": string,
  "license": string
}

ক্ষতি বিভাগ

ব্যবহারকারীর ইনপুট এবং মডেলের প্রতিক্রিয়া থেকে যে ধরনের ক্ষতি শনাক্ত করা যায়।

এনাম
HARM_CATEGORY_UNSPECIFIED ডিফল্ট মান। এই মানটি ব্যবহৃত হয় না।
HARM_CATEGORY_HATE_SPEECH এমন বিষয়বস্তু যা নির্দিষ্ট বৈশিষ্ট্যের ভিত্তিতে কোনো ব্যক্তি বা গোষ্ঠীর বিরুদ্ধে সহিংসতাকে উৎসাহিত করে বা ঘৃণা উস্কে দেয়।
HARM_CATEGORY_DANGEROUS_CONTENT এমন বিষয়বস্তু যা বিপজ্জনক কার্যকলাপকে উৎসাহিত করে, সহজতর করে বা সক্ষম করে তোলে।
HARM_CATEGORY_HARASSMENT অপমানজনক, হুমকিমূলক, অথবা উৎপীড়ন, নির্যাতন বা উপহাস করার উদ্দেশ্যে তৈরি বিষয়বস্তু।
HARM_CATEGORY_SEXUALLY_EXPLICIT যেসব বিষয়বস্তুতে যৌনতাপূর্ণ উপাদান রয়েছে।
HARM_CATEGORY_CIVIC_INTEGRITY

অপ্রচলিত: নির্বাচন ফিল্টার আর সমর্থিত নয়। ক্ষতির বিভাগটি হলো নাগরিক অখণ্ডতা।

HARM_CATEGORY_IMAGE_HATE বিদ্বেষমূলক বক্তব্য সম্বলিত ছবি।
HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT যেসব ছবিতে বিপজ্জনক বিষয়বস্তু রয়েছে।
HARM_CATEGORY_IMAGE_HARASSMENT যেসব ছবিতে হয়রানি রয়েছে।
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT যেসব ছবিতে যৌন উত্তেজক বিষয়বস্তু রয়েছে।
HARM_CATEGORY_JAILBREAK সুরক্ষা ফিল্টার এড়িয়ে যাওয়ার জন্য ডিজাইন করা প্রম্পট।

ModalityTokenCount

একটিমাত্র মোডালিটির জন্য টোকেন গণনার তথ্য উপস্থাপন করে।

ক্ষেত্র
modality enum ( Modality )

এই টোকেন সংখ্যার সাথে সংশ্লিষ্ট পদ্ধতি।

tokenCount integer

টোকেনের সংখ্যা।

JSON উপস্থাপনা
{
  "modality": enum (Modality),
  "tokenCount": integer
}

পদ্ধতি

বিষয়বস্তু অংশ পদ্ধতি

এনাম
MODALITY_UNSPECIFIED অনির্দিষ্ট পদ্ধতি।
TEXT সাধারণ লেখা।
IMAGE ছবি।
VIDEO ভিডিও।
AUDIO অডিও।
DOCUMENT নথি, যেমন পিডিএফ।

নিরাপত্তা রেটিং

কোনো একটি কন্টেন্টের নিরাপত্তা রেটিং।

নিরাপত্তা রেটিং-এ কোনো একটি কন্টেন্টের জন্য ক্ষতির বিভাগ এবং সেই বিভাগে ক্ষতির সম্ভাবনার মাত্রা অন্তর্ভুক্ত থাকে। কন্টেন্টকে বিভিন্ন ক্ষতির বিভাগের ভিত্তিতে নিরাপত্তার জন্য শ্রেণিবদ্ধ করা হয় এবং ক্ষতির শ্রেণিবিভাগের সম্ভাবনাও এখানে অন্তর্ভুক্ত থাকে।

ক্ষেত্র
category enum ( HarmCategory )

আবশ্যক। এই রেটিংয়ের জন্য বিভাগ।

probability enum ( HarmProbability )

প্রয়োজনীয়। এই বিষয়বস্তুর জন্য ক্ষতির সম্ভাবনা।

blocked boolean

এই রেটিংটির কারণে কি এই কন্টেন্টটি ব্লক করা হয়েছিল?

JSON উপস্থাপনা
{
  "category": enum (HarmCategory),
  "probability": enum (HarmProbability),
  "blocked": boolean
}

ক্ষতির সম্ভাবনা

কোনো একটি বিষয়বস্তু ক্ষতিকর হওয়ার সম্ভাবনা।

শ্রেণিবিন্যাস পদ্ধতিটি কোনো বিষয়বস্তু অনিরাপদ হওয়ার সম্ভাবনা নির্দেশ করে। এটি কোনো বিষয়বস্তুর ক্ষতির তীব্রতা নির্দেশ করে না।

এনাম
HARM_PROBABILITY_UNSPECIFIED সম্ভাবনা অনির্দিষ্ট।
NEGLIGIBLE বিষয়বস্তু অনিরাপদ হওয়ার সম্ভাবনা নগণ্য।
LOW বিষয়বস্তু অনিরাপদ হওয়ার সম্ভাবনা কম।
MEDIUM বিষয়বস্তুটি অনিরাপদ হওয়ার মাঝারি সম্ভাবনা রয়েছে।
HIGH বিষয়বস্তুটি অনিরাপদ হওয়ার প্রবল সম্ভাবনা রয়েছে।

নিরাপত্তা সেটিং

নিরাপত্তা সেটিং, যা নিরাপত্তা-অবরোধকারী আচরণকে প্রভাবিত করে।

কোনো ক্যাটাগরির জন্য সুরক্ষা সেটিং সেট করলে, কন্টেন্ট ব্লক হওয়ার অনুমোদিত সম্ভাবনা পরিবর্তিত হয়।

ক্ষেত্র
category enum ( HarmCategory )

আবশ্যক। এই সেটিংয়ের জন্য বিভাগ।

threshold enum ( HarmBlockThreshold )

প্রয়োজনীয়। যে সম্ভাব্যতা সীমায় ক্ষতি প্রতিরোধ করা হয়, তা নিয়ন্ত্রণ করে।

JSON উপস্থাপনা
{
  "category": enum (HarmCategory),
  "threshold": enum (HarmBlockThreshold)
}

ক্ষতি প্রতিরোধের সীমা

একটি নির্দিষ্ট ক্ষতির সম্ভাবনার পর্যায়ে এবং তার পরেও বাধা সৃষ্টি করুন।

এনাম
HARM_BLOCK_THRESHOLD_UNSPECIFIED থ্রেশহোল্ড অনির্দিষ্ট।
BLOCK_LOW_AND_ABOVE নগণ্য বিষয়বস্তু অনুমোদিত হবে।
BLOCK_MEDIUM_AND_ABOVE নগণ্য এবং নিম্ন মানের বিষয়বস্তু অনুমোদিত হবে।
BLOCK_ONLY_HIGH নগণ্য, নিম্ন এবং মাঝারি মানের বিষয়বস্তু অনুমোদিত হবে।
BLOCK_NONE সকল বিষয়বস্তু অনুমোদিত হবে।
OFF সুরক্ষা ফিল্টারটি বন্ধ করুন।

সার্ভিসটিয়ার

মিথস্ক্রিয়ার পরিষেবা স্তর।

এনাম
SERVICE_TIER_UNSPECIFIED ডিফল্ট পরিষেবা স্তর, যা প্রমিত।
SERVICE_TIER_FLEX নমনীয় পরিষেবা স্তর।
SERVICE_TIER_STANDARD সাধারণ পরিষেবা স্তর।
SERVICE_TIER_PRIORITY অগ্রাধিকার পরিষেবা স্তর।

অনুমোদিত সরঞ্জাম

অনুমোদিত টুলগুলির জন্য কনফিগারেশন।

ক্ষেত্র
mode enum ( ToolChoiceType )

সরঞ্জাম নির্বাচনের ধরণ।

tools[] string

অনুমোদিত সরঞ্জামগুলোর নাম।

JSON উপস্থাপনা
{
  "mode": enum (ToolChoiceType),
  "tools": [
    string
  ]
}

টীকা

মডেল-সৃষ্ট কন্টেন্টের জন্য উদ্ধৃতি তথ্য।

ক্ষেত্র
startIndex integer

প্রতিক্রিয়ার যে অংশটি এই উৎসের বলে গণ্য করা হয়েছে, তার শুরু।

ইনডেক্স সেগমেন্টের শুরু নির্দেশ করে, যা বাইটে পরিমাপ করা হয়।

endIndex integer

আরোপিত অংশের সমাপ্তি, স্বতন্ত্র।

Union type type
অ্যানোটেশনের ধরণ। type নিম্নলিখিতগুলির মধ্যে কেবল একটি হতে পারে:
urlCitation object ( UrlCitation )

ইউআরএল উদ্ধৃতি টীকা।

fileCitation object ( FileCitation )

ফাইল উদ্ধৃতি টীকা।

placeCitation object ( PlaceCitation )

স্থান উদ্ধৃতি টীকা।

JSON উপস্থাপনা
{
  "startIndex": integer,
  "endIndex": integer,

  // type
  "urlCitation": {
    object (UrlCitation)
  },
  "fileCitation": {
    object (FileCitation)
  },
  "placeCitation": {
    object (PlaceCitation)
  }
  // Union type
}

ইউআরএল উদ্ধৃতি

ইউআরএল উদ্ধৃতি টীকা।

ক্ষেত্র
url string

ইউআরএল।

title string

ইউআরএল-এর শিরোনাম।

JSON উপস্থাপনা
{
  "url": string,
  "title": string
}

ফাইল উদ্ধৃতি

ফাইল উদ্ধৃতি টীকা।

ক্ষেত্র
documentUri string

ফাইলটির URI।

fileName string

ফাইলটির নাম।

source string

পাঠ্যের একটি অংশের উৎস উল্লেখ করা হয়েছে।

customMetadata object ( Struct )

ব্যবহারকারী সংগৃহীত কনটেক্সট সম্পর্কে মেটাডেটা প্রদান করেছেন।

pageNumber integer

উদ্ধৃত নথির পৃষ্ঠা নম্বর, যদি প্রযোজ্য হয়।

mediaId string

ছবির উদ্ধৃতির ক্ষেত্রে, প্রযোজ্য হলে মিডিয়া আইডি।

JSON উপস্থাপনা
{
  "documentUri": string,
  "fileName": string,
  "source": string,
  "customMetadata": {
    object (Struct)
  },
  "pageNumber": integer,
  "mediaId": string
}

স্থান উদ্ধৃতি

স্থান উদ্ধৃতি টীকা।

ক্ষেত্র
placeId string

স্থানটির আইডি, places/{placeId} ফরম্যাটে।

name string

স্থানটির নাম।

url string

স্থানটির URI রেফারেন্স।

reviewSnippets[] object ( ReviewSnippet )

গুগল ম্যাপসে কোনো নির্দিষ্ট স্থানের বৈশিষ্ট্য সম্পর্কে উত্তর তৈরি করতে ব্যবহৃত পর্যালোচনার অংশবিশেষ।

JSON উপস্থাপনা
{
  "placeId": string,
  "name": string,
  "url": string,
  "reviewSnippets": [
    {
      object (ReviewSnippet)
    }
  ]
}

অ্যাস্পেক্ট রেশিও

ইমেজ আউটপুটের জন্য সমর্থিত অ্যাস্পেক্ট রেশিও।

এনাম
ASPECT_RATIO_UNSPECIFIED ডিফল্ট মান। এই মানটি ব্যবহৃত হয় না।
ASPECT_RATIO_ONE_BY_ONE ১:১ আকৃতির অনুপাত।
ASPECT_RATIO_TWO_BY_THREE ২:৩ আকৃতি অনুপাত।
ASPECT_RATIO_THREE_BY_TWO ৩:২ আকৃতি অনুপাত।
ASPECT_RATIO_THREE_BY_FOUR ৩:৪ আকৃতি অনুপাত।
ASPECT_RATIO_FOUR_BY_THREE ৪:৩ আকৃতি অনুপাত।
ASPECT_RATIO_FOUR_BY_FIVE ৪:৫ আকৃতি অনুপাত।
ASPECT_RATIO_FIVE_BY_FOUR ৫:৪ আকৃতি অনুপাত।
ASPECT_RATIO_NINE_BY_SIXTEEN ৯:১৬ আকৃতির অনুপাত।
ASPECT_RATIO_SIXTEEN_BY_NINE ১৬:৯ আকৃতি অনুপাত।
ASPECT_RATIO_TWENTY_ONE_BY_NINE ২১:৯ আকৃতি অনুপাত।
ASPECT_RATIO_ONE_BY_EIGHT ১:৮ আকৃতি অনুপাত।
ASPECT_RATIO_EIGHT_BY_ONE ৮:১ আকৃতির অনুপাত।
ASPECT_RATIO_ONE_BY_FOUR ১:৪ আকৃতি অনুপাত।
ASPECT_RATIO_FOUR_BY_ONE ৪:১ আকৃতি অনুপাত।

অডিও প্রতিক্রিয়া বিন্যাস

অডিও আউটপুট ফরম্যাটের জন্য কনফিগারেশন।

ক্ষেত্র
mimeType enum ( MimeType )

অডিও আউটপুটের MIME টাইপ।

delivery enum ( Delivery )

অডিও আউটপুটের ডেলিভারি মোড।

sampleRate integer

স্যাম্পল রেট (হার্টজ এককে)।

bitRate integer

বিট রেট, বিটস পার সেকেন্ড (bps) এককে। শুধুমাত্র কম্প্রেসড ফরম্যাটের (MP3, Opus) জন্য প্রযোজ্য।

JSON উপস্থাপনা
{
  "mimeType": enum (MimeType),
  "delivery": enum (Delivery),
  "sampleRate": integer,
  "bitRate": integer
}

কোডএক্সিকিউশন

এই প্রকারে কোনো ক্ষেত্র নেই।

এমন একটি টুল যা মডেল কোড কার্যকর করার জন্য ব্যবহার করতে পারে।

কোডএক্সিকিউশনকলস্টেপ

কোড এক্সিকিউশন কল ধাপ।

ক্ষেত্র
arguments object ( CodeExecutionCallStepArguments )

প্রয়োজনীয়। কোড নির্বাহের জন্য আর্গুমেন্টসমূহ প্রদান করতে হবে।

JSON উপস্থাপনা
{
  "arguments": {
    object (CodeExecutionCallStepArguments)
  }
}

কোডএক্সিকিউশনকলস্টেপআর্গুমেন্টস

কোড নির্বাহের জন্য আর্গুমেন্টগুলো প্রেরণ করতে হবে।

ক্ষেত্র
language enum ( Language )

code প্রোগ্রামিং ভাষা।

code string

যে কোডটি কার্যকর করা হবে।

JSON উপস্থাপনা
{
  "language": enum (Language),
  "code": string
}

কোডএক্সিকিউশনরেজাল্টস্টেপ

কোড নির্বাহের ফলাফল ধাপ।

ক্ষেত্র
result string

Required. The output of the code execution.

isError boolean

Whether the code execution resulted in an error.

JSON উপস্থাপনা
{
  "result": string,
  "isError": boolean
}

ComputerUse

A tool that can be used by the model to interact with the computer.

ক্ষেত্র
environment enum ( Environment )

The environment being operated.

excludedPredefinedFunctions[] string

The list of predefined functions that are excluded from the model call.

enablePromptInjectionDetection boolean

Whether enable the prompt injection detection check on computer-use request.

disabledSafetyPolicies[] enum ( SafetyPolicy )

Optional. Disabled safety policies for computer use.

JSON উপস্থাপনা
{
  "environment": enum (Environment),
  "excludedPredefinedFunctions": [
    string
  ],
  "enablePromptInjectionDetection": boolean,
  "disabledSafetyPolicies": [
    enum (SafetyPolicy)
  ]
}

বিষয়বস্তু

The content of the response.

ক্ষেত্র
type Union type
type can be only one of the following:
text object ( TextContent )
image object ( ImageContent )
audio object ( AudioContent )
document object ( DocumentContent )
video object ( VideoContent )
thought
(deprecated)
object ( ThoughtContent )
toolCall
(deprecated)
object ( ToolCallContent )
toolResult
(deprecated)
object ( ToolResultContent )
JSON উপস্থাপনা
{

  // type
  "text": {
    object (TextContent)
  },
  "image": {
    object (ImageContent)
  },
  "audio": {
    object (AudioContent)
  },
  "document": {
    object (DocumentContent)
  },
  "video": {
    object (VideoContent)
  },
  "thought": {
    object (ThoughtContent)
  },
  "toolCall": {
    object (ToolCallContent)
  },
  "toolResult": {
    object (ToolResultContent)
  }
  // Union type
}

TextContent

A text content block.

ক্ষেত্র
text string

Required. The text content.

annotations[] object ( Annotation )

Citation information for model-generated content.

JSON উপস্থাপনা
{
  "text": string,
  "annotations": [
    {
      object (Annotation)
    }
  ]
}

ImageContent

An image content block.

ক্ষেত্র
mimeType enum ( MimeType )

The mime type of the image.

resolution enum ( MediaResolution )

The resolution of the media.

data_or_uri Union type
The image content. data_or_uri can be only one of the following:
data string ( bytes format)

The image content.

A base64-encoded string.

uri string

The URI of the image.

JSON উপস্থাপনা
{
  "mimeType": enum (MimeType),
  "resolution": enum (MediaResolution),

  // data_or_uri
  "data": string,
  "uri": string
  // Union type
}

AudioContent

An audio content block.

ক্ষেত্র
mimeType enum ( MimeType )

The mime type of the audio.

channels integer

The number of audio channels.

sampleRate integer

The sample rate of the audio.

data_or_uri Union type
The audio content. data_or_uri can be only one of the following:
data string ( bytes format)

The audio content.

A base64-encoded string.

uri string

The URI of the audio.

JSON উপস্থাপনা
{
  "mimeType": enum (MimeType),
  "channels": integer,
  "sampleRate": integer,

  // data_or_uri
  "data": string,
  "uri": string
  // Union type
}

ডকুমেন্টের বিষয়বস্তু

A document content block.

ক্ষেত্র
mimeType enum ( MimeType )

The mime type of the document.

data_or_uri Union type
The document content. data_or_uri can be only one of the following:
data string ( bytes format)

The document content.

A base64-encoded string.

uri string

The URI of the document.

JSON উপস্থাপনা
{
  "mimeType": enum (MimeType),

  // data_or_uri
  "data": string,
  "uri": string
  // Union type
}

VideoContent

A video content block.

ক্ষেত্র
mimeType enum ( MimeType )

The mime type of the video.

resolution enum ( MediaResolution )

The resolution of the media.

data_or_uri Union type
The video content. data_or_uri can be only one of the following:
data string ( bytes format)

The video content.

A base64-encoded string.

uri string

The URI of the video.

JSON উপস্থাপনা
{
  "mimeType": enum (MimeType),
  "resolution": enum (MediaResolution),

  // data_or_uri
  "data": string,
  "uri": string
  // Union type
}

ThoughtContent

A thought content block.

ক্ষেত্র
signature string ( bytes format)

Signature to match the backend source to be part of the generation.

A base64-encoded string.

summary[] object ( ThoughtSummaryContent )

A summary of the thought.

JSON উপস্থাপনা
{
  "signature": string,
  "summary": [
    {
      object (ThoughtSummaryContent)
    }
  ]
}

ThoughtSummaryContent

ক্ষেত্র
type Union type
type can be only one of the following:
text object ( TextContent )
image object ( ImageContent )
JSON উপস্থাপনা
{

  // type
  "text": {
    object (TextContent)
  },
  "image": {
    object (ImageContent)
  }
  // Union type
}

ToolCallContent

Tool call content.

ক্ষেত্র
id string

Required. A unique ID for this specific tool call.

signature string ( bytes format)

A signature hash for backend validation.

A base64-encoded string.

type Union type
type can be only one of the following:
functionCall object ( FunctionCallContent )
codeExecutionCall object ( CodeExecutionCallContent )
urlContextCall object ( UrlContextCallContent )
mcpServerToolCall object ( McpServerToolCallContent )
googleSearchCall object ( GoogleSearchCallContent )
fileSearchCall object ( FileSearchCallContent )
googleMapsCall object ( GoogleMapsCallContent )
JSON উপস্থাপনা
{
  "id": string,
  "signature": string,

  // type
  "functionCall": {
    object (FunctionCallContent)
  },
  "codeExecutionCall": {
    object (CodeExecutionCallContent)
  },
  "urlContextCall": {
    object (UrlContextCallContent)
  },
  "mcpServerToolCall": {
    object (McpServerToolCallContent)
  },
  "googleSearchCall": {
    object (GoogleSearchCallContent)
  },
  "fileSearchCall": {
    object (FileSearchCallContent)
  },
  "googleMapsCall": {
    object (GoogleMapsCallContent)
  }
  // Union type
}

ফাংশনকলকন্টেন্ট

A function tool call content block.

ক্ষেত্র
name string

Required. The name of the tool to call.

arguments object ( Struct )

Required. The arguments to pass to the function.

JSON উপস্থাপনা
{
  "name": string,
  "arguments": {
    object (Struct)
  }
}

CodeExecutionCallContent

Code execution content.

ক্ষেত্র
arguments object ( CodeExecutionCallArguments )

Required. The arguments to pass to the code execution.

JSON উপস্থাপনা
{
  "arguments": {
    object (CodeExecutionCallArguments)
  }
}

কোডএক্সিকিউশনকলআর্গুমেন্টস

The arguments to pass to the code execution.

ক্ষেত্র
language enum ( Language )

Programming language of the code .

code string

The code to be executed.

JSON উপস্থাপনা
{
  "language": enum (Language),
  "code": string
}

UrlContextCallContent

URL context content.

ক্ষেত্র
arguments object ( UrlContextCallArguments )

Required. The arguments to pass to the URL context.

JSON উপস্থাপনা
{
  "arguments": {
    object (UrlContextCallArguments)
  }
}

UrlContextCallArguments

The arguments to pass to the URL context.

ক্ষেত্র
urls[] string

The URLs to fetch.

JSON উপস্থাপনা
{
  "urls": [
    string
  ]
}

McpServerToolCallContent

MCPServer tool call content.

ক্ষেত্র
name string

Required. The name of the tool which was called.

serverName string

Required. The name of the used MCP server.

arguments object ( Struct )

Required. The JSON object of arguments for the function.

JSON উপস্থাপনা
{
  "name": string,
  "serverName": string,
  "arguments": {
    object (Struct)
  }
}

GoogleSearchCallContent

Google Search content.

ক্ষেত্র
arguments object ( GoogleSearchCallArguments )

Required. The arguments to pass to Google Search.

searchType enum ( SearchType )

The type of search grounding enabled.

JSON উপস্থাপনা
{
  "arguments": {
    object (GoogleSearchCallArguments)
  },
  "searchType": enum (SearchType)
}

GoogleSearchCallArguments

The arguments to pass to Google Search.

ক্ষেত্র
queries[] string

Web search queries for the following-up web search.

JSON উপস্থাপনা
{
  "queries": [
    string
  ]
}

ফাইলসার্চকলকন্টেন্ট

This type has no fields.

File Search content.

GoogleMapsCallContent

Google Maps content.

ক্ষেত্র
arguments object ( GoogleMapsCallArguments )

The arguments to pass to the Google Maps tool.

JSON উপস্থাপনা
{
  "arguments": {
    object (GoogleMapsCallArguments)
  }
}

GoogleMapsCallArguments

The arguments to pass to the Google Maps tool.

ক্ষেত্র
queries[] string

The queries to be executed.

JSON উপস্থাপনা
{
  "queries": [
    string
  ]
}

টুলরিজাল্টকন্টেন্ট

Tool result content.

ক্ষেত্র
callId string

Required. ID to match the ID from the function call block.

signature string ( bytes format)

A signature hash for backend validation.

A base64-encoded string.

type Union type
type can be only one of the following:
functionResult object ( FunctionResultContent )
codeExecutionResult object ( CodeExecutionResultContent )
urlContextResult object ( UrlContextResultContent )
googleSearchResult object ( GoogleSearchResultContent )
mcpServerToolResult object ( McpServerToolResultContent )
fileSearchResult object ( FileSearchResultContent )
googleMapsResult object ( GoogleMapsResultContent )
JSON উপস্থাপনা
{
  "callId": string,
  "signature": string,

  // type
  "functionResult": {
    object (FunctionResultContent)
  },
  "codeExecutionResult": {
    object (CodeExecutionResultContent)
  },
  "urlContextResult": {
    object (UrlContextResultContent)
  },
  "googleSearchResult": {
    object (GoogleSearchResultContent)
  },
  "mcpServerToolResult": {
    object (McpServerToolResultContent)
  },
  "fileSearchResult": {
    object (FileSearchResultContent)
  },
  "googleMapsResult": {
    object (GoogleMapsResultContent)
  }
  // Union type
}

FunctionResultContent

A function tool result content block.

ক্ষেত্র
name string

The name of the tool that was called.

isError boolean

Whether the tool call resulted in an error.

result Union type
The result of the tool call. result can be only one of the following:
structResult object ( Struct )
contentList object ( FunctionResultSubcontentList )
stringResult string
JSON উপস্থাপনা
{
  "name": string,
  "isError": boolean,

  // result
  "structResult": {
    object (Struct)
  },
  "contentList": {
    object (FunctionResultSubcontentList)
  },
  "stringResult": string
  // Union type
}

FunctionResultSubcontentList

ক্ষেত্র
contents[] object ( FunctionResultSubcontent )
JSON representation
{
  "contents": [
    {
      object (FunctionResultSubcontent)
    }
  ]
}

ফাংশনফলাফলসাবকন্টেন্ট

ক্ষেত্র
type Union type
type can be only one of the following:
text object ( TextContent )
image object ( ImageContent )
JSON representation
{

  // type
  "text": {
    object (TextContent)
  },
  "image": {
    object (ImageContent)
  }
  // Union type
}

কোডএক্সিকিউশনরেজাল্টকন্টেন্ট

Code execution result content.

ক্ষেত্র
result string

Required. The output of the code execution.

isError boolean

Whether the code execution resulted in an error.

JSON representation
{
  "result": string,
  "isError": boolean
}

UrlContextResultContent

URL context result content.

ক্ষেত্র
result[] object ( UrlContextResult )

Required. The results of the URL context.

isError boolean

Whether the URL context resulted in an error.

JSON representation
{
  "result": [
    {
      object (UrlContextResult)
    }
  ],
  "isError": boolean
}

UrlContextResult

The result of the URL context.

ক্ষেত্র
url string

The URL that was fetched.

status enum ( Status )

The status of the URL retrieval.

JSON representation
{
  "url": string,
  "status": enum (Status)
}

GoogleSearchResultContent

Google Search result content.

ক্ষেত্র
result[] object ( GoogleSearchResult )

Required. The results of the Google Search.

isError boolean

Whether the Google Search resulted in an error.

JSON representation
{
  "result": [
    {
      object (GoogleSearchResult)
    }
  ],
  "isError": boolean
}

গুগল অনুসন্ধান ফলাফল

The result of the Google Search.

ক্ষেত্র
searchSuggestions string

Web content snippet that can be embedded in a web page or an app webview.

JSON representation
{
  "searchSuggestions": string
}

McpServerToolResultContent

MCPServer tool result content.

ক্ষেত্র
name string

Name of the tool which is called for this specific tool call.

serverName string

The name of the used MCP server.

result Union type
The output from the MCP server call. Can be simple text or rich content. result can be only one of the following:
structResult object ( Struct )
contentList object ( FunctionResultSubcontentList )
stringResult string
JSON representation
{
  "name": string,
  "serverName": string,

  // result
  "structResult": {
    object (Struct)
  },
  "contentList": {
    object (FunctionResultSubcontentList)
  },
  "stringResult": string
  // Union type
}

ফাইলসার্চরেজাল্টকন্টেন্ট

File Search result content.

ক্ষেত্র
result[] object ( FileSearchResult )

Optional. The results of the File Search.

JSON উপস্থাপনা
{
  "result": [
    {
      object (FileSearchResult)
    }
  ]
}

ফাইলসার্চরেজাল্ট

This type has no fields.

The result of the File Search.

GoogleMapsResultContent

Google Maps result content.

ক্ষেত্র
result[] object ( GoogleMapsResult )

Required. The results of the Google Maps.

JSON representation
{
  "result": [
    {
      object (GoogleMapsResult)
    }
  ]
}

GoogleMapsResult

The result of the Google Maps.

ক্ষেত্র
places[] object ( Places )

The places that were found.

widgetContextToken string

Resource name of the Google Maps widget context token.

JSON representation
{
  "places": [
    {
      object (Places)
    }
  ],
  "widgetContextToken": string
}

স্থান

ক্ষেত্র
placeId string

The ID of the place, in places/{placeId} format.

name string

Title of the place.

url string

URI reference of the place.

reviewSnippets[] object ( ReviewSnippet )

Snippets of reviews that are used to generate answers about the features of a given place in Google Maps.

JSON representation
{
  "placeId": string,
  "name": string,
  "url": string,
  "reviewSnippets": [
    {
      object (ReviewSnippet)
    }
  ]
}

বিষয়বস্তুর তালিকা

A list of Content.

ক্ষেত্র
contents[] object ( Content )

The contents of the list.

JSON representation
{
  "contents": [
    {
      object (Content)
    }
  ]
}

CreateInteractionRequest

Configuration parameters for creating an interaction.

ক্ষেত্র
stream boolean

Input only. Whether the interaction will be streamed.

boolean store

Input only. Whether to store the response and request for later retrieval.

interaction object ( Interaction )

The interaction to create.

background boolean

Input only. Whether to run the model interaction in the background.

JSON representation
{
  "stream": boolean,
  "store": boolean,
  "interaction": {
    object (Interaction)
  },
  "background": boolean
}

মিথস্ক্রিয়া

Response for InteractionService.CreateInteraction.

ক্ষেত্র
id string

Required. Output only. A unique identifier for the interaction completion.

status enum ( Status )

Required. Output only. The status of the interaction.

created string

Required. Output only. The time at which the response was created in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

updated string

Required. Output only. The time at which the response was last updated in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ).

role
(deprecated)
string

Output only. The role of the interaction.

outputs[]
(deprecated)
object ( Content )

Output only. Responses from the model.

systemInstruction string

System instruction for the interaction.

tools[] object ( Tool )

A list of tool declarations the model may call during interaction.

usage object ( Usage )

Output only. Statistics on the interaction request's token usage.

responseModalities[]
(deprecated)
enum ( ResponseModality )

The requested modalities of the response (TEXT, IMAGE, AUDIO).

responseMimeType
(deprecated)
string

The mime type of the response. This is required if responseFormat is set.

previousInteractionId string

The ID of the previous interaction, if any.

environmentId string

Output only. The environment ID for the interaction. Only populated if environment config is set in the request.

serviceTier enum ( ServiceTier )

The service tier for the interaction.

webhookConfig object ( WebhookConfig )

Optional. Webhook configuration for receiving notifications when the interaction completes.

steps[] object ( Step )

Required. Output only. The steps that make up the interaction.

input Union type
The input for the interaction. input can be only one of the following:
contentList
(deprecated)
object ( ContentList )

The inputs for the interaction.

stringContent string

A string input for the interaction, it will be processed as a single text input.

turnList
(deprecated)
object ( TurnList )

The turns for the interaction.

stepList object ( StepList )

Input only. The steps for the interaction.

content object ( Content )

The content for the interaction.

response_format_config Union type
response_format_config can be only one of the following:
responseFormat
(deprecated)
object ( Value )

Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.

responseFormatList object ( ResponseFormatList )
responseFormatSingleton object ( ResponseFormat )
request_type Union type
The request type for the interaction. request_type can be only one of the following:
modelInteraction object ( ModelInteraction )

Interaction for generating the completion using models.

agentInteraction object ( AgentInteraction )

Interaction for generating the completion using agents.

environment Union type
The environment configuration for the interaction. environment can be only one of the following:
envId string

The environment ID for the interaction. Can be 'remote' for default environment.

remoteEnvironment object ( EnvironmentConfig )
localEnvironment object ( LocalEnvironmentConfig )

The agent's environment lives on the client connection: its built-in environment operations (filesystem ops and running commands) are yielded to the client to execute, instead of running in a server-managed sandbox. Mutually exclusive with remoteEnvironment . (Independent of any client-declared function tools, which are always executed on the client regardless of this field.)

JSON representation
{
  "id": string,
  "status": enum (Status),
  "created": string,
  "updated": string,
  "role": string,
  "outputs": [
    {
      object (Content)
    }
  ],
  "systemInstruction": string,
  "tools": [
    {
      object (Tool)
    }
  ],
  "usage": {
    object (Usage)
  },
  "responseModalities": [
    enum (ResponseModality)
  ],
  "responseMimeType": string,
  "previousInteractionId": string,
  "environmentId": string,
  "serviceTier": enum (ServiceTier),
  "webhookConfig": {
    object (WebhookConfig)
  },
  "steps": [
    {
      object (Step)
    }
  ],

  // input
  "contentList": {
    object (ContentList)
  },
  "stringContent": string,
  "turnList": {
    object (TurnList)
  },
  "stepList": {
    object (StepList)
  },
  "content": {
    object (Content)
  }
  // Union type

  // response_format_config
  "responseFormat": {
    object (Value)
  },
  "responseFormatList": {
    object (ResponseFormatList)
  },
  "responseFormatSingleton": {
    object (ResponseFormat)
  }
  // Union type

  // request_type
  "modelInteraction": {
    object (ModelInteraction)
  },
  "agentInteraction": {
    object (AgentInteraction)
  }
  // Union type

  // environment
  "envId": string,
  "remoteEnvironment": {
    object (EnvironmentConfig)
  },
  "localEnvironment": {
    object (LocalEnvironmentConfig)
  }
  // Union type
}

TurnList

A list of Turns.

ক্ষেত্র
turns[] object ( Turn )
JSON representation
{
  "turns": [
    {
      object (Turn)
    }
  ]
}

পালা

ক্ষেত্র
role string

The originator of this turn. Must be user for input or model for model output.

content Union type
content can be only one of the following:
contentList object ( ContentList )

The content of the turn. An array of Content objects.

contentString string

The content of the turn. A single string.

JSON representation
{
  "role": string,

  // content
  "contentList": {
    object (ContentList)
  },
  "contentString": string
  // Union type
}

স্টেপলিস্ট

A list of Steps.

ক্ষেত্র
steps[] object ( Step )

The steps of the list.

JSON উপস্থাপনা
{
  "steps": [
    {
      object (Step)
    }
  ]
}

ধাপ

A step in the interaction.

ক্ষেত্র
type Union type
type can be only one of the following:
thought object ( ThoughtStep )
toolCall object ( ToolCallStep )
toolResult object ( ToolResultStep )
userInput object ( UserInputStep )

DO NOT USE -- These are for 3P JSON only

modelOutput object ( ModelOutputStep )
text
(deprecated)
object ( LegacyTextContent )
image
(deprecated)
object ( LegacyImageContent )
audio
(deprecated)
object ( LegacyAudioContent )
document
(deprecated)
object ( LegacyDocumentContent )
video
(deprecated)
object ( LegacyVideoContent )
JSON representation
{

  // type
  "thought": {
    object (ThoughtStep)
  },
  "toolCall": {
    object (ToolCallStep)
  },
  "toolResult": {
    object (ToolResultStep)
  },
  "userInput": {
    object (UserInputStep)
  },
  "modelOutput": {
    object (ModelOutputStep)
  },
  "text": {
    object (LegacyTextContent)
  },
  "image": {
    object (LegacyImageContent)
  },
  "audio": {
    object (LegacyAudioContent)
  },
  "document": {
    object (LegacyDocumentContent)
  },
  "video": {
    object (LegacyVideoContent)
  }
  // Union type
}

ThoughtStep

A thought step.

ক্ষেত্র
signature string ( bytes format)

A signature hash for backend validation.

A base64-encoded string.

summary[] object ( Content )

A summary of the thought.

JSON representation
{
  "signature": string,
  "summary": [
    {
      object (Content)
    }
  ]
}

টুলকলস্টেপ

Tool call step.

ক্ষেত্র
id string

Required. A unique ID for this specific tool call.

signature string ( bytes format)

A signature hash for backend validation.

A base64-encoded string.

type Union type
type can be only one of the following:
functionCall object ( FunctionCallStep )
codeExecutionCall object ( CodeExecutionCallStep )
urlContextCall object ( UrlContextCallStep )
mcpServerToolCall object ( McpServerToolCallStep )
googleSearchCall object ( GoogleSearchCallStep )
fileSearchCall object ( FileSearchCallStep )
googleMapsCall object ( GoogleMapsCallStep )
retrievalCall object ( RetrievalCallStep )
JSON representation
{
  "id": string,
  "signature": string,

  // type
  "functionCall": {
    object (FunctionCallStep)
  },
  "codeExecutionCall": {
    object (CodeExecutionCallStep)
  },
  "urlContextCall": {
    object (UrlContextCallStep)
  },
  "mcpServerToolCall": {
    object (McpServerToolCallStep)
  },
  "googleSearchCall": {
    object (GoogleSearchCallStep)
  },
  "fileSearchCall": {
    object (FileSearchCallStep)
  },
  "googleMapsCall": {
    object (GoogleMapsCallStep)
  },
  "retrievalCall": {
    object (RetrievalCallStep)
  }
  // Union type
}

FunctionCallStep

A function tool call step.

ক্ষেত্র
name string

Required. The name of the tool to call.

arguments object ( Struct )

Required. The arguments to pass to the function.

JSON representation
{
  "name": string,
  "arguments": {
    object (Struct)
  }
}

UrlContextCallStep

URL context call step.

ক্ষেত্র
arguments object ( UrlContextCallStepArguments )

Required. The arguments to pass to the URL context.

JSON representation
{
  "arguments": {
    object (UrlContextCallStepArguments)
  }
}

UrlContextCallStepArguments

The arguments to pass to the URL context.

ক্ষেত্র
urls[] string

The URLs to fetch.

JSON representation
{
  "urls": [
    string
  ]
}

McpServerToolCallStep

MCPServer tool call step.

ক্ষেত্র
name string

Required. The name of the tool which was called.

serverName string

Required. The name of the used MCP server.

arguments object ( Struct )

Required. The JSON object of arguments for the function.

JSON representation
{
  "name": string,
  "serverName": string,
  "arguments": {
    object (Struct)
  }
}

GoogleSearchCallStep

Google Search call step.

ক্ষেত্র
arguments object ( GoogleSearchCallStepArguments )

Required. The arguments to pass to Google Search.

searchType enum ( SearchType )

The type of search grounding enabled.

JSON representation
{
  "arguments": {
    object (GoogleSearchCallStepArguments)
  },
  "searchType": enum (SearchType)
}

GoogleSearchCallStepArguments

The arguments to pass to Google Search.

ক্ষেত্র
queries[] string

Web search queries for the following-up web search.

JSON representation
{
  "queries": [
    string
  ]
}

ফাইলসার্চকলস্টেপ

This type has no fields.

File Search call step.

GoogleMapsCallStep

Google Maps call step.

ক্ষেত্র
arguments object ( GoogleMapsCallStepArguments )

The arguments to pass to the Google Maps tool.

JSON representation
{
  "arguments": {
    object (GoogleMapsCallStepArguments)
  }
}

GoogleMapsCallStepArguments

The arguments to pass to the Google Maps tool.

ক্ষেত্র
queries[] string

The queries to be executed.

JSON representation
{
  "queries": [
    string
  ]
}

টুলরেজাল্টস্টেপ

Tool result step.

ক্ষেত্র
callId string

Required. ID to match the ID from the function call block.

signature string ( bytes format)

A signature hash for backend validation.

A base64-encoded string.

type Union type
type can be only one of the following:
functionResult object ( FunctionResultStep )
codeExecutionResult object ( CodeExecutionResultStep )
urlContextResult object ( UrlContextResultStep )
googleSearchResult object ( GoogleSearchResultStep )
mcpServerToolResult object ( McpServerToolResultStep )
fileSearchResult object ( FileSearchResultStep )
googleMapsResult object ( GoogleMapsResultStep )
retrievalResult object ( RetrievalResultStep )
JSON representation
{
  "callId": string,
  "signature": string,

  // type
  "functionResult": {
    object (FunctionResultStep)
  },
  "codeExecutionResult": {
    object (CodeExecutionResultStep)
  },
  "urlContextResult": {
    object (UrlContextResultStep)
  },
  "googleSearchResult": {
    object (GoogleSearchResultStep)
  },
  "mcpServerToolResult": {
    object (McpServerToolResultStep)
  },
  "fileSearchResult": {
    object (FileSearchResultStep)
  },
  "googleMapsResult": {
    object (GoogleMapsResultStep)
  },
  "retrievalResult": {
    object (RetrievalResultStep)
  }
  // Union type
}

ফাংশনফলাফলধাপ

Result of a function tool call.

ক্ষেত্র
name string

The name of the tool that was called.

isError boolean

Whether the tool call resulted in an error.

result object ( Value )

Required. The result of the tool call.

JSON representation
{
  "name": string,
  "isError": boolean,
  "result": {
    object (Value)
  }
}

UrlContextResultStep

URL context result step.

ক্ষেত্র
result[] object ( UrlContextResultItem )

Required. The results of the URL context.

isError boolean

Whether the URL context resulted in an error.

JSON representation
{
  "result": [
    {
      object (UrlContextResultItem)
    }
  ],
  "isError": boolean
}

URLContextResultItem

The result of the URL context.

ক্ষেত্র
url string

The URL that was fetched.

status enum ( Status )

The status of the URL retrieval.

JSON representation
{
  "url": string,
  "status": enum (Status)
}

GoogleSearchResultStep

Google Search result step.

ক্ষেত্র
result[] object ( GoogleSearchResultItem )

Required. The results of the Google Search.

isError boolean

Whether the Google Search resulted in an error.

JSON representation
{
  "result": [
    {
      object (GoogleSearchResultItem)
    }
  ],
  "isError": boolean
}

গুগল অনুসন্ধান ফলাফল আইটেম

The result of the Google Search.

ক্ষেত্র
searchSuggestions string

Web content snippet that can be embedded in a web page or an app webview.

JSON representation
{
  "searchSuggestions": string
}

McpServerToolResultStep

MCPServer tool result step.

ক্ষেত্র
name string

Name of the tool which is called for this specific tool call.

serverName string

The name of the used MCP server.

result object ( Value )

Required. The output from the MCP server call. Can be simple text or rich content.

JSON representation
{
  "name": string,
  "serverName": string,
  "result": {
    object (Value)
  }
}

ফাইলসার্চরেজাল্টস্টেপ

This type has no fields.

File Search result step.

GoogleMapsResultStep

Google Maps result step.

ক্ষেত্র
result[] object ( GoogleMapsResultItem )
JSON উপস্থাপনা
{
  "result": [
    {
      object (GoogleMapsResultItem)
    }
  ]
}

GoogleMapsResultItem

The result of the Google Maps.

ক্ষেত্র
places[] object ( GoogleMapsResultPlaces )
widgetContextToken string
JSON representation
{
  "places": [
    {
      object (GoogleMapsResultPlaces)
    }
  ],
  "widgetContextToken": string
}

GoogleMapsResultPlaces

ক্ষেত্র
placeId string
name string
url string
reviewSnippets[] object ( ReviewSnippet )
JSON representation
{
  "placeId": string,
  "name": string,
  "url": string,
  "reviewSnippets": [
    {
      object (ReviewSnippet)
    }
  ]
}

UserInputStep

Input provided by the user.

ক্ষেত্র
content Union type
content can be only one of the following:
contentList object ( ContentList )

The content of the step. An array of Content objects.

contentString string

The content of the step. A single string.

JSON representation
{

  // content
  "contentList": {
    object (ContentList)
  },
  "contentString": string
  // Union type
}

মডেলআউটপুটস্টেপ

Output generated by the model.

ক্ষেত্র
content[] object ( Content )
JSON representation
{
  "content": [
    {
      object (Content)
    }
  ]
}

প্রতিক্রিয়া বিন্যাস তালিকা

ক্ষেত্র
responseFormats[] object ( ResponseFormat )
JSON representation
{
  "responseFormats": [
    {
      object (ResponseFormat)
    }
  ]
}

ResponseFormat

ক্ষেত্র
type Union type
type can be only one of the following:
audio object ( AudioResponseFormat )
text object ( TextResponseFormat )
image object ( ImageResponseFormat )
video object ( VideoResponseFormat )
structValue object ( Struct )

Multi-discriminator values is already enabled in GAOS

JSON উপস্থাপনা
{

  // type
  "audio": {
    object (AudioResponseFormat)
  },
  "text": {
    object (TextResponseFormat)
  },
  "image": {
    object (ImageResponseFormat)
  },
  "video": {
    object (VideoResponseFormat)
  },
  "structValue": {
    object (Struct)
  }
  // Union type
}

TextResponseFormat

Configuration for text output format.

ক্ষেত্র
mimeType enum ( MimeType )

The MIME type of the text output.

schema object ( Struct )

The JSON schema that the output should conform to. Only applicable when mimeType is application/json.

JSON representation
{
  "mimeType": enum (MimeType),
  "schema": {
    object (Struct)
  }
}

ImageResponseFormat

Configuration for image output format.

ক্ষেত্র
mimeType enum ( MimeType )

The MIME type of the image output.

delivery enum ( Delivery )

The delivery mode for the image output.

aspectRatio enum ( AspectRatio )

The aspect ratio for the image output.

imageSize enum ( ImageSize )

The size of the image output.

JSON representation
{
  "mimeType": enum (MimeType),
  "delivery": enum (Delivery),
  "aspectRatio": enum (AspectRatio),
  "imageSize": enum (ImageSize)
}

ভিডিও প্রতিক্রিয়া বিন্যাস

Configuration for video output format.

ক্ষেত্র
delivery enum ( Delivery )

The delivery mode for the video output.

aspectRatio enum ( AspectRatio )

The aspect ratio for the video output.

duration string ( Duration format)

The duration for the video output.

A duration in seconds with up to nine fractional digits, ending with ' s '. Example: "3.5s" .

JSON representation
{
  "delivery": enum (Delivery),
  "aspectRatio": enum (AspectRatio),
  "duration": string
}

মডেল ইন্টারঅ্যাকশন

Interaction for generating the completion using models.

ক্ষেত্র
model string

The name of the Model used for generating the completion.

generationConfig object ( GenerationConfig )

Input only. Configuration parameters for the model interaction.

JSON representation
{
  "model": string,
  "generationConfig": {
    object (GenerationConfig)
  }
}

GenerationConfig

Configuration parameters for model interactions.

ক্ষেত্র
temperature number

Controls the randomness of the output.

topP number

The maximum cumulative probability of tokens to consider when sampling.

seed integer

Seed used in decoding for reproducibility.

stopSequences[] string

A list of character sequences that will stop output interaction.

thinkingLevel enum ( ThinkingLevel )

The level of thought tokens that the model should generate.

thinkingSummaries enum ( ThinkingSummaries )

Whether to include thought summaries in the response.

maxOutputTokens integer

The maximum number of tokens to include in the response.

speechConfig[] object ( SpeechConfig )

Configuration for speech interaction.

imageConfig
(deprecated)
object ( ImageConfig )

Configuration for image interaction.

videoConfig object ( VideoConfig )

Configuration for video generation.

tool_choice Union type
The tool choice configuration. tool_choice can be only one of the following:
toolChoiceMode enum ( ToolChoiceType )

The mode of the tool choice.

toolChoiceConfig object ( ToolChoiceConfig )

The config for the tool choice.

JSON representation
{
  "temperature": number,
  "topP": number,
  "seed": integer,
  "stopSequences": [
    string
  ],
  "thinkingLevel": enum (ThinkingLevel),
  "thinkingSummaries": enum (ThinkingSummaries),
  "maxOutputTokens": integer,
  "speechConfig": [
    {
      object (SpeechConfig)
    }
  ],
  "imageConfig": {
    object (ImageConfig)
  },
  "videoConfig": {
    object (VideoConfig)
  },

  // tool_choice
  "toolChoiceMode": enum (ToolChoiceType),
  "toolChoiceConfig": {
    object (ToolChoiceConfig)
  }
  // Union type
}

টুলচয়েসকনফিগ

The tool choice configuration containing allowed tools.

ক্ষেত্র
allowedTools object ( AllowedTools )

The allowed tools.

JSON representation
{
  "allowedTools": {
    object (AllowedTools)
  }
}

SpeechConfig

The configuration for speech interaction.

ক্ষেত্র
voice string

The voice of the speaker.

language string

The language of the speech.

speaker string

The speaker's name, it should match the speaker name given in the prompt.

JSON representation
{
  "voice": string,
  "language": string,
  "speaker": string
}

ImageConfig

The configuration for image interaction.

ক্ষেত্র
aspectRatio string

The aspect ratio of the image to generate. Supported aspect ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9.

If not specified, the model will choose a default aspect ratio based on any reference images provided.

imageSize string

Specifies the size of generated images. Supported values are 1K , 2K , 4K . If not specified, the model will use default value 1K .

JSON representation
{
  "aspectRatio": string,
  "imageSize": string
}

VideoConfig

Configuration options for video generation.

ক্ষেত্র
task enum ( Task )

Optional task mode for video generation. If not specified, the model automatically determines the appropriate mode based on the provided text prompt and input media.

JSON উপস্থাপনা
{
  "task": enum (Task)
}

পরিবেশ কনফিগারেশন

Configuration for a custom environment.

ক্ষেত্র
sources[] object ( Source )
environmentId string

Optional. The environment ID for the interaction. If specified, the request will update the existing environment instead of creating a new one.

network Union type
Network configuration for the environment. network can be only one of the following:
networkAllowlist object ( EnvironmentNetworkEgressAllowlist )

Allow only specific domains.

networkMode enum ( NetworkMode )

Network egress mode.

JSON representation
{
  "sources": [
    {
      object (Source)
    }
  ],
  "environmentId": string,

  // network
  "networkAllowlist": {
    object (EnvironmentNetworkEgressAllowlist)
  },
  "networkMode": enum (NetworkMode)
  // Union type
}

পরিবেশ নেটওয়ার্ক নির্গমন অনুমতি তালিকা

Network egress configuration for the environment.

ক্ষেত্র
allowlist[] object ( EgressRule )

List of allowed domains and their configurations.

JSON representation
{
  "allowlist": [
    {
      object (EgressRule)
    }
  ]
}

EgressRule

A network egress rule that controls which external domains the environment is allowed to reach. Each rule identifies a target domain and, optionally, a set of HTTP headers to inject into every matching outbound request.

ক্ষেত্র
domain string

The domain pattern to match for this rule. Use an exact hostname (eg, github.com ), a wildcard prefix (eg, *.googleapis.com ), or * to match all domains.

transform map (key: string, value: string)

Headers to inject into requests matching this rule. Key: header name (eg, "Authorization"). Value: header value (eg, "Bearer your-token").

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

JSON representation
{
  "domain": string,
  "transform": {
    string: string,
    ...
  }
}

উৎস

A source to be mounted into the environment.

ক্ষেত্র
type enum ( Type )
source string

The source of the environment. For GCS, this is the GCS path. For GitHub, this is the GitHub path.

target string

Where the source should appear in the environment.

content string

The inline content if type is INLINE .

encoding string

Optional encoding for inline content (eg base64 ).

JSON representation
{
  "type": enum (Type),
  "source": string,
  "target": string,
  "content": string,
  "encoding": string
}

LocalEnvironmentConfig

This type has no fields.

Configuration for an environment that lives on the client connection rather than in a server-managed sandbox.

When set (via Interaction.local_environment), the agent's filesystem and shell are treated as living on the client: the agent's built-in environment operations (eg reading/listing/editing files and running commands) are suspended on the server and yielded back to the client to execute, with their results returned on a subsequent turn. This is mutually exclusive with a server-managed EnvironmentConfig (remoteEnvironment), since the environment is either on the client or in a server sandbox, never both.

This governs only the agent's built-in environment. Client-declared function tools are always executed on the client regardless of this field.

সরঞ্জাম

A tool that can be used by the model.

ক্ষেত্র
type Union type
The tool to use. type can be only one of the following:
function object ( Function )

A function that can be used by the model.

codeExecution object ( CodeExecution )

A tool that can be used by the model to execute code.

urlContext object ( UrlContext )

A tool that can be used by the model to fetch URL context.

computerUse object ( ComputerUse )

Tool to support the model interacting directly with the computer.

mcpServer object ( McpServer )

A MCPServer is a server that can be called by the model to perform actions.

googleMaps object ( GoogleMaps )

A tool that can be used by the model to search Google Maps.

retrieval object ( Retrieval )

A tool that can be used by the model to retrieve files.

JSON representation
{

  // type
  "function": {
    object (Function)
  },
  "codeExecution": {
    object (CodeExecution)
  },
  "urlContext": {
    object (UrlContext)
  },
  "computerUse": {
    object (ComputerUse)
  },
  "mcpServer": {
    object (McpServer)
  },
  "googleSearch": {
    object (GoogleSearch)
  },
  "fileSearch": {
    object (FileSearch)
  },
  "googleMaps": {
    object (GoogleMaps)
  },
  "retrieval": {
    object (Retrieval)
  }
  // Union type
}

ফাংশন

A tool that can be used by the model.

ক্ষেত্র
name string

ফাংশনটির নাম।

description string

A description of the function.

parameters object ( Value )

The JSON Schema for the function's parameters.

JSON representation
{
  "name": string,
  "description": string,
  "parameters": {
    object (Value)
  }
}

UrlContext

This type has no fields.

A tool that can be used by the model to fetch URL context.

McpServer

A MCPServer is a server that can be called by the model to perform actions.

ক্ষেত্র
name string

The name of the MCPServer.

url string

The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"

headers map (key: string, value: string)

Optional: Fields for authentication headers, timeouts, etc., if needed.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

allowedTools[] object ( AllowedTools )

The allowed tools.

JSON representation
{
  "name": string,
  "url": string,
  "headers": {
    string: string,
    ...
  },
  "allowedTools": [
    {
      object (AllowedTools)
    }
  ]
}

GoogleSearch

A tool that can be used by the model to search Google.

ক্ষেত্র
searchTypes[] enum ( SearchType )

The types of search grounding to enable.

JSON representation
{
  "searchTypes": [
    enum (SearchType)
  ]
}

FileSearch

A tool that can be used by the model to search files.

ক্ষেত্র
fileSearchStoreNames[] string

The file search store names to search.

topK integer

The number of semantic retrieval chunks to retrieve.

metadataFilter string

Metadata filter to apply to the semantic retrieval documents and chunks.

JSON representation
{
  "fileSearchStoreNames": [
    string
  ],
  "topK": integer,
  "metadataFilter": string
}

GoogleMaps

A tool that can be used by the model to call Google Maps.

ক্ষেত্র
enableWidget boolean

Whether to return a widget context token in the tool call result of the response.

latitude number

The latitude of the user's location.

longitude number

The longitude of the user's location.

JSON representation
{
  "enableWidget": boolean,
  "latitude": number,
  "longitude": number
}

ব্যবহার

Statistics on the interaction request's token usage.

ক্ষেত্র
totalInputTokens integer

Number of tokens in the prompt (context).

inputTokensByModality[] object ( ModalityTokens )

A breakdown of input token usage by modality.

totalCachedTokens integer

Number of tokens in the cached part of the prompt (the cached content).

cachedTokensByModality[] object ( ModalityTokens )

A breakdown of cached token usage by modality.

totalOutputTokens integer

Total number of tokens across all the generated responses.

outputTokensByModality[] object ( ModalityTokens )

A breakdown of output token usage by modality.

totalToolUseTokens integer

Number of tokens present in tool-use prompt(s).

toolUseTokensByModality[] object ( ModalityTokens )

A breakdown of tool-use token usage by modality.

totalThoughtTokens integer

Number of tokens of thoughts for thinking models.

totalTokens integer

Total token count for the interaction request (prompt + responses + other internal tokens).

groundingToolCount[] object ( GroundingToolCount )

Grounding tool count.

JSON representation
{
  "totalInputTokens": integer,
  "inputTokensByModality": [
    {
      object (ModalityTokens)
    }
  ],
  "totalCachedTokens": integer,
  "cachedTokensByModality": [
    {
      object (ModalityTokens)
    }
  ],
  "totalOutputTokens": integer,
  "outputTokensByModality": [
    {
      object (ModalityTokens)
    }
  ],
  "totalToolUseTokens": integer,
  "toolUseTokensByModality": [
    {
      object (ModalityTokens)
    }
  ],
  "totalThoughtTokens": integer,
  "totalTokens": integer,
  "groundingToolCount": [
    {
      object (GroundingToolCount)
    }
  ]
}

ModalityTokens

The token count for a single response modality.

ক্ষেত্র
modality enum ( ResponseModality )

The modality associated with the token count.

tokens integer

Number of tokens for the modality.

JSON উপস্থাপনা
{
  "modality": enum (ResponseModality),
  "tokens": integer
}

গ্রাউন্ডিং টুল সংখ্যা

The number of grounding tool counts.

ক্ষেত্র
type enum ( Type )

The grounding tool type associated with the count.

count integer

The number of grounding tool counts.

JSON representation
{
  "type": enum (Type),
  "count": integer
}

WebhookConfig

Message for configuring webhook events for a request.

ক্ষেত্র
uris[] string

ঐচ্ছিক। সেট করা হলে, নিবন্ধিত ওয়েবহুকগুলোর পরিবর্তে এই ওয়েবহুক ইউআরআইগুলো ওয়েবহুক ইভেন্টের জন্য ব্যবহৃত হবে।

userMetadata object ( Struct format)

Optional. The user metadata that will be returned on each event emission to the webhooks.

JSON representation
{
  "uris": [
    string
  ],
  "userMetadata": {
    object
  }
}

SafetySetting

A safety setting that affects the safety-blocking behavior.

A [SafetySetting][google.cloud.aiplatform.master.SafetySetting] consists of a harm [category][google.cloud.aiplatform.master.SafetySetting.category] and a [threshold][google.cloud.aiplatform.master.SafetySetting.threshold] for that category.

ক্ষেত্র
type enum ( HarmCategory )

Required. The type of harm category to be blocked.

threshold enum ( HarmBlockThreshold )

Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.

method enum ( HarmBlockMethod )

Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.

JSON representation
{
  "type": enum (HarmCategory),
  "threshold": enum (HarmBlockThreshold),
  "method": enum (HarmBlockMethod)
}

ডেলিভারি

Delivery mode for audio output.

এনাম
DELIVERY_UNSPECIFIED Default value. This value is unused.
INLINE Audio data is returned inline in the response.
URI Audio data is returned as a URI.

পরিবেশ

Represents the environment being operated, such as a web browser.

এনাম
ENVIRONMENT_UNSPECIFIED Defaults to browser.
BROWSER Operates in a web browser.
MOBILE Operates in a mobile environment.
DESKTOP Operates in a desktop environment.

HarmBlockMethod

The method for blocking content.

এনাম
HARM_BLOCK_METHOD_UNSPECIFIED The harm block method is unspecified.
SEVERITY The harm block method uses both probability and severity scores.
PROBABILITY The harm block method uses the probability score.

HarmBlockThreshold

Thresholds for blocking content based on harm probability.

এনাম
HARM_BLOCK_THRESHOLD_UNSPECIFIED The harm block threshold is unspecified.
BLOCK_LOW_AND_ABOVE Block content with a low harm probability or higher.
BLOCK_MEDIUM_AND_ABOVE Block content with a medium harm probability or higher.
BLOCK_ONLY_HIGH Block content with a high harm probability.
BLOCK_NONE Do not block any content, regardless of its harm probability.
OFF Turn off the safety filter entirely.

ImageSize

Supported image sizes for image output.

এনাম
IMAGE_SIZE_UNSPECIFIED Default value. This value is unused.
IMAGE_SIZE_FIVE_TWELVE 512px image size.
IMAGE_SIZE_ONE_K 1K image size.
IMAGE_SIZE_TWO_K 2K image size.
IMAGE_SIZE_FOUR_K 4K image size.

ভাষা

Supported programming languages for the generated code.

এনাম
LANGUAGE_UNSPECIFIED Unspecified language. This value should not be used.
PYTHON Python >= 3.10, with numpy and simpy available.

MediaResolution

Resolution for input media (images/video).

এনাম
MEDIA_RESOLUTION_UNSPECIFIED Default value. This value is unused.
LOW Low resolution.
MEDIUM Medium resolution.
HIGH উচ্চ রেজোলিউশন।
ULTRA_HIGH Ultra high resolution.

MimeType

এনাম
TYPE_UNSPECIFIED
TYPE_WAV WAV অডিও ফরম্যাট
TYPE_MP3 MP3 audio format
TYPE_AIFF AIFF audio format
TYPE_AAC AAC audio format
TYPE_OGG OGG audio format
TYPE_FLAC FLAC audio format
TYPE_MPEG MPEG audio format
TYPE_M4A M4A audio format
TYPE_L16 L16 audio format
TYPE_OPUS OPUS audio format
TYPE_ALAW ALAW audio format
TYPE_MULAW MULAW audio format

মোড

Defines the depth and thoroughness of the find session.

এনাম
MODE_UNSPECIFIED Default value. This value is unused.
MODE_SCAN Fast scan using only the initial classifier.
MODE_VERIFY Performs classification followed by detailed investigation.

নেটওয়ার্ক মোড

Network egress mode for non-allowlist configurations.

এনাম
NETWORK_MODE_UNSPECIFIED Default value. Unused.
DISABLED All network egress is blocked.

প্রতিক্রিয়া পদ্ধতি

The modality of the response.

এনাম
RESPONSE_MODALITY_UNSPECIFIED Default value. This value is unused.
TEXT Indicates the model should return text.
IMAGE Indicates the model should return images.
AUDIO Indicates the model should return audio.
VIDEO Indicates the model should return video.
DOCUMENT Indicates the model should return documents.

ReviewSnippet

Encapsulates a snippet of a user review that answers a question about the features of a specific place in Google Maps.

ক্ষেত্র
title string

Title of the review.

url string

A link that corresponds to the user review on Google Maps.

reviewId string

The ID of the review snippet.

JSON representation
{
  "title": string,
  "url": string,
  "reviewId": string
}

SafetyPolicy

এনাম
SAFETY_POLICY_UNSPECIFIED Unspecified safety policy.
FINANCIAL_TRANSACTIONS Safety policy for financial transactions.
SENSITIVE_DATA_MODIFICATION Safety policy for sensitive data modification.
COMMUNICATION_TOOL Safety policy for communication tools (eg Gmail, Chat, Meet).
ACCOUNT_CREATION Safety policy for account creation.
DATA_MODIFICATION Safety policy for data modification.
LEGAL_TERMS_AND_AGREEMENTS Safety policy for legal terms and agreements.

স্কিমা

The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object .

ক্ষেত্র
type enum ( Type )

Required. Data type.

format string

Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality.

title string

Optional. The title of the schema.

description string

Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.

nullable boolean

Optional. Indicates if the value may be null.

enum[] string

Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}

maxItems string ( int64 format)

Optional. Maximum number of the elements for Type.ARRAY.

minItems string ( int64 format)

Optional. Minimum number of the elements for Type.ARRAY.

properties map (key: string, value: object ( Schema ))

Optional. Properties of Type.OBJECT.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

required[] string

Optional. Required properties of Type.OBJECT.

minProperties string ( int64 format)

Optional. Minimum number of the properties for Type.OBJECT.

maxProperties string ( int64 format)

Optional. Maximum number of the properties for Type.OBJECT.

minLength string ( int64 format)

Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING

maxLength string ( int64 format)

Optional. Maximum length of the Type.STRING

pattern string

Optional. Pattern of the Type.STRING to restrict a string to a regular expression.

example value ( Value format)

Optional. Example of the object. Will only populated when the object is the root.

anyOf[] object ( Schema )

Optional. The value should be validated against any (one or more) of the subschemas in the list.

propertyOrdering[] string

Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.

default value ( Value format)

Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a default field don't get unknown-field errors.

items object ( Schema )

Optional. Schema of the elements of Type.ARRAY.

minimum number

Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER

maximum number

Optional. Maximum value of the Type.INTEGER and Type.NUMBER

JSON representation
{
  "type": enum (Type),
  "format": string,
  "title": string,
  "description": string,
  "nullable": boolean,
  "enum": [
    string
  ],
  "maxItems": string,
  "minItems": string,
  "properties": {
    string: {
      object (Schema)
    },
    ...
  },
  "required": [
    string
  ],
  "minProperties": string,
  "maxProperties": string,
  "minLength": string,
  "maxLength": string,
  "pattern": string,
  "example": value,
  "anyOf": [
    {
      object (Schema)
    }
  ],
  "propertyOrdering": [
    string
  ],
  "default": value,
  "items": {
    object (Schema)
  },
  "minimum": number,
  "maximum": number
}

প্রকার

Type contains the list of OpenAPI data types as defined by https://spec.openapis.org/oas/v3.0.3#data-types

এনাম
TYPE_UNSPECIFIED Not specified, should not be used.
STRING String type.
NUMBER Number type.
INTEGER Integer type.
BOOLEAN Boolean type.
ARRAY অ্যারে টাইপ।
OBJECT Object type.
NULL Null type.

SearchType

The types of search grounding to enable.

এনাম
SEARCH_TYPE_UNSPECIFIED Unspecified search type. This value should not be used.

Struct

Struct represents a structured data value, consisting of fields which map to dynamically typed values.

ক্ষেত্র
fields[] object ( Field )

Dynamically typed fields. List instead of map because LLMs are sensitive to ordering, and we want to give users full control.

JSON representation
{
  "fields": [
    {
      object (Field)
    }
  ]
}

মাঠ

Represents a single field in a struct.

ক্ষেত্র
name string
value object ( Value )
JSON representation
{
  "name": string,
  "value": {
    object (Value)
  }
}

কাজ

Supported video generation tasks.

এনাম
TASK_UNSPECIFIED Unspecified task. The task is inferred from the input prompt and media.
TEXT_TO_VIDEO Generates video solely from a text prompt.
IMAGE_TO_VIDEO Generates video from one or two source images. The first image defines the starting frame, and the optional second image defines the ending frame.
REFERENCE_TO_VIDEO Generates video using reference media (such as images, audio, or video).
EDIT Modifies an existing input video.

ThinkingLevel

The level of thought tokens that the model should generate.

এনাম
THINKING_LEVEL_UNSPECIFIED Default value. This value is unused.
THINKING_LEVEL_MINIMAL Little to no thinking.
THINKING_LEVEL_LOW Low thinking level.
THINKING_LEVEL_MEDIUM Medium thinking level.
THINKING_LEVEL_HIGH High thinking level.

থিঙ্কিংসামারিস

Whether to include thought summaries in the response.

এনাম
THINKING_SUMMARIES_UNSPECIFIED Default value. This value is unused.
THINKING_SUMMARIES_AUTO Auto thinking summaries.
THINKING_SUMMARIES_NONE No thinking summaries.

সরঞ্জাম

Tool details that the model may use to generate response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

Next ID: 16

ক্ষেত্র
functionDeclarations[] object ( FunctionDeclaration )

Optional. A list of FunctionDeclarations available to the model that can be used for function calling.

The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the Content.role "function" generation context for the next model turn.

googleSearchRetrieval object ( GoogleSearchRetrieval )

Optional. Retrieval tool that is powered by Google search.

codeExecution object ( CodeExecution )

Optional. Enables the model to execute code as part of generation.

computerUse object ( ComputerUse )

Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.

urlContext object ( UrlContext )

Optional. Tool to support URL context retrieval.

mcpServers[] object ( McpServer )

Optional. MCP Servers to connect to.

googleMaps object ( GoogleMaps )

Optional. Tool that allows grounding the model's response with geospatial context related to the user's query.

JSON representation
{
  "functionDeclarations": [
    {
      object (FunctionDeclaration)
    }
  ],
  "googleSearchRetrieval": {
    object (GoogleSearchRetrieval)
  },
  "codeExecution": {
    object (CodeExecution)
  },
  "googleSearch": {
    object (GoogleSearch)
  },
  "computerUse": {
    object (ComputerUse)
  },
  "urlContext": {
    object (UrlContext)
  },
  "fileSearch": {
    object (FileSearch)
  },
  "mcpServers": [
    {
      object (McpServer)
    }
  ],
  "googleMaps": {
    object (GoogleMaps)
  }
}

FunctionDeclaration

Structured representation of a function declaration as defined by the OpenAPI 3.03 specification . Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a Tool by the model and executed by the client.

ক্ষেত্র
name string

Required. The name of the function. Must be az, AZ, 0-9, or contain underscores, colons, dots, and dashes, with a maximum length of 128.

description string

Required. A brief description of the function.

behavior enum ( Behavior )

Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.

parameters object ( Schema )

Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.

parametersJsonSchema value ( Value format)

Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example:

{
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "age": { "type": "integer" }
  },
  "additionalProperties": false,
  "required": ["name", "age"],
  "propertyOrdering": ["name", "age"]
}

This field is mutually exclusive with parameters .

response object ( Schema )

Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.

responseJsonSchema value ( Value format)

Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function.

This field is mutually exclusive with response .

JSON representation
{
  "name": string,
  "description": string,
  "behavior": enum (Behavior),
  "parameters": {
    object (Schema)
  },
  "parametersJsonSchema": value,
  "response": {
    object (Schema)
  },
  "responseJsonSchema": value
}

আচরণ

Defines the function behavior. Defaults to BLOCKING .

এনাম
UNSPECIFIED This value is unused.
BLOCKING If set, the system will wait to receive the function response before continuing the conversation.
NON_BLOCKING If set, the system will not wait to receive the function response. Instead, it will attempt to handle function responses as they become available while maintaining the conversation between the user and the model.

GoogleSearchRetrieval

Tool to retrieve public web data for grounding, powered by Google.

ক্ষেত্র
dynamicRetrievalConfig object ( DynamicRetrievalConfig )

Specifies the dynamic retrieval configuration for the given source.

JSON representation
{
  "dynamicRetrievalConfig": {
    object (DynamicRetrievalConfig)
  }
}

DynamicRetrievalConfig

Describes the options to customize dynamic retrieval.

ক্ষেত্র
mode enum ( Mode )

The mode of the predictor to be used in dynamic retrieval.

dynamicThreshold number

The threshold to be used in dynamic retrieval. If not set, a system default value is used.

JSON representation
{
  "mode": enum (Mode),
  "dynamicThreshold": number
}

মোড

The mode of the predictor to be used in dynamic retrieval.

এনাম
MODE_UNSPECIFIED Always trigger retrieval.
MODE_DYNAMIC Run retrieval only when system decides it is necessary.

CodeExecution

This type has no fields.

Tool that executes code generated by the model, and automatically returns the result to the model.

See also ExecutableCode and CodeExecutionResult which are only generated when using this tool.

GoogleSearch

GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.

ক্ষেত্র
timeRangeFilter object ( Interval )

Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa).

searchTypes object ( SearchTypes )

Optional. The set of search types to enable. If not set, web search is enabled by default.

JSON উপস্থাপনা
{
  "timeRangeFilter": {
    object (Interval)
  },
  "searchTypes": {
    object (SearchTypes)
  }
}

ব্যবধান

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).

The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.

ক্ষেত্র
startTime string ( Timestamp format)

Optional. Inclusive start of the interval.

If specified, a Timestamp matching this interval will have to be the same or after the start.

RFC 3339 ব্যবহার করা হয়, যেখানে তৈরি হওয়া আউটপুট সর্বদা Z-নরম্যালাইজড হবে এবং এতে ০, ৩, ৬ বা ৯টি ভগ্নাংশীয় অঙ্ক ব্যবহৃত হবে। "Z" ছাড়াও অন্যান্য অফসেটও গ্রহণ করা হয়। উদাহরণ: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" অথবা "2014-10-02T15:01:23+05:30"

endTime string ( Timestamp format)

Optional. Exclusive end of the interval.

If specified, a Timestamp matching this interval will have to be before the end.

RFC 3339 ব্যবহার করা হয়, যেখানে তৈরি হওয়া আউটপুট সর্বদা Z-নরম্যালাইজড হবে এবং এতে ০, ৩, ৬ বা ৯টি ভগ্নাংশীয় অঙ্ক ব্যবহৃত হবে। "Z" ছাড়াও অন্যান্য অফসেটও গ্রহণ করা হয়। উদাহরণ: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" অথবা "2014-10-02T15:01:23+05:30"

JSON representation
{
  "startTime": string,
  "endTime": string
}

SearchTypes

Different types of search that can be enabled on the GoogleSearch tool.

ক্ষেত্র
JSON representation
{
  "webSearch": {
    object (WebSearch)
  },
  "imageSearch": {
    object (ImageSearch)
  }
}

WebSearch

This type has no fields.

Standard web search for grounding and related configurations.

ImageSearch

This type has no fields.

Image search for grounding and related configurations.

ComputerUse

Computer Use tool type.

ক্ষেত্র
environment enum ( Environment )

Required. The environment being operated.

excludedPredefinedFunctions[] string

Optional. By default, predefined functions are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.

enablePromptInjectionDetection boolean

Optional. Whether enable the prompt injection detection check on computer-use request.

disabledSafetyPolicies[] enum ( SafetyPolicy )

Optional. Disabled safety policies for computer use.

JSON representation
{
  "environment": enum (Environment),
  "excludedPredefinedFunctions": [
    string
  ],
  "enablePromptInjectionDetection": boolean,
  "disabledSafetyPolicies": [
    enum (SafetyPolicy)
  ]
}

পরিবেশ

Represents the environment being operated, such as a web browser.

এনাম
ENVIRONMENT_UNSPECIFIED Defaults to browser.
ENVIRONMENT_BROWSER Operates in a web browser.
ENVIRONMENT_MOBILE Operates in a mobile environment.
ENVIRONMENT_DESKTOP Operates in a desktop environment.

SafetyPolicy

Predefined safety policies for computer use.

এনাম
SAFETY_POLICY_UNSPECIFIED Unspecified safety policy.
FINANCIAL_TRANSACTIONS Safety policy for financial transactions.
SENSITIVE_DATA_MODIFICATION Safety policy for sensitive data modification.
COMMUNICATION_TOOL Safety policy for communication tools (eg Gmail, Chat, Meet).
ACCOUNT_CREATION Safety policy for account creation.
DATA_MODIFICATION Safety policy for data modification.
LEGAL_TERMS_AND_AGREEMENTS Safety policy for legal terms and agreements.

UrlContext

This type has no fields.

Tool to support URL context retrieval.

FileSearch

The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.

ক্ষেত্র
fileSearchStoreNames[] string

Required. The names of the fileSearchStores to retrieve from. Example: fileSearchStores/my-file-search-store-123

metadataFilter string

Optional. Metadata filter to apply to the semantic retrieval documents and chunks.

topK integer

Optional. The number of semantic retrieval chunks to retrieve.

JSON representation
{
  "fileSearchStoreNames": [
    string
  ],
  "metadataFilter": string,
  "topK": integer
}

McpServer

A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 6

ক্ষেত্র
name string

The name of the MCPServer.

transport Union type
The transport to use to connect to the MCPServer. transport can be only one of the following:
streamableHttpTransport object ( StreamableHttpTransport )

A transport that can stream HTTP requests and responses.

JSON representation
{
  "name": string,

  // transport
  "streamableHttpTransport": {
    object (StreamableHttpTransport)
  }
  // Union type
}

StreamableHttpTransport

A transport that can stream HTTP requests and responses. Next ID: 6

ক্ষেত্র
url string

The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp"

headers map (key: string, value: string)

Optional: Fields for authentication headers, timeouts, etc., if needed.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" } .

timeout string ( Duration format)

HTTP timeout for regular operations.

A duration in seconds with up to nine fractional digits, ending with ' s '. Example: "3.5s" .

sseReadTimeout string ( Duration format)

Timeout for SSE read operations.

A duration in seconds with up to nine fractional digits, ending with ' s '. Example: "3.5s" .

terminateOnClose boolean

Whether to close the client session when the transport closes.

JSON উপস্থাপনা
{
  "url": string,
  "headers": {
    string: string,
    ...
  },
  "timeout": string,
  "sseReadTimeout": string,
  "terminateOnClose": boolean
}

GoogleMaps

The GoogleMaps Tool that provides geospatial context for the user's query.

ক্ষেত্র
enableWidget boolean

Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.

JSON representation
{
  "enableWidget": boolean
}

টুলচয়েসটাইপ

The type of tool choice.

এনাম
TOOL_CHOICE_TYPE_UNSPECIFIED Default value. This value is unused.
AUTO Auto tool choice.
ANY Any tool choice.
NONE No tool choice.
VALIDATED Validated tool choice.

মূল্য

Value represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of these variants. Absence of any variant indicates an error.

ক্ষেত্র
kind Union type
The kind of value. kind can be only one of the following:
nullValue null

Represents a null value.

numberValue number

Represents a double value.

stringValue string

Represents a string value.

boolValue boolean

Represents a boolean value.

structValue object ( Struct )

Represents a structured value.

listValue object ( ListValue )

Represents a repeated Value .

contentValue object ( Content )

Represents rich content (text, image, etc.).

JSON উপস্থাপনা
{

  // kind
  "nullValue": null,
  "numberValue": number,
  "stringValue": string,
  "boolValue": boolean,
  "structValue": {
    object (Struct)
  },
  "listValue": {
    object (ListValue)
  },
  "contentValue": {
    object (Content)
  }
  // Union type
}

ListValue

ListValue is a wrapper around a repeated field of values.

ক্ষেত্র
values[] object ( Value )

Repeated field of dynamically typed values.

JSON representation
{
  "values": [
    {
      object (Value)
    }
  ]
}

ভিজ্যুয়ালাইজেশন মোড

Enum for visualization mode. Eventually we will support an interactive mode where the user can choose whether to include HTML visualizations in the response.

এনাম
UNSPECIFIED The default visualization mode. Will default to AUTO.
OFF Do not include visualizations.
AUTO Automatically include visualizations.

REST রিসোর্স: auth_tokens

রিসোর্স: অথটোকেন

A request to create an ephemeral authentication token.

ক্ষেত্র
name string

Output only. Identifier. The token itself.

expireTime string ( Timestamp format)

Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.)

If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future.

RFC 3339 ব্যবহার করা হয়, যেখানে তৈরি হওয়া আউটপুট সর্বদা Z-নরম্যালাইজড হবে এবং এতে ০, ৩, ৬ বা ৯টি ভগ্নাংশীয় অঙ্ক ব্যবহৃত হবে। "Z" ছাড়াও অন্যান্য অফসেটও গ্রহণ করা হয়। উদাহরণ: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" অথবা "2014-10-02T15:01:23+05:30"

newSessionExpireTime string ( Timestamp format)

Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected.

If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future.

RFC 3339 ব্যবহার করা হয়, যেখানে তৈরি হওয়া আউটপুট সর্বদা Z-নরম্যালাইজড হবে এবং এতে ০, ৩, ৬ বা ৯টি ভগ্নাংশীয় অঙ্ক ব্যবহৃত হবে। "Z" ছাড়াও অন্যান্য অফসেটও গ্রহণ করা হয়। উদাহরণ: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" অথবা "2014-10-02T15:01:23+05:30"

fieldMask string ( FieldMask format)

Optional. Input only. Immutable. If fieldMask is empty, and bidiGenerateContentSetup is not present, then the effective BidiGenerateContentSetup message is taken from the Live API connection.

If fieldMask is empty, and bidiGenerateContentSetup is present, then the effective BidiGenerateContentSetup message is taken entirely from bidiGenerateContentSetup in this request. The setup message from the Live API connection is ignored.

If fieldMask is not empty, then the corresponding fields from bidiGenerateContentSetup will overwrite the fields from the setup message in the Live API connection.

এটি ফিল্ডগুলোর পূর্ণাঙ্গ নামের একটি কমা-দ্বারা-বিভক্ত তালিকা। উদাহরণ: "user.displayName,photo"

config Union type
The method-specific configuration for the resulting token. config can be only one of the following:
bidiGenerateContentSetup object ( BidiGenerateContentSetup )

Optional. Input only. Immutable. Configuration specific to BidiGenerateContent .

uses integer

Optional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1.

JSON representation
{
  "name": string,
  "expireTime": string,
  "newSessionExpireTime": string,
  "fieldMask": string,

  // config
  "bidiGenerateContentSetup": {
    object (BidiGenerateContentSetup)
  }
  // Union type
  "uses": integer
}

BidiGenerateContentSetup

Message to be sent in the first (and only in the first) BidiGenerateContentClientMessage . Contains configuration that will apply for the duration of the streaming RPC.

Clients should wait for a BidiGenerateContentSetupComplete message before sending any additional messages.

ক্ষেত্র
model string

আবশ্যক। মডেলের রিসোর্স নাম। এটি মডেলের ব্যবহারের জন্য একটি আইডি হিসেবে কাজ করে।

ফরম্যাট: models/{model}

generationConfig object ( GenerationConfig )

Optional. Generation config.

The following fields are not supported:

  • responseLogprobs
  • responseMimeType
  • logprobs
  • responseSchema
  • responseJsonSchema
  • stop_sequence
  • skipResponseCache
  • routing_config
  • audio_timestamp
systemInstruction object ( Content )

Optional. The user provided system instructions for the model.

Note: Only text should be used in parts and content in each part will be in a separate paragraph.

tools[] object ( Tool )

Optional. A list of Tools the model may use to generate the next response.

A Tool is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

realtimeInputConfig object ( RealtimeInputConfig )

Optional. Configures the handling of realtime input.

sessionResumption object ( SessionResumptionConfig )

Optional. Configures session resumption mechanism.

If included, the server will send SessionResumptionUpdate messages.

contextWindowCompression object ( ContextWindowCompressionConfig )

Optional. Configures a context window compression mechanism.

If included, the server will automatically reduce the size of the context when it exceeds the configured length.

inputAudioTranscription object ( AudioTranscriptionConfig )

Optional. If set, enables transcription of voice input. The transcription aligns with the input audio language, if configured.

outputAudioTranscription object ( AudioTranscriptionConfig )

Optional. If set, enables transcription of the model's audio output. The transcription aligns with the language code specified for the output audio, if configured.

historyConfig object ( HistoryConfig )

Optional. Configures the exchange of history between the client and the server.

JSON representation
{
  "model": string,
  "generationConfig": {
    object (GenerationConfig)
  },
  "systemInstruction": {
    object (Content)
  },
  "tools": [
    {
      object (Tool)
    }
  ],
  "realtimeInputConfig": {
    object (RealtimeInputConfig)
  },
  "sessionResumption": {
    object (SessionResumptionConfig)
  },
  "contextWindowCompression": {
    object (ContextWindowCompressionConfig)
  },
  "inputAudioTranscription": {
    object (AudioTranscriptionConfig)
  },
  "outputAudioTranscription": {
    object (AudioTranscriptionConfig)
  },
  "historyConfig": {
    object (HistoryConfig)
  }
}

GenerationConfig

Configuration options for model generation and outputs. Not all parameters are configurable for every model.

ক্ষেত্র
stopSequences[] string

Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop_sequence . The stop sequence will not be included as part of the response.

responseMimeType string

Optional. MIME type of the generated candidate text. Supported MIME types are: text/plain : (default) Text output. application/json : JSON response in the response candidates. text/x.enum : ENUM as a string response in the response candidates. Refer to the docs for a list of all supported text MIME types.

responseSchema
(deprecated)
object ( Schema )

Optional. Output schema of the generated candidate text. Schemas must be a subset of the OpenAPI schema and can be objects, primitives or arrays.

If set, a compatible responseMimeType must also be set. Compatible MIME types: application/json : Schema for JSON response. Refer to the JSON text generation guide for more details.

_responseJsonSchema
(deprecated)
value ( Value format)

Optional. Output schema of the generated response. This is an alternative to responseSchema that accepts JSON Schema .

If set, responseSchema must be omitted, but responseMimeType is required.

While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported:

  • $id
  • $defs
  • $ref
  • $anchor
  • type
  • format
  • title
  • description
  • enum (for strings and numbers)
  • items
  • prefixItems
  • minItems
  • maxItems
  • minimum
  • maximum
  • anyOf
  • oneOf (interpreted the same as anyOf )
  • properties
  • additionalProperties
  • required

The non-standard propertyOrdering property may also be set.

Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If $ref is set on a sub-schema, no other properties, except for than those starting as a $ , may be set.

responseJsonSchema value ( Value format)

Optional. An internal detail. Use responseJsonSchema rather than this field.

responseModalities[] enum ( Modality )

Optional. The requested modalities of the response. Represents the set of modalities that the model can return, and should be expected in the response. This is an exact match to the modalities of the response.

A model may have multiple combinations of supported modalities. If the requested modalities do not match any of the supported combinations, an error will be returned.

An empty list is equivalent to requesting only text.

candidateCount integer

Optional. Number of generated responses to return. If unset, this will default to 1. Please note that this doesn't work for previous generation models (Gemini 1.0 family)

maxOutputTokens integer

Optional. The maximum number of tokens to include in a response candidate.

Note: The default value varies by model, see the Model.output_token_limit attribute of the Model returned from the getModel function.

temperature number

Optional. Controls the randomness of the output.

Note: The default value varies by model, see the Model.temperature attribute of the Model returned from the getModel function.

Values can range from [0.0, 2.0].

topP number

Optional. The maximum cumulative probability of tokens to consider when sampling.

The model uses combined Top-k and Top-p (nucleus) sampling.

Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits the number of tokens based on the cumulative probability.

Note: The default value varies by Model and is specified by the Model.top_p attribute returned from the getModel function. An empty topK attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting topK on requests.

topK integer

Optional. The maximum number of tokens to consider when sampling.

Gemini models use Top-p (nucleus) sampling or a combination of Top-k and nucleus sampling. Top-k sampling considers the set of topK most probable tokens. Models running with nucleus sampling don't allow topK setting.

Note: The default value varies by Model and is specified by the Model.top_p attribute returned from the getModel function. An empty topK attribute indicates that the model doesn't apply top-k sampling and doesn't allow setting topK on requests.

seed integer

Optional. Seed used in decoding. If not set, the request uses a randomly generated seed.

presencePenalty number

Optional. Presence penalty applied to the next token's logprobs if the token has already been seen in the response.

This penalty is binary on/off and not dependant on the number of times the token is used (after the first). Use frequencyPenalty for a penalty that increases with each use.

A positive penalty will discourage the use of tokens that have already been used in the response, increasing the vocabulary.

A negative penalty will encourage the use of tokens that have already been used in the response, decreasing the vocabulary.

frequencyPenalty number

Optional. Frequency penalty applied to the next token's logprobs, multiplied by the number of times each token has been seen in the respponse so far.

A positive penalty will discourage the use of tokens that have already been used, proportional to the number of times the token has been used: The more a token is used, the more difficult it is for the model to use that token again increasing the vocabulary of responses.

Caution: A negative penalty will encourage the model to reuse tokens proportional to the number of times the token has been used. Small negative values will reduce the vocabulary of a response. Larger negative values will cause the model to start repeating a common token until it hits the maxOutputTokens limit.

responseLogprobs boolean

Optional. If true, export the logprobs results in response.

logprobs integer

Optional. Only valid if responseLogprobs=True . This sets the number of top logprobs, including the chosen candidate, to return at each decoding step in the Candidate.logprobs_result . The number must be in the range of [0, 20].

enableEnhancedCivicAnswers boolean

Optional. Enables enhanced civic answers. It may not be available for all models.

speechConfig object ( SpeechConfig )

Optional. The speech generation config.

thinkingConfig object ( ThinkingConfig )

Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.

imageConfig object ( ImageConfig )

Optional. Config for image generation. An error will be returned if this field is set for models that don't support these config options.

mediaResolution enum ( MediaResolution )

Optional. If specified, the media resolution specified will be used.

enableAffectiveDialog boolean

Optional. If enabled, the model will detect emotions and adapt its responses accordingly.

responseFormat object ( ResponseFormatConfig )

Optional. Configuration for the response output format. Allows specifying output configuration per modality (text, audio, image) in a flat structure.

translationConfig object ( TranslationConfig )

Optional. Config for translation.

JSON representation
{
  "stopSequences": [
    string
  ],
  "responseMimeType": string,
  "responseSchema": {
    object (Schema)
  },
  "_responseJsonSchema": value,
  "responseJsonSchema": value,
  "responseModalities": [
    enum (Modality)
  ],
  "candidateCount": integer,
  "maxOutputTokens": integer,
  "temperature": number,
  "topP": number,
  "topK": integer,
  "seed": integer,
  "presencePenalty": number,
  "frequencyPenalty": number,
  "responseLogprobs": boolean,
  "logprobs": integer,
  "enableEnhancedCivicAnswers": boolean,
  "speechConfig": {
    object (SpeechConfig)
  },
  "thinkingConfig": {
    object (ThinkingConfig)
  },
  "imageConfig": {
    object (ImageConfig)
  },
  "mediaResolution": enum (MediaResolution),
  "enableAffectiveDialog": boolean,
  "responseFormat": {
    object (ResponseFormatConfig)
  },
  "translationConfig": {
    object (TranslationConfig)
  }
}

পদ্ধতি

Supported modalities of the response.

এনাম
MODALITY_UNSPECIFIED Default value.
TEXT Indicates the model should return text.
IMAGE Indicates the model should return images.
AUDIO Indicates the model should return audio.

SpeechConfig

Config for speech generation and transcription.

ক্ষেত্র
voiceConfig object ( VoiceConfig )

The configuration in case of single-voice output.

multiSpeakerVoiceConfig object ( MultiSpeakerVoiceConfig )

Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voiceConfig field.

languageCode string

Optional. The IETF BCP-47 language code that the user configured the app to use. Used for speech recognition and synthesis.

Valid values are: de-DE , en-AU , en-GB , en-IN , en-US , es-US , fr-FR , hi-IN , pt-BR , ar-XA , es-ES , fr-CA , id-ID , it-IT , ja-JP , tr-TR , vi-VN , bn-IN , gu-IN , kn-IN , ml-IN , mr-IN , ta-IN , te-IN , nl-NL , ko-KR , cmn-CN , pl-PL , ru-RU , and th-TH .

JSON representation
{
  "voiceConfig": {
    object (VoiceConfig)
  },
  "multiSpeakerVoiceConfig": {
    object (MultiSpeakerVoiceConfig)
  },
  "languageCode": string
}

VoiceConfig

The configuration for the voice to use.

ক্ষেত্র
voice_config Union type
The configuration for the speaker to use. voice_config can be only one of the following:
prebuiltVoiceConfig object ( PrebuiltVoiceConfig )

The configuration for the prebuilt voice to use.

JSON representation
{

  // voice_config
  "prebuiltVoiceConfig": {
    object (PrebuiltVoiceConfig)
  }
  // Union type
}

PrebuiltVoiceConfig

The configuration for the prebuilt speaker to use.

ক্ষেত্র
voiceName string

The name of the preset voice to use.

JSON representation
{
  "voiceName": string
}

MultiSpeakerVoiceConfig

The configuration for the multi-speaker setup.

ক্ষেত্র
speakerVoiceConfigs[] object ( SpeakerVoiceConfig )

Required. All the enabled speaker voices.

JSON representation
{
  "speakerVoiceConfigs": [
    {
      object (SpeakerVoiceConfig)
    }
  ]
}

SpeakerVoiceConfig

The configuration for a single speaker in a multi speaker setup.

ক্ষেত্র
speaker string

Required. The name of the speaker to use. Should be the same as in the prompt.

voiceConfig object ( VoiceConfig )

Required. The configuration for the voice to use.

JSON representation
{
  "speaker": string,
  "voiceConfig": {
    object (VoiceConfig)
  }
}

ThinkingConfig

Config for thinking features.

ক্ষেত্র
includeThoughts boolean

Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.

thinkingBudget integer

The number of thoughts tokens that the model should generate.

thinkingLevel enum ( ThinkingLevel )

Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the Thinking levels guide for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error.

JSON representation
{
  "includeThoughts": boolean,
  "thinkingBudget": integer,
  "thinkingLevel": enum (ThinkingLevel)
}

ThinkingLevel

Allow user to specify how much to think using enum instead of integer budget.

এনাম
THINKING_LEVEL_UNSPECIFIED Default value.
MINIMAL Little to no thinking.
LOW Low thinking level.
MEDIUM Medium thinking level.
HIGH High thinking level.

ImageConfig

Config for image generation features.

ক্ষেত্র
aspectRatio string

Optional. The aspect ratio of the image to generate. Supported aspect ratios: 1:1 , 1:4 , 4:1 , 1:8 , 8:1 , 2:3 , 3:2 , 3:4 , 4:3 , 4:5 , 5:4 , 9:16 , 16:9 , or 21:9 .

If not specified, the model will choose a default aspect ratio based on any reference images provided.

imageSize string

Optional. Specifies the size of generated images. Supported values are 512 , 1K , 2K , 4K . If not specified, the model will use default value 1K .

JSON representation
{
  "aspectRatio": string,
  "imageSize": string
}

MediaResolution

Media resolution for the input media.

এনাম
MEDIA_RESOLUTION_UNSPECIFIED Media resolution has not been set.
MEDIA_RESOLUTION_LOW Media resolution set to low (64 tokens).
MEDIA_RESOLUTION_MEDIUM Media resolution set to medium (256 tokens).
MEDIA_RESOLUTION_HIGH Media resolution set to high (zoomed reframing with 256 tokens).

ResponseFormatConfig

Configuration for the response output format. This is a flat object where each optional sub-field configures a specific output modality.

ক্ষেত্র
text object ( TextResponseFormat )

Optional. Text output format configuration.

audio object ( AudioResponseFormat )

Optional. Audio output format configuration.

image object ( ImageResponseFormat )

Optional. Image output format configuration.

JSON representation
{
  "text": {
    object (TextResponseFormat)
  },
  "audio": {
    object (AudioResponseFormat)
  },
  "image": {
    object (ImageResponseFormat)
  }
}

TextResponseFormat

Configuration for text output format.

ক্ষেত্র
mimeType enum ( MimeType )

Optional. The MIME type of the text output.

schema value ( Value format)

Optional. The JSON schema that the output should conform to. Only applicable when mimeType is APPLICATION_JSON.

JSON representation
{
  "mimeType": enum (MimeType),
  "schema": value
}

MimeType

Supported MIME types for text output.

এনাম
MIME_TYPE_UNSPECIFIED Default value. This value is unused.
APPLICATION_JSON JSON output format.
TEXT_PLAIN Plain text output format.

AudioResponseFormat

Configuration for audio output format.

ক্ষেত্র
mimeType enum ( MimeType )

Optional. The MIME type of the audio output.

delivery enum ( Delivery )

Optional. The delivery mode for the audio output.

sampleRate integer

Optional. Sample rate in Hz.

bitRate integer

Optional. Bit rate in bits per second (bps). Only applicable for compressed formats (MP3, Opus).

JSON representation
{
  "mimeType": enum (MimeType),
  "delivery": enum (Delivery),
  "sampleRate": integer,
  "bitRate": integer
}

MimeType

Supported MIME types for audio output.

এনাম
MIME_TYPE_UNSPECIFIED Default value. This value is unused.
AUDIO_MP3 MP3 audio format.
AUDIO_OGG_OPUS OGG Opus audio format.
AUDIO_L16 Raw PCM (L16) audio format.
AUDIO_WAV WAV audio format.
AUDIO_ALAW A-law audio format.
AUDIO_MULAW Mu-law audio format.

ডেলিভারি

Delivery mode for audio output.

এনাম
DELIVERY_UNSPECIFIED Default value. This value is unused.
INLINE Audio data is returned inline in the response.
URI Audio data is returned as a URI.

ImageResponseFormat

Configuration for image output format.

ক্ষেত্র
mimeType enum ( MimeType )

Optional. The MIME type of the image output.

delivery enum ( Delivery )

Optional. The delivery mode for the image output.

aspectRatio enum ( AspectRatio )

Optional. The aspect ratio for the image output.

imageSize enum ( ImageSize )

Optional. The size of the image output.

JSON representation
{
  "mimeType": enum (MimeType),
  "delivery": enum (Delivery),
  "aspectRatio": enum (AspectRatio),
  "imageSize": enum (ImageSize)
}

MimeType

Supported MIME types for image output.

এনাম
MIME_TYPE_UNSPECIFIED Default value. This value is unused.
IMAGE_JPEG JPEG image format.

ডেলিভারি

Delivery mode for image output.

এনাম
DELIVERY_UNSPECIFIED Default value. This value is unused.
INLINE Image data is returned inline in the response.
URI Image data is returned as a URI.

AspectRatio

Supported aspect ratios for image output.

এনাম
ASPECT_RATIO_UNSPECIFIED Default value. This value is unused.
ASPECT_RATIO_ONE_BY_ONE 1:1 aspect ratio.
ASPECT_RATIO_TWO_BY_THREE 2:3 aspect ratio.
ASPECT_RATIO_THREE_BY_TWO 3:2 aspect ratio.
ASPECT_RATIO_THREE_BY_FOUR 3:4 aspect ratio.
ASPECT_RATIO_FOUR_BY_THREE 4:3 aspect ratio.
ASPECT_RATIO_FOUR_BY_FIVE 4:5 aspect ratio.
ASPECT_RATIO_FIVE_BY_FOUR 5:4 aspect ratio.
ASPECT_RATIO_NINE_BY_SIXTEEN 9:16 aspect ratio.
ASPECT_RATIO_SIXTEEN_BY_NINE 16:9 aspect ratio.
ASPECT_RATIO_TWENTY_ONE_BY_NINE 21:9 aspect ratio.
ASPECT_RATIO_ONE_BY_EIGHT 1:8 aspect ratio.
ASPECT_RATIO_EIGHT_BY_ONE 8:1 aspect ratio.
ASPECT_RATIO_ONE_BY_FOUR 1:4 aspect ratio.
ASPECT_RATIO_FOUR_BY_ONE 4:1 aspect ratio.

ImageSize

Supported image sizes for image output.

এনাম
IMAGE_SIZE_UNSPECIFIED Default value. This value is unused.
IMAGE_SIZE_FIVE_TWELVE 512px image size.
IMAGE_SIZE_ONE_K 1K image size.
IMAGE_SIZE_TWO_K 2K image size.
IMAGE_SIZE_FOUR_K 4K image size.

TranslationConfig

Config for translation features.

ক্ষেত্র
targetLanguageCode string

Required. The target language for translation. Supported values are BCP-47 language codes (eg "en", "es", "fr").

echoTargetLanguage boolean

Optional. If true, the model will generate audio when the target language is spoken, essentially it will parrot the input. If false, we will not produce audio for the target language.

JSON উপস্থাপনা
{
  "targetLanguageCode": string,
  "echoTargetLanguage": boolean
}

RealtimeInputConfig

Configures the realtime input behavior in BidiGenerateContent .

ক্ষেত্র
automaticActivityDetection object ( AutomaticActivityDetection )

Optional. If not set, automatic activity detection is enabled by default. If automatic voice detection is disabled, the client must send activity signals.

activityHandling enum ( ActivityHandling )

Optional. Defines what effect activity has.

turnCoverage enum ( TurnCoverage )

Optional. Defines which input is included in the user's turn.

JSON representation
{
  "automaticActivityDetection": {
    object (AutomaticActivityDetection)
  },
  "activityHandling": enum (ActivityHandling),
  "turnCoverage": enum (TurnCoverage)
}

AutomaticActivityDetection

Configures automatic detection of activity.

ক্ষেত্র
disabled boolean

Optional. If enabled (the default), detected voice and text input count as activity. If disabled, the client must send activity signals.

startOfSpeechSensitivity enum ( StartSensitivity )

Optional. Determines how likely speech is to be detected.

prefixPaddingMs integer

Optional. The required duration of detected speech before start-of-speech is committed. The lower this value, the more sensitive the start-of-speech detection is and shorter speech can be recognized. However, this also increases the probability of false positives.

endOfSpeechSensitivity enum ( EndSensitivity )

Optional. Determines how likely detected speech is ended.

silenceDurationMs integer

Optional. The required duration of detected non-speech (eg silence) before end-of-speech is committed. The larger this value, the longer speech gaps can be without interrupting the user's activity but this will increase the model's latency.

JSON representation
{
  "disabled": boolean,
  "startOfSpeechSensitivity": enum (StartSensitivity),
  "prefixPaddingMs": integer,
  "endOfSpeechSensitivity": enum (EndSensitivity),
  "silenceDurationMs": integer
}

StartSensitivity

Determines how start of speech is detected.

এনাম
START_SENSITIVITY_UNSPECIFIED The default is START_SENSITIVITY_HIGH.
START_SENSITIVITY_HIGH Automatic detection will detect the start of speech more often.
START_SENSITIVITY_LOW Automatic detection will detect the start of speech less often.

EndSensitivity

Determines how end of speech is detected.

এনাম
END_SENSITIVITY_UNSPECIFIED The default is END_SENSITIVITY_HIGH.
END_SENSITIVITY_HIGH Automatic detection ends speech more often.
END_SENSITIVITY_LOW Automatic detection ends speech less often.

ActivityHandling

The different ways of handling user activity.

এনাম
ACTIVITY_HANDLING_UNSPECIFIED If unspecified, the default behavior is START_OF_ACTIVITY_INTERRUPTS .
START_OF_ACTIVITY_INTERRUPTS If true, start of activity will interrupt the model's response (also called "barge in"). The model's current response will be cut-off in the moment of the interruption. This is the default behavior.
NO_INTERRUPTION The model's response will not be interrupted.

TurnCoverage

Options about which input is included in the user's turn.

এনাম
TURN_COVERAGE_UNSPECIFIED If unspecified, a default behavior is selected based on the model. Eg, for Gemini 2.5, the default is TURN_INCLUDES_ONLY_ACTIVITY , while for Gemini 3.1 and onwards, it's TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO .
TURN_INCLUDES_ONLY_ACTIVITY Includes activity since the last turn, excluding inactivity (eg silence on the audio stream).
TURN_INCLUDES_ALL_INPUT Includes all realtime input since the last turn, including inactivity (eg silence on the audio stream).
TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO Includes audio activity and all video since the last turn. With automatic activity detection, audio activity means speech and excludes silence.

SessionResumptionConfig

Session resumption configuration.

This message is included in the session configuration as BidiGenerateContentSetup.session_resumption . If configured, the server will send SessionResumptionUpdate messages.

ক্ষেত্র
handle string

The handle of a previous session. If not present then a new session is created.

Session handles come from SessionResumptionUpdate.token values in previous connections.

JSON representation
{
  "handle": string
}

ContextWindowCompressionConfig

Enables context window compression — a mechanism for managing the model's context window so that it does not exceed a given length.

ক্ষেত্র
compression_mechanism Union type
The context window compression mechanism used. compression_mechanism can be only one of the following:
slidingWindow object ( SlidingWindow )

A sliding-window mechanism.

triggerTokens string ( int64 format)

The number of tokens (before running a turn) required to trigger a context window compression.

This can be used to balance quality against latency as shorter context windows may result in faster model responses. However, any compression operation will cause a temporary latency increase, so they should not be triggered frequently.

If not set, the default is 80% of the model's context window limit. This leaves 20% for the next user request/model response.

JSON representation
{

  // compression_mechanism
  "slidingWindow": {
    object (SlidingWindow)
  }
  // Union type
  "triggerTokens": string
}

SlidingWindow

The SlidingWindow method operates by discarding content at the beginning of the context window. The resulting context will always begin at the start of a USER role turn. System instructions and any BidiGenerateContentSetup.prefix_turns will always remain at the beginning of the result.

ক্ষেত্র
targetTokens string ( int64 format)

The target number of tokens to keep. The default value is triggerTokens/2.

Discarding parts of the context window causes a temporary latency increase so this value should be calibrated to avoid frequent compression operations.

JSON representation
{
  "targetTokens": string
}

AudioTranscriptionConfig

The audio transcription configuration.

ক্ষেত্র
adaptationPhrases[]
(deprecated)
string

Optional. A list of phrases used for speech adaptation, which biases the ASR model to improve recognition of these specific terms.

customVocabulary[] string

Optional. A list of custom vocabulary phrases to bias the speech recognition model toward recognizing specific terms (product names, proper nouns, jargon).

language_config Union type
The language config for the audio transcription. For ASR models, it is required, an error will be returned if not set. language_config can be only one of the following:
languageAuto object ( LanguageAuto )

Optional. The model will detect the language automatically.

languageHints object ( LanguageHints )

Optional. Specifies one or more languages in the audio.

JSON representation
{
  "adaptationPhrases": [
    string
  ],
  "customVocabulary": [
    string
  ],

  // language_config
  "languageAuto": {
    object (LanguageAuto)
  },
  "languageHints": {
    object (LanguageHints)
  }
  // Union type
}

ল্যাঙ্গুয়েজঅটো

This type has no fields.

Indicates the language of the audio should be automatically detected.

ল্যাঙ্গুয়েজহিন্টস

Provides hints to the model about possible languages present in the audio.

ক্ষেত্র
languageCodes[] string

Required. BCP-47 language codes.

JSON representation
{
  "languageCodes": [
    string
  ]
}

HistoryConfig

History configuration.

This message is included in the session configuration as BidiGenerateContentSetup.history_config . Configures the exchange of history messages.

ক্ষেত্র
initialHistoryInClientContent boolean

Optional. If true, after sending setupComplete , the server will wait and at first process clientContent messages until turnComplete is true . This initial history will not trigger a model call and may end with role MODEL . After turnComplete is true , the client can start the realtime conversation via realtimeInput .

JSON representation
{
  "initialHistoryInClientContent": boolean
}

Method: auth_tokens.create

Creates a token that can be used to constrain the behavior of a BidiGenerateContent session.

এন্ডপয়েন্ট

post https: / /generativelanguage.googleapis.com /v1beta /auth_tokens

অনুরোধকারী শরীর

The request body contains an instance of AuthToken .

ক্ষেত্র
expireTime string ( Timestamp format)

Optional. Input only. Immutable. An optional time after which, when using the resulting token, messages in BidiGenerateContent sessions will be rejected. (Gemini may preemptively close the session after this time.)

If not set then this defaults to 30 minutes in the future. If set, this value must be less than 20 hours in the future.

RFC 3339 ব্যবহার করা হয়, যেখানে তৈরি হওয়া আউটপুট সর্বদা Z-নরম্যালাইজড হবে এবং এতে ০, ৩, ৬ বা ৯টি ভগ্নাংশীয় অঙ্ক ব্যবহৃত হবে। "Z" ছাড়াও অন্যান্য অফসেটও গ্রহণ করা হয়। উদাহরণ: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" অথবা "2014-10-02T15:01:23+05:30"

newSessionExpireTime string ( Timestamp format)

Optional. Input only. Immutable. The time after which new Live API sessions using the token resulting from this request will be rejected.

If not set this defaults to 60 seconds in the future. If set, this value must be less than 20 hours in the future.

RFC 3339 ব্যবহার করা হয়, যেখানে তৈরি হওয়া আউটপুট সর্বদা Z-নরম্যালাইজড হবে এবং এতে ০, ৩, ৬ বা ৯টি ভগ্নাংশীয় অঙ্ক ব্যবহৃত হবে। "Z" ছাড়াও অন্যান্য অফসেটও গ্রহণ করা হয়। উদাহরণ: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" অথবা "2014-10-02T15:01:23+05:30"

fieldMask string ( FieldMask format)

Optional. Input only. Immutable. If fieldMask is empty, and bidiGenerateContentSetup is not present, then the effective BidiGenerateContentSetup message is taken from the Live API connection.

If fieldMask is empty, and bidiGenerateContentSetup is present, then the effective BidiGenerateContentSetup message is taken entirely from bidiGenerateContentSetup in this request. The setup message from the Live API connection is ignored.

If fieldMask is not empty, then the corresponding fields from bidiGenerateContentSetup will overwrite the fields from the setup message in the Live API connection.

এটি ফিল্ডগুলোর পূর্ণাঙ্গ নামের একটি কমা-দ্বারা-বিভক্ত তালিকা। উদাহরণ: "user.displayName,photo"

config Union type
The method-specific configuration for the resulting token. config can be only one of the following:
bidiGenerateContentSetup object ( BidiGenerateContentSetup )

Optional. Input only. Immutable. Configuration specific to BidiGenerateContent .

uses integer

Optional. Input only. Immutable. The number of times the token can be used. If this value is zero then no limit is applied. Resuming a Live API session does not count as a use. If unspecified, the default is 1.

প্রতিক্রিয়া সংস্থা

If successful, the response body contains a newly created instance of AuthToken .