Skip to main content

Inference via API

Generate predictions with models


tip

Click here for additional examples on how to perform model predictions using various SDKs — such as the Clarifai SDK, OpenAI client, and LiteLLM. The examples demonstrate various model types and include both streaming and non-streaming modes, as well as tool calling capabilities.

Prerequisites

Install Clarifai Packages

 pip install --upgrade clarifai 
  • Install the latest version of the Clarifai Node.js SDK package.
 npm install clarifai-nodejs 

Get a PAT Key

You need a PAT (Personal Access Token) key to authenticate your connection to the Clarifai platform. You can get one by navigating to Settings in the collapsible left sidebar, selecting Secrets, and creating or copying an existing token from there.

You can then set the PAT as an environment variable using CLARIFAI_PAT. This also authenticates your session when using the Clarifai’s CLI.

Note: Storing your PAT in an environment variable is more secure than hardcoding it directly in your code.

 export CLARIFAI_PAT=YOUR_PERSONAL_ACCESS_TOKEN_HERE 

Prediction Tips

Set Up Dedicated Deployment

To use our dedicated Compute Orchestration capabilities, ensure your model is deployed. Then, specify the deployment_id parameter — alternatively, you can specify both compute_cluster_id and nodepool_id, as explained here.

info

For dedicated deployments owned by an organization, alongside the deployment_id, also provide the organization ID as the Model's deployment_user_id.

model = Model(
url="MODEL_URL_HERE",
deployment_id="DEPLOYMENT_ID_HERE",
# if you are targeting a specific deployment owned by an organization:
# deployment_user_id="ORGANIZATION_ID_HERE",
# Or, set cluster and nodepool
# compute_cluster_id = "COMPUTE_CLUSTER_ID_HERE",
# nodepool_id = "NODEPOOL_ID_HERE"
)

Initialize the Model Client

You can initialize the model client using either explicit IDs or the full model URL.

Note: By default, the latest version of the model is used for inference. However, you can specify a different version when initializing the model.

from clarifai.client import Model

# Initialize with explicit IDs
model = Model(user_id="model_user_id", app_id="model_app_id", model_id="model_id")

# Or initialize with model URL
model = Model(url="https://clarifai.com/model_user_id/model_app_id/models/model_id")

# Specify a model version
model = Model(url="https://clarifai.com/model_user_id/model_app_id/models/model_id/model_version/model_version_id")

# Or specify using the model_version parameter
model = Model(url="https://clarifai.com/model_user_id/model_app_id/models/model_id", model_version = {"id": "model_version_id"})

Set Up Inference Parameters

You can configure various inference parameters to customize your prediction requests to better suit your use case.

Here is an example using the max_tokens parameter:

response = model.predict(
prompt="What is photosynthesis?",
max_tokens=1024
)

Unary-Unary Predict Call

This is the simplest form of prediction: a single input is sent to the model, and a single response is returned. It’s ideal for quick, non-streaming tasks, such as classifying an image or analyzing a short piece of text.

NOTE: Streaming means that the response is streamed back token by token, rather than waiting for the entire completion to be generated before returning. This is useful for building interactive applications where you want to display the response as it's being generated.

Text Inputs

Here is an example of a model signature configured on the server side for handling text inputs:

@ModelClass.method
def predict(self, prompt: str = "") -> str:

Here’s how you can make a corresponding unary-unary predict call from the client side:

from clarifai.client import Model

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="https://clarifai.com/openai/chat-completion/models/o4-mini",
# deployment_id="DEPLOYMENT_ID_HERE"
)

response = model.predict("What is photosynthesis?")
# Or
# response = model.predict(prompt="What is photosynthesis?")

print(response)
Example Output
Photosynthesis is the process by which certain organisms—primarily plants, algae, and some bacteria—convert light energy (usually from the sun) into chemical energy stored in sugars. In essence, these organisms capture carbon dioxide (CO₂) from the air and water (H₂O) from the soil, then use sunlight to drive a series of reactions that produce oxygen (O₂) as a by-product and synthesize glucose (C₆H₁₂O₆) or related carbohydrates.

Key points:

1. Light absorption
• Chlorophyll and other pigments in chloroplasts (in plants and algae) absorb photons, elevating electrons to higher energy states.

2. Light-dependent reactions (in thylakoid membranes)
• Convert light energy into chemical energy in the form of ATP and NADPH.
• Split water molecules, releasing O₂.

3. Calvin cycle (light-independent reactions, in the stroma)
• Use ATP and NADPH to fix CO₂ into organic molecules.
• Produce glyceraldehyde-3-phosphate (G3P), which can be converted into glucose and other carbs.

Overall simplified equation:
6 CO₂ + 6 H₂O + light energy → C₆H₁₂O₆ + 6 O₂

Importance:
• Generates the oxygen we breathe.
• Forms the base of most food chains by producing organic matter.
• Plays a critical role in the global carbon cycle and helps mitigate CO₂ in the atmosphere.

Image Inputs

Image-to-Text

Here is an example of a model signature configured on the server side for handling image inputs:

@ModelClass.method
def predict(self, image: Image) -> str:

Here’s how you can make a corresponding unary-unary predict call from the client side:

from clarifai.client import Model
from clarifai.runners.utils.data_types import Image

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="https://clarifai.com/openai/chat-completion/models/o4-mini",
# deployment_id="DEPLOYMENT_ID_HERE"
)

response = model.predict(
prompt="Describe the image",
image=Image(url="https://samples.clarifai.com/cat1.jpeg")
)

print(response)

"""
# --- Predict using an image uploaded from a local machine ---

# 1. Specify the path to your local image file
local_image_path = "path/to/your/image.jpg" # Replace with the actual path to your image

# 2. Read the image file into bytes
with open(local_image_path, "rb") as f:
image_bytes = f.read()

response = model.predict(
prompt="Describe the image",
# Provide Image as bytes
image=Image(bytes=image_bytes)
)

print(response)

# You can also convert a Pillow (PIL) Image object into a Clarifai Image data type
# image=Image.from_pil(pil_image)

"""
Example Output
The image shows a young ginger tabby cat lying on its side against what looks like a rough, earth-toned wall. Its coat is a warm orange with classic darker orange stripe markings. The cat’s front paw is tucked in, and its head rests on the surface below, with its large amber eyes gazing directly toward the viewer. The lighting is soft, highlighting the cat’s whiskers, ear fur, and the texture of its velvety coat. Overall, the scene feels calm and slightly curious, as if the cat has paused mid-nap to watch something interesting.

Visual Segmentation

Note: The following visual segmentation examples use Matplotlib, Pillow, and NumPy. You can install them by running: pip install matplotlib Pillow numpy.

Example 1

Here is an example of a model signature configured on the server side for automatic mask generation:

@ModelClass.method
def segment_anything(image: data_types.Image) -> List[data_types.Region]:

Here’s how to make a corresponding unary-unary predict call from the client side to generate masks for all objects in a given image.

import matplotlib.pyplot as plt
from clarifai.runners.utils.data_types import Image
from clarifai.client import Model
from PIL import Image as PILImage

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize the model
model = Model(
url="https://clarifai.com/meta/segment-anything/models/sam2_1-hiera-base-plus",
#deployment_id="DEPLOYMENT_ID_HERE"
)

# Load input image from URL
input_image = Image(url="https://samples.clarifai.com/cat1.jpeg")
#Or, load from local file: input_image = Image.from_pil(PILImage.open("path/to/image.png"))

# Run segmentation: returns a list of Region objects
regions = model.segment_anything(image=input_image)

# Loop through each Region, extract its mask, and display it
for idx, region in enumerate(regions):
mask = region.mask
#mask = Image.from_proto(region.mask.proto) # Alternative low-level access
# region.mask is a Clarifai Image object; convert it to a NumPy array for visualization
mask_array = mask.to_numpy()

# Plot the mask with matplotlib
plt.figure(figsize=(5, 5))
plt.imshow(mask_array, cmap='gray')
plt.title(f"Mask {idx + 1}")
plt.axis('off')
plt.show()

# Print progress
print(f"Processed mask {idx + 1} out of {len(regions)}")

# Optional: do anything else with mask_array here
# (e.g., save to disk, overlay on the original image, etc.)
Example 2

Here is an example of a model signature configured on the server side for creating masks in a given image:

@ModelClass.method
def predict(image: data_types.Image, regions: List[data_types.Region], dict_inputs: data_types.JSON, round_mask: bool = False, multimask_output: bool = False, denormalize_coord: bool = True) -> List[data_types.Region]:

Here’s how to make a corresponding unary-unary predict call from the client side to generate masks using a points or boxes prompt.

import matplotlib.pyplot as plt
from PIL import Image as PILImage
from clarifai.client import Model
from clarifai.runners.utils.data_types import Image, Region, Concept

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize the model
model = Model(
url="https://clarifai.com/meta/segment-anything/models/sam2_1-hiera-base-plus",
#deployment_id="DEPLOYMENT_ID_HERE"
)

input_image = Image(url="https://samples.clarifai.com/cat1.jpeg")
# Load input image from local file
#input_image = Image.from_pil(PILImage.open("path/to/image.png"))

# Point-based input (Region form)
point_prompt_regions = [
Region(point=[0.1, 0.2, 0.0], concepts=[Concept(name="1", value=1.0)]),
Region(point=[0.2, 0.3, 0.0], concepts=[Concept(name="0", value=0.0)])
]

regions = model.predict(image=input_image, regions=point_prompt_regions)

# # Optional: use dict format instead
# point_prompt_dict = dict(points=[[0.1, 0.2], [0.2, 0.3]], labels=[1, 0])
# regions = model.predict(image=input_image, dict_inputs=point_prompt_dict)

# Box-based input (Region form)
# box_prompt_regions = [Region(box=[0.1, 0.2, 0.3, 0.4])]
# regions = model.predict(image=input_image, regions=box_prompt_regions)

# # Optional: use dict format instead
# box_prompt_dict = dict(box=[0.1, 0.2, 0.3, 0.4])
# regions = model.predict(image=input_image, dict_inputs=box_prompt_dict)

# Visualize each predicted mask
for idx, region in enumerate(regions):
mask = region.mask
#mask = Image.from_proto(region.mask.proto) # Alternative low-level access
# region.mask is a Clarifai Image object; convert it to a NumPy array for visualization
mask_array = mask.to_numpy()

# Plot the mask with matplotlib
plt.figure(figsize=(5, 5))
plt.imshow(mask_array, cmap='gray')
plt.title(f"Mask {idx + 1}")
plt.axis('off')
plt.show()

# Print progress
print(f"Processed mask {idx + 1} out of {len(regions)}")

# Optional: do anything else with mask_array here
# (e.g., save to disk, overlay on the original image, etc.)
tip

Click here to explore how to make predictions with other data types.

Unary-Stream Predict Call

This call sends a single input to the model but returns a stream of responses. This is especially useful for tasks that produce multiple outputs from one input, such as generating text completions or progressive predictions from a prompt.

Text Inputs

Here is an example of a model signature configured on the server side for handling text inputs:

@ModelClass.method
def generate(self, prompt: str) -> Iterator[str]:

Here’s how you can make a corresponding unary-stream predict call from the client side:

from clarifai.client import Model

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="https://clarifai.com/openai/chat-completion/models/o4-mini",
# deployment_id="DEPLOYMENT_ID_HERE"
)

response_stream = model.generate(
prompt="Explain quantum computing in simple terms"
)

for text_chunk in response_stream:
print(text_chunk, end="", flush=True)

"""
# --- Load prompt text from URL ---

prompt_from_url = requests.get("https://samples.clarifai.com/featured-models/redpajama-economic.txt") # Remember to import requests
prompt_text = prompt_from_url.text.strip()

response_stream = model.generate(
prompt=prompt_text
)

for text_chunk in response_stream:
print(text_chunk, end="", flush=True)

"""

Image Inputs

Here is an example of a model signature configured on the server side for handling image inputs:

@ModelClass.method
def generate(self, image: Image) -> Iterator[str]:

Here’s how you can make a corresponding unary-stream predict call from the client side:

from clarifai.client import Model
from clarifai.runners.utils.data_types import Image

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="https://clarifai.com/openai/chat-completion/models/o4-mini",
# deployment_id="DEPLOYMENT_ID_HERE"
)

response_stream = model.generate(
prompt="Describe the image",
image=Image(url="https://samples.clarifai.com/cat1.jpeg")
)

for text_chunk in response_stream:
print(text_chunk, end="", flush=True)


"""
# --- Predict using an image uploaded from a local machine ---

# 1. Specify the path to your local image file
local_image_path = "path/to/your/image.jpg" # Replace with the actual path to your image

# 2. Read the image file into bytes
with open(local_image_path, "rb") as f:
image_bytes = f.read()

response_stream = model.generate(
prompt="Describe the image",
# Provide Image as bytes
image=Image(bytes=image_bytes)
)

for text_chunk in response_stream:
print(text_chunk, end="", flush=True)

# You can also convert a Pillow (PIL) Image object into a Clarifai Image data type
# image=Image.from_pil(pil_image)

"""

Video Inputs

Note: The following video tracking example uses Matplotlib and NumPy. You can install them by running: pip install matplotlib numpy.

Here is an example of a model signature configured on the server side for handling video inputs:

@ModelClass.method
def generate(video: data_types.Video, frames: List[data_types.Frame], list_dict_inputs: List[data_types.JSON], denormalize_coord: bool = True) -> Iterator[data_types.Frame]:

Here’s how to make a corresponding unary-stream predict call from the client side to track objects in a video:

import matplotlib.pyplot as plt
from clarifai.client import Model
from clarifai.runners.utils.data_types import Video, Region, Concept, Frame

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize the model
model = Model(
url="https://clarifai.com/meta/segment-anything/models/sam2_1-hiera-base-plus",
#deployment_id="DEPLOYMENT_ID_HERE"
)

# Load video from a URL
video = Video(url="https://samples.clarifai.com/beer.mp4")

# Or: load from local file
# video_path = "path/to/video.mp4"
# with open(video_path, "rb") as f:
# video = Video(bytes=f.read())

# Define frame-level prompts using Regions with track IDs
frame0 = Frame(
regions=[
Region(point=[0.1, 0.2, 0.0], concepts=[Concept(name="1", value=1.0)], track_id="1"),
Region(point=[0.2, 0.3, 0.0], concepts=[Concept(name="0", value=0.0)], track_id="1"),
]
)
frame0.proto.frame_info.index = 0

frame1 = Frame(
regions=[
Region(point=[0.11, 0.22, 0.0], concepts=[Concept(name="1", value=1.0)], track_id="2"),
Region(point=[0.22, 0.33, 0.0], concepts=[Concept(name="0", value=0.0)], track_id="2"),
]
)
frame1.proto.frame_info.index = 1

# Generate masks using the frame-based approach
output_frames = model.generate(video=video, frames=[frame0, frame1])

# Alternatively, use `list_dict_inputs` instead
# frame_objs = [
# dict(
# points=[[0.1, 0.2], [0.2, 0.3]],
# box=None,
# obj_id=0,
# labels=[1, 0],
# frame_idx=0
# ),
# dict(
# points=[[0.11, 0.22], [0.22, 0.33]],
# box=None,
# obj_id=1,
# labels=[1, 0],
# frame_idx=1
# ),
# ]
# output_frames = model.generate(video=video, list_dict_inputs=frame_objs)

# Visualize the output masks
for frame_idx, frame in enumerate(output_frames):
for region_idx, region in enumerate(frame.regions):
mask = region.mask # Clarifai Image object
track_id = region.track_id

# Convert mask to NumPy array
mask_array = mask.to_numpy()

# Show the mask
plt.figure(figsize=(5, 5))
plt.imshow(mask_array, cmap='gray')
plt.title(f"Frame {frame_idx}, Region {region_idx}, Track ID: {track_id}")
plt.axis('off')
plt.show()

print(f"Displayed mask for Frame {frame_idx}, Track ID: {track_id}")

Stream-Stream Predict Call

This call enables bidirectional streaming of both inputs and outputs, making it ideal for real-time applications and processing large datasets.

In this setup, multiple inputs can be continuously streamed to the model, while predictions are returned in real time. It’s especially useful for use cases like live video analysis or streaming sensor data.

Text Inputs

Here is an example of a model signature configured on the server side for handling text inputs:

@ModelClass.method
def stream(self, input_iterator: Iterator[str]) -> Iterator[str]:

Here’s how you can make a corresponding stream-stream predict call from the client side:

from clarifai.client import Model
from clarifai.runners.utils.data_types import Text

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="MODEL_URL_HERE",
# deployment_id="YOUR_DEPLOYMENT_ID_HERE"
)

# Create a list of input Texts to simulate a stream
input_texts = iter([
Text(text="First input."),
Text(text="Second input."),
Text(text="Third input.")
])

# Call the stream method and process outputs
response_iterator = model.stream(input_texts)

# Print streamed results
print("Streaming output:\n")
for response in response_iterator:
print(response.text)

Audio Inputs

Here is an example of a model signature configured on the server side for handling audio inputs:

@ModelClass.method
def transcribe_audio(self, audio: Iterator[Audio]) -> Iterator[Text]:

Here’s how you can make a corresponding stream-stream predict call from the client side:

from clarifai.client import Model
from clarifai.runners.utils.data_types import Audio

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="MODEL_URL_HERE",
# deployment_id="DEPLOYMENT_ID_HERE"
)

# client-side streaming
response_stream = model.transcribe_audio(
audio=iter(Audio(bytes=b''))
# Or, provide audio as URL
# audio=Audio(url="https://example.com/audio.mp3")
)

for text_chunk in response_stream:
print(text_chunk.text, end="", flush=True)

Multimodal Predictions

You can make predictions using models that support multimodal inputs, such as a combination of images and text.

Here is an example:

from clarifai.client import Model
from clarifai.runners.utils.data_types import Image

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize model
model = Model(
url="https://clarifai.com/openai/chat-completion/models/o4-mini",
# deployment_id="DEPLOYMENT_ID_HERE"
)

# Perform prediction with prompt and image
result = model.predict(
prompt="Describe this image",
image=Image(url="https://samples.clarifai.com/metro-north.jpg"),
max_tokens=1024
)

# Print the prediction result
print(result)

Batch Prediction Handling

Clarifai’s model framework seamlessly supports both single and batch predictions through a unified interface. It can adapt to the input format, so no code changes are needed.

The system automatically detects the type of input provided:

  • If you pass a single input, it’s treated as a singleton batch;

  • If you pass multiple inputs as a list, they are handled as a parallel batch.

This means you can pass either a single input or a list of inputs, and the system will automatically process them appropriately — making your code cleaner and more flexible.

Text Inputs

Here’s how you can perform batch predictions with text inputs.

from clarifai.client import Model
from clarifai.runners.utils.data_types import Text

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="https://clarifai.com/openai/chat-completion/models/gpt-oss-120b",
# deployment_id="DEPLOYMENT_ID_HERE"
)

# Prepare batch inputs using standard Python STRINGS for the prompt value
inputs = [
{"prompt": "Write a short positive review about a new sci-fi movie."},
{"prompt": "Write a short negative review about a new sci-fi movie."},
{"prompt": "Write a short neutral review about a new sci-fi movie."},
]

# Run batch prediction
batch_results = model.predict(inputs)

# Print output results in a readable format
print("Batch Prediction Results:\n")
for i, result in enumerate(batch_results):
print(f"Input {i+1}:")
print(result)
print("-" * 40)
Example Output
Batch Prediction Results:

Input 1:
**Review: “Starlight Frontier” – A Thrilling Leap Into the Cosmos**

“Starlight Frontier” bursts onto the screen with the kind of bold imagination that reminds us why sci‑fi is the genre of limitless possibility. Director Maya Chen crafts a sleek, high‑octane adventure that balances jaw‑dropping visual spectacle with a surprisingly heartfelt story.

The film’s world‑building is nothing short of spectacular. From the neon‑lit megacities of the orbital colonies to the hauntingly beautiful alien wastelands of the Andromeda fringe, every frame feels meticulously designed, and the cutting‑edge VFX make the cosmos feel both vast and intimately lived‑in. The use of practical effects—especially the tactile, retro‑futuristic ship interiors—adds a warm, tactile layer that grounds the high‑tech spectacle.

At the heart of the narrative is a diverse crew of misfits led by the charismatic and deeply human Captain Aria (played with fierce conviction by Zoe Patel). Their chemistry is electric, and the script gives each character a genuine arc, turning what could have been a standard “save the galaxy” plot into a resonant tale about trust, sacrifice, and the search for belonging.

The pacing is spot‑on: the opening act hooks you with a pulse‑pounding chase through an asteroid field, the middle delves into a thought‑provoking mystery about an ancient alien signal, and the climax delivers a breathtaking showdown that feels earned rather than gratuitous. The score, a soaring blend of synth‑wave and orchestral motifs by composer Luis Ortega, perfectly amplifies the emotional stakes without ever overwhelming the story.

What truly sets “Starlight Frontier” apart is its optimism. In a time when many sci‑fi films lean heavily into dystopia, this movie dares to imagine a future where curiosity, cooperation, and wonder still drive humanity forward. It’s a refreshing reminder that the stars are not just a backdrop for conflict, but a canvas for hope.

In short, “Starlight Frontier” is a dazzling, emotionally resonant ride that will satisfy both die‑hard genre fans and newcomers alike. It’s a must‑see that proves the future of sci‑fi cinema is bright, bold, and brimming with heart. 🚀✨
----------------------------------------
Input 2:
**Title: “Stellar Drift” – A Missed Opportunity**

I went into *Stellar Drift* with high hopes, but the film quickly proved to be a disappointing slog. The plot feels like a patchwork of overused tropes—galactic wars, a reluctant hero, and a “mysterious artifact” that never lives up to its hype. The world‑building is shallow; the supposedly intricate alien cultures are reduced to generic costume designs and vague exposition, leaving the setting feeling more like a backdrop than a living universe.

The pacing is another major flaw. The first half drags with endless exposition and lackluster dialogue, while the climax rushes through what could have been an epic showdown, leaving key character arcs unresolved. Speaking of characters, the leads are bland and underdeveloped, making it hard to care about their fates. Even the visual effects, which should be the film’s saving grace, are uneven—some scenes sparkle with vivid detail, but many look cheap and CGI‑heavy, pulling you out of the immersion.

In short, *Stellar Drift* promises a grand sci‑fi adventure but delivers a forgettable, formulaic mess. If you’re looking for something fresh and thought‑provoking, you’ll have to look elsewhere.
----------------------------------------
Input 3:
**Review: “Stellar Frontier” (2025)**

“Stellar Frontier” arrives as a competent addition to the contemporary sci‑fi catalog, delivering a blend of familiar tropes and modest ambition. The film’s premise—a crew of explorers racing against a rogue AI to secure a habitable exoplanet—offers a clear narrative hook, though the plot unfolds in a fairly predictable rhythm. The screenplay leans on standard genre beats, delivering enough twists to keep the story moving without venturing into particularly daring territory.

Visually, the movie shines. Production design and VFX teams craft convincing space vistas and sleek ship interiors that feel grounded yet imaginative. The color palette, dominated by cool blues and stark whites, reinforces the cold expanse of deep space while occasional warm tones hint at the human element.

Performances are solid across the board. The lead, Maya Patel, brings a measured intensity to her role as commander, and the supporting cast provides reliable, if not standout, contributions. Direction by Lena Ortiz maintains a steady pace, balancing action sequences with quieter character moments, though at times the pacing feels uneven, lingering on exposition before accelerating into the climax.

Overall, “Stellar Frontier” is a well‑executed, if unremarkable, sci‑fi entry. It offers enough visual spectacle and competent storytelling to satisfy genre fans, even if it doesn’t push the boundaries of the field.
----------------------------------------

Image Inputs

Here’s how you can perform batch predictions with image inputs.

from clarifai.client import Model
from clarifai.runners.utils.data_types import Image

# Set PAT as an environment variable before running:
# export CLARIFAI_PAT=YOUR_PAT_HERE # macOS / Linux
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(
url="https://clarifai.com/openai/chat-completion/models/o4-mini"
)

# Prepare batch inputs
inputs = [
{
"prompt": "Describe the image",
"image": Image(url="https://samples.clarifai.com/cat1.jpeg")
},
{
"prompt": "Describe the image",
"image": Image(url="https://samples.clarifai.com/cat2.jpeg")
},
{
"prompt": "Describe the image",
"image": Image(url="https://samples.clarifai.com/cat3.jpeg")
},
]

# Run batch prediction
batch_results = model.predict(inputs)

# Print output results
print("Batch Prediction Results:\n")
for i, result in enumerate(batch_results):
print(f"Input {i+1}:")
print(result)
print("-" * 40)

"""
# --- Predict using an image uploaded from a local machine ---
# Replace with the actual path to your image files
image_1 = "path/to/your/image_1.jpg"
image_2 = "path/to/your/image_2.jpg"
image_3 = "path/to/your/image_3.jpg"

def load_image_bytes(path: str) -> bytes:
# Read a local image file into raw bytes.
with open(path, "rb") as f:
return f.read()

inputs_from_local = [
{
"prompt": "Describe the image",
"image": Image(bytes=load_image_bytes(image_1)),
},
{
"prompt": "Describe the image",
"image": Image(bytes=load_image_bytes(image_2)),
},
{
"prompt": "Describe the image",
"image": Image(bytes=load_image_bytes(image_3)),
},
]

# Run prediction
results_local = model.predict(inputs_from_local)

# Print results
print("\nResults from LOCAL IMAGES:\n")
for i, result in enumerate(results_local):
print(f"Image {i+1}:")
print(result)
print("-" * 40)
"""
Example Output
Results from LOCAL IMAGES:

Image 1:
The image shows a young orange tabby cat lying on its side against the base of a wall. Its body is stretched out on what looks like a smooth concrete or tiled ledge, and its front paw is gently curled under its chest. The cat’s coat is a warm, golden-orange hue marked with slightly darker, classic tabby stripes. Its amber eyes are open and gazing softly toward the viewer, and its pink nose and long white whiskers stand out against the rich color of its fur. Behind the cat you can see two different wall surfaces—one a darker, earthy brown texture and the other a lighter, off-white plaster—adding a subtle contrast to the scene. The overall lighting is soft and warm, giving the photo a cozy, relaxed atmosphere.
----------------------------------------
Image 2:
The photo shows a close-up of a tortoiseshell (calico-patterned) cat looking straight up at the camera. Its coat is mottled with patches of black, orange and cream, and it has striking pale green eyes. You can also see a scattering of long white whiskers framing its face. The background is softly out of focus, with earthy tones suggesting leaf-litter or soil underfoot.
----------------------------------------
Image 3:
The image shows a close-up of a long-haired orange-and-white cat lying outdoors on the ground. Its coat is predominantly a warm ginger color, with white fur around the muzzle, chest, and whiskers. The cat’s amber eyes look directly at the camera, and its tufted ears and fluffy fur give it a soft, well-groomed appearance. In the background you can see out-of-focus green grass, suggesting the cat is resting in a garden or grassy area.
----------------------------------------

Tool Calling

Tool calling in LLMs is a capability that allows models to autonomously decide when and how to call external tools, functions, or APIs during a conversation — based on the user’s input and the context.

You can learn more about it here.

from clarifai.client import Model

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize with model URL
model = Model(url="https://clarifai.com/anthropic/completion/models/claude-sonnet-4")

# Define tools
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current temperature for a given location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country e.g. Bogotá, Colombia"
},
"units": {
"type": "string",
"description": "Temperature units, e.g. Celsius or Fahrenheit",
"enum": ["Celsius", "Fahrenheit"]
}
},
"required": ["location"],
"additionalProperties": False
},
"strict": True
}
}
]

response = model.generate(
prompt="What is the temperature in Tokyo in Celsius?",
tools=tools,
tool_choice='auto',
max_tokens=1024,
temperature=0.5,
)

# Print response summary
print("Iterate or print response as needed:\n", response)

Asynchronous Inference

Asynchronous inference enables non-blocking execution of model prediction tasks. Instead of waiting for each prediction to complete before proceeding, you can use the async_predict and async_generate methods to submit multiple requests concurrently and retrieve the results once they're ready.

Async Prediction

You can use this for standard prediction tasks that return a complete result in a single response. The output is typically a structured object, like a dictionary or JSON.

import asyncio
from clarifai.client.model import Model

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Async main function
async def main():
# Initialize the model with the appropriate URL
model = Model(url="https://clarifai.com/openai/chat-completion/models/o4-mini")

# Perform async prediction
model_prediction = await model.async_predict(
prompt="What is the value of pi?",
max_tokens=500
)

return await model_prediction

# Entry point
if __name__ == "__main__":
# Run the async main function and print the result
print(asyncio.run(main()))

Async Generation

You can use this for generative models that produce output incrementally — such as large language models that stream tokens one by one. The response is an asynchronous stream, which you iterate over.

import asyncio
from clarifai.client.model import Model

# Set PAT as an environment variable
# export CLARIFAI_PAT=YOUR_PAT_HERE # Unix-Like Systems
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Async main function
async def main():
# Initialize the model with the appropriate URL
model = Model(url="https://clarifai.com/qwen/qwenLM/models/QwQ-32B-AWQ")

# Generate response asynchronously
generate_response = await model.async_generate(
prompt="What is the value of pi?",
max_tokens=100
)

# Iterate over the async generator to receive streamed results
async for response in await generate_response:
print(response)

# Entry point
if __name__ == "__main__":
# Run the main async function
asyncio.run(main())

Raw Protobuf Response Information

By default, prediction methods in the Model class — such as predict(), generate(), and others — return only the processed, user-friendly response.

If you need deeper insight, you can pass with_proto=True, which makes the method return a tuple containing both the processed result and the underlying raw Protobuf response.

Note that with_proto=False is the default behavior, meaning only the processed result is returned without the raw protobuf data.

Note: This parameter is supported in both synchronous and asynchronous model operations.

Predict With Protobuf

from clarifai.client import Model

# Set PAT as an environment variable:
# export CLARIFAI_PAT=YOUR_PAT_HERE # macOS / Linux
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize the model
model = Model(
url="https://clarifai.com/openai/chat-completion/models/gpt-oss-120b",
)

# Get both the processed response and raw protobuf response
response, proto_response = model.predict(
prompt="What is photosynthesis?",
reasoning_effort="medium",
with_proto=True
)

# The protobuf response contains rich metadata
print(f"Request ID for debugging: {proto_response.status.req_id}")
print(f"Success or error status code: {proto_response.status.code}")
print(f"Human-readable status description: {proto_response.status.description}")
print(f"Additional status details: {proto_response.status.details}")
print(f"Percent progress completed: {proto_response.status.percent_completed}")

# Outputs
print(f"Number of Outputs: {len(proto_response.outputs)}")

if proto_response.outputs:
output = proto_response.outputs[0]
print(f"Output status code: {output.status.code}")
print(f"Output status description: {output.status.description}")
print(f"Raw output data: {output.data}")
else:
print("No outputs returned.")

# And much more depending on the model and operation...

# Example debugging usage
print("\nDebugging example:")
try:
result, proto_response = model.predict(prompt="Hello", with_proto=True)
print(f"Success! request ID: {proto_response.status.req_id}")
except Exception as e:
print(f"Error occurred: {e}")
print(f"Status description: {proto_response.status.description}")
print(f"Debug using request ID: {proto_response.status.req_id}")
Example Output
Request ID for debugging: sdk-python-11.10.2-df9e4c855cbb4b249c135078bdeece45
Success or error status code: 10000
Human-readable status description: Success
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "**Photosynthesis** is the natural process by which green plants, algae, and many bacteria convert light energy from the sun into chemical energy stored in sugars (carbohydrates). In doing so, they also produce the oxygen we breathe. \n\n---\n\n## The Basic Idea\n\n| Input (reactants) | Energy source | Output (products) |\n|-------------------|---------------|-------------------|\n| **CO₂** (carbon dioxide) | **Sunlight** (photons) | **C₆H₁₂O₆** (glucose) |\n| **H₂O** (water) | | **O₂** (oxygen) |\n\nThe overall balanced chemical equation is:\n\n\\[\n6\\; \\text{CO}_2 \\;+\\; 6\\; \\text{H}_2\\text{O} \\;+\\; \\text{light energy} \\;\\longrightarrow\\; \\text{C}_6\\text{H}_{12}\\text{O}_6 \\;+\\; 6\\; \\text{O}_2\n\\]\n\n---\n\n## Where It Happens\n\n- **Chloroplasts** – organelles in plant cells (and in algae) that contain the pigment **chlorophyll**.\n- **Thylakoid membranes** – stacked discs inside chloroplasts where the light‑dependent reactions occur.\n- **Stroma** – the fluid surrounding the thylakoids where the Calvin (light‑independent) cycle takes place.\n\n---\n\n## Two Main Stages\n\n### 1. Light‑Dependent Reactions (the “photo” part)\n\n| Step | What happens | Key molecules |\n|------|--------------|----------------|\n| **Photon absorption** | Chlorophyll captures light photons. | Excited electrons |\n| **Water splitting (photolysis)** | H₂O → O₂ + H⁺ + e⁻ | Releases O₂ to the atmosphere. |\n| **Electron transport chain** | Excited electrons move through proteins, pumping protons to create a gradient. | Generates ATP (via chemiosmosis) and NADPH (via ferredoxin‑NADP⁺ reductase). |\n\n**Outputs:** ATP (energy currency) and NADPH (reducing power), plus O₂ as a by‑product.\n\n### 2. Light‑Independent Reactions – The Calvin Cycle (also called the “dark” reactions)\n\n| Phase | What happens | Key molecules |\n|-------|--------------|----------------|\n| **Carbon fixation** | CO₂ is attached to a 5‑carbon sugar (ribulose‑1,5‑bisphosphate, RuBP) by the enzyme **Rubisco**, forming a 6‑carbon intermediate that splits into two 3‑carbon molecules (3‑phosphoglycerate, 3‑PGA). | 3‑PGA |\n| **Reduction** | ATP and NADPH from the light reactions convert 3‑PGA into glyceraldehyde‑3‑phosphate (G3P). | G3P (a sugar‑phosphate) |\n| **Regeneration** | Some G3P molecules are used to regenerate RuBP, allowing the cycle to continue. | RuBP |\n| **Carbohydrate synthesis** | For every 6 CO₂ fixed, 2 G3P exit the cycle; two G3P can be linked to form one glucose (C₆H₁₂O₆). | Glucose (or other carbohydrates) |\n\n**Outputs:** Glucose (or other sugars) that can be stored as starch, used for growth, or broken down for energy; the cycle also consumes the ATP and NADPH produced earlier.\n\n---\n\n## Why It Matters\n\n1. **Primary production** – Photosynthesis is the base of most food webs. All heterotrophic organisms (animals, fungi, most bacteria) ultimately rely on the organic carbon fixed by photosynthesizers.\n2. **Oxygen supply** – The O₂ released is essential for aerobic respiration in most living things.\n3. **Carbon cycle** – It removes CO₂ from the atmosphere, helping regulate Earth’s climate.\n4. **Human uses** – Crops (wheat, rice, corn, etc.) are cultivated for their photosynthetic products; biofuels, bioplastics, and even synthetic photosynthesis research aim to harness this process for sustainable energy.\n\n---\n\n## Quick Summary (in a nutshell)\n\n- **Photosynthesis** = **light energy** + **CO₂** + **H₂O** → **glucose** + **O₂**. \n- Takes place in chloroplasts, using chlorophyll to capture sunlight. \n- Consists of **light‑dependent reactions** (make ATP & NADPH, release O₂) and the **Calvin cycle** (use ATP/NADPH to turn CO₂ into sugars). \n- It fuels the planet’s ecosystems and maintains atmospheric oxygen.\n\nFeel free to ask if you’d like more detail on any part—e.g., the role of specific pigments, variations in algae and cyanobacteria, or how scientists are trying to improve photosynthetic efficiency for agriculture!"
}
id: "return"
}


Debugging example:
Success! request ID: sdk-python-11.10.2-97cfaaa6f39c4639ab46c8f53df3baa1

Stream With Protobuf

from clarifai.client import Model

# Set PAT as an environment variable:
# export CLARIFAI_PAT=YOUR_PAT_HERE # macOS / Linux
# set CLARIFAI_PAT=YOUR_PAT_HERE # Windows

# Initialize the model
model = Model(
url="https://clarifai.com/openai/chat-completion/models/gpt-oss-120b",
)

# Stream both processed responses and raw protobuf metadata
for response, proto_response in model.generate(
prompt="What is photosynthesis?",
reasoning_effort="medium",
with_proto=True
):
# Processed chunk of streamed text
print(f"Generated chunk: {response}")

# Protobuf metadata for this streamed chunk
print(f"Request ID for debugging: {proto_response.status.req_id}")
print(f"Success or error status code: {proto_response.status.code}")
print(f"Human-readable status description: {proto_response.status.description}")
print(f"Additional status details: {proto_response.status.details}")
print(f"Percent progress completed: {proto_response.status.percent_completed}")

# Outputs (each streamed chunk may contain output data)
print(f"Number of Outputs: {len(proto_response.outputs)}")

if proto_response.outputs:
output = proto_response.outputs[0]
print(f"Output status code: {output.status.code}")
print(f"Output status description: {output.status.description}")
print(f"Raw output data: {output.data}")
else:
print("No outputs returned in this streamed chunk.")

print("---") # Separator for each streamed chunk
Example Output
Generated chunk: 
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
}
id: "return"
}

---
Generated chunk: The user asks: "What is photos
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "The user asks: \"What is photos"
}
id: "return"
}

---
Generated chunk: ynthesis?" Provide a clear explanation. Could include process
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ynthesis?\" Provide a clear explanation. Could include process"
}
id: "return"
}

---
Generated chunk: , equation, importance, steps (light-dependent,
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ", equation, importance, steps (light-dependent,"
}
id: "return"
}

---
Generated chunk: Calvin cycle), organisms, etc. Should be concise
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " Calvin cycle), organisms, etc. Should be concise"
}
id: "return"
}

---
Generated chunk: but thorough. Use simple
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " but thorough. Use simple"
}
id: "return"
}

---
Generated chunk: language. Possibly ask follow
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " language. Possibly ask follow"
}
id: "return"
}

---
Generated chunk: -up. Provide answer.
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "-up. Provide answer."
}
id: "return"
}

---
Generated chunk: **Photosynthesis** is the process by which green plants, algae, and some bacteria capture light
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "**Photosynthesis** is the process by which green plants, algae, and some bacteria capture light"
}
id: "return"
}

---
Generated chunk: energy from the sun and
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " energy from the sun and"
}
id: "return"
}

---
Generated chunk: turn it into chemical energy stored in sugars (carbohydrates). In doing so, they also produce oxygen as a by‑product.

---

## The Basic Chemical Equation


Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " turn it into chemical energy stored in sugars (carbohydrates). In doing so, they also produce oxygen as a by‑product. \n\n---\n\n## The Basic Chemical Equation\n\n"
}
id: "return"
}

---
Generated chunk: \[
\text{6 CO₂ 
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "\\[\n\\text{6 CO₂ "
}
id: "return"
}

---
Generated chunk: + 6 H
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "+ 6 H"
}
id: "return"
}

---
Generated chunk: ₂O + light energy} \;\
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "₂O + light energy} \\;\\"
}
id: "return"
}

---
Generated chunk: xrightarrow{\text{chlorophyll}}\; \text{C₆H₁₂O₆ + 
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "xrightarrow{\\text{chlorophyll}}\\; \\text{C₆H₁₂O₆ + "
}
id: "return"
}

---
Generated chunk: 6 O₂}

Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "6 O₂}\n"
}
id: "return"
}

---
Generated chunk: \]

- **CO
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "\\]\n\n- **CO"
}
id: "return"
}

---
Generated chunk: ₂** – carbon dioxide
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "₂** – carbon dioxide"
}
id: "return"
}

---
Generated chunk: from the air
- **H₂O** – water taken up by
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " from the air \n- **H₂O** – water taken up by"
}
id: "return"
}

---
Generated chunk: roots
- **C
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " roots \n- **C"
}
id: "return"
}

---
Generated chunk: ₆H₁₂O₆** – glucose (a simple
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "₆H₁₂O₆** – glucose (a simple"
}
id: "return"
}

---
Generated chunk: sugar) that fuels the
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " sugar) that fuels the"
}
id: "return"
}

---
Generated chunk: plant’s growth
- **O₂** –
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " plant’s growth \n- **O₂** –"
}
id: "return"
}

---
Generated chunk: oxygen released into the atmosphere
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " oxygen released into the atmosphere"
}
id: "return"
}

---
Generated chunk:

---

## Where It Happens

- **Chloroplasts** – organelles in plant cells that contain the pigment **
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " \n\n---\n\n## Where It Happens\n\n- **Chloroplasts** – organelles in plant cells that contain the pigment **"
}
id: "return"
}

---
Generated chunk: chlorophyll**, which absorbs
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "chlorophyll**, which absorbs"
}
id: "return"
}

---
Generated chunk: light (mainly blue
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " light (mainly blue"
}
id: "return"
}

---
Generated chunk: and red wavelengths).

Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " and red wavelengths). \n"
}
id: "return"
}

---
Generated chunk: - **Thylakoid membranes** – stacked discs inside chloroplasts
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "- **Thylakoid membranes** – stacked discs inside chloroplasts"
}
id: "return"
}

---
Generated chunk: where the light‑dependent reactions occur.
- **Stroma** – the fluid surrounding the thylakoids where the Calvin (light‑independent) cycle takes place.

---

## Two Main Stages

| Stage
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " where the light‑dependent reactions occur. \n- **Stroma** – the fluid surrounding the thylakoids where the Calvin (light‑independent) cycle takes place.\n\n---\n\n## Two Main Stages\n\n| Stage"
}
id: "return"
}

---
Generated chunk: | What Happens | Key
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " | What Happens | Key"
}
id: "return"
}

---
Generated chunk: Products |
|-------|--------------|--------------|
| **1. Light‑dependent reactions** (in
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " Products |\n|-------|--------------|--------------|\n| **1. Light‑dependent reactions** (in"
}
id: "return"
}

---
Generated chunk: thylakoids)
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " thylakoids)"
}
id: "return"
}

---
Generated chunk: | • Light energy exc
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " | • Light energy exc"
}
id: "return"
}

---
Generated chunk: ites electrons in chlorophyll
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ites electrons in chlorophyll"
}
id: "return"
}

---
Generated chunk: .<br>• Water
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ".<br>• Water"
}
id: "return"
}

---
Generated chunk: is split (photol
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " is split (photol"
}
id: "return"
}

---
Generated chunk: ysis) → O₂ + H⁺ + electrons.<br>• Excited electrons travel through
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ysis) → O₂ + H⁺ + electrons.<br>• Excited electrons travel through"
}
id: "return"
}

---
Generated chunk: an electron transport chain,
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " an electron transport chain,"
}
id: "return"
}

---
Generated chunk: creating a proton gradient that
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " creating a proton gradient that"
}
id: "return"
}

---
Generated chunk: drives **ATP** synthesis
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " drives **ATP** synthesis"
}
id: "return"
}

---
Generated chunk: .<br>• NAD
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ".<br>• NAD"
}
id: "return"
}

---
Generated chunk: P⁺ is reduced
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "P⁺ is reduced"
}
id: "return"
}

---
Generated chunk: to **NADPH**. | ATP,
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " to **NADPH**. | ATP,"
}
id: "return"
}

---
Generated chunk: NADPH, O₂
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " NADPH, O₂"
}
id: "return"
}

---
Generated chunk: (released) |
| **2. Calvin Cycle
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " (released) |\n| **2. Calvin Cycle"
}
id: "return"
}

---
Generated chunk: (light‑independent reactions)** (in st
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " (light‑independent reactions)** (in st"
}
id: "return"
}

---
Generated chunk: roma) | • ATP
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "roma) | • ATP"
}
id: "return"
}

---
Generated chunk: and NADPH power the
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " and NADPH power the"
}
id: "return"
}

---
Generated chunk: fixation of CO₂.
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " fixation of CO₂."
}
id: "return"
}

---
Generated chunk: <br>• CO₂ is attached to a five
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "<br>• CO₂ is attached to a five"
}
id: "return"
}

---
Generated chunk: ‑carbon sugar (Ru
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "‑carbon sugar (Ru"
}
id: "return"
}

---
Generated chunk: BP) by the enzyme **Rubisco**, forming a six‑carbon intermediate
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "BP) by the enzyme **Rubisco**, forming a six‑carbon intermediate"
}
id: "return"
}

---
Generated chunk: that splits into two three
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " that splits into two three"
}
id: "return"
}

---
Generated chunk: ‑carbon molecules (3‑PGA).
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "‑carbon molecules (3‑PGA)."
}
id: "return"
}

---
Generated chunk: <br>• Through a
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "<br>• Through a"
}
id: "return"
}

---
Generated chunk: series of steps,
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " series of steps, "
}
id: "return"
}

---
Generated chunk: 3‑PGA is
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "3‑PGA is"
}
id: "return"
}

---
Generated chunk: converted into **G3
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " converted into **G3"
}
id: "return"
}

---
Generated chunk: P** (glycer
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "P** (glycer"
}
id: "return"
}

---
Generated chunk: aldehyde‑3‑phosphate).<br>• Some G3P leaves the cycle to become glucose and other carbohydrates
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "aldehyde‑3‑phosphate).<br>• Some G3P leaves the cycle to become glucose and other carbohydrates"
}
id: "return"
}

---
Generated chunk: ; the rest regenerates
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "; the rest regenerates"
}
id: "return"
}

---
Generated chunk: RuBP. | Gl
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " RuBP. | Gl"
}
id: "return"
}

---
Generated chunk: ucose (or other carbohydrates), regeneration of RuBP |

---

## Why It Matters

1. **Energy Source for Life**
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ucose (or other carbohydrates), regeneration of RuBP |\n\n---\n\n## Why It Matters\n\n1. **Energy Source for Life**"
}
id: "return"
}

---
Generated chunk:
- All heter
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " \n - All heter"
}
id: "return"
}

---
Generated chunk: otrophic organisms (animals, fungi, most bacteria) ultimately rely on the organic carbon produced by photos
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "otrophic organisms (animals, fungi, most bacteria) ultimately rely on the organic carbon produced by photos"
}
id: "return"
}

---
Generated chunk: ynthesis.

2. **
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ynthesis.\n\n2. **"
}
id: "return"
}

---
Generated chunk: Oxygen Production**

Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "Oxygen Production** \n"
}
id: "return"
}

---
Generated chunk: - The O₂ released is essential for aerobic respiration, which powers most
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " - The O₂ released is essential for aerobic respiration, which powers most"
}
id: "return"
}

---
Generated chunk: complex life.

3. **Carbon Dioxide Regulation
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " complex life.\n\n3. **Carbon Dioxide Regulation"
}
id: "return"
}

---
Generated chunk: **
- Photos
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "** \n - Photos"
}
id: "return"
}

---
Generated chunk: ynthesis removes CO₂ from the atmosphere, helping to
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ynthesis removes CO₂ from the atmosphere, helping to"
}
id: "return"
}

---
Generated chunk: moderate Earth’s climate.


Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " moderate Earth’s climate.\n\n"
}
id: "return"
}

---
Generated chunk: 4. **Economic Importance
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "4. **Economic Importance"
}
id: "return"
}

---
Generated chunk: **
- Cro
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "** \n - Cro"
}
id: "return"
}

---
Generated chunk: ps (wheat, rice, corn, etc.) are cultivated for food
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ps (wheat, rice, corn, etc.) are cultivated for food"
}
id: "return"
}

---
Generated chunk: , fiber, and bio
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ", fiber, and bio"
}
id: "return"
}

---
Generated chunk: fuels—all products of
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "fuels—all products of"
}
id: "return"
}

---
Generated chunk: photosynthetic biomass.

5
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " photosynthetic biomass.\n\n5"
}
id: "return"
}

---
Generated chunk: . **Ecological Foundations
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ". **Ecological Foundations"
}
id: "return"
}

---
Generated chunk: **
- Primary
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "** \n - Primary"
}
id: "return"
}

---
Generated chunk: producers (photosynthesizers) form the base
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " producers (photosynthesizers) form the base"
}
id: "return"
}

---
Generated chunk: of most food webs,
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " of most food webs,"
}
id: "return"
}

---
Generated chunk: supporting herbivores,
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " supporting herbivores,"
}
id: "return"
}

---
Generated chunk: predators, and decompos
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " predators, and decompos"
}
id: "return"
}

---
Generated chunk: ers.

---

## Quick
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ers.\n\n---\n\n## Quick"
}
id: "return"
}

---
Generated chunk: Summary (in a nutshell
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " Summary (in a nutshell"
}
id: "return"
}

---
Generated chunk: )

- **Photosynthesis** = **light energy
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ")\n\n- **Photosynthesis** = **light energy"
}
id: "return"
}

---
Generated chunk: → chemical energy** (
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " → chemical energy** ("
}
id: "return"
}

---
Generated chunk: sugar) + **
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "sugar) + **"
}
id: "return"
}

---
Generated chunk: oxygen**.
- Takes place in **chlor
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "oxygen**. \n- Takes place in **chlor"
}
id: "return"
}

---
Generated chunk: oplasts** using **
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "oplasts** using **"
}
id: "return"
}

---
Generated chunk: chlorophyll**.

Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "chlorophyll**. \n"
}
id: "return"
}

---
Generated chunk: - Consists of **light‑dependent reactions** (make ATP & NADPH, split water)
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "- Consists of **light‑dependent reactions** (make ATP & NADPH, split water)"
}
id: "return"
}

---
Generated chunk: and the **Calvin cycle** (fix CO
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " and the **Calvin cycle** (fix CO"
}
id: "return"
}

---
Generated chunk: ₂ into sugar).

Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "₂ into sugar). \n"
}
id: "return"
}

---
Generated chunk: - It fuels almost all
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "- It fuels almost all"
}
id: "return"
}

---
Generated chunk: life on Earth and keeps
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " life on Earth and keeps"
}
id: "return"
}

---
Generated chunk: our atmosphere breathable.

---


Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " our atmosphere breathable.\n\n---\n\n"
}
id: "return"
}

---
Generated chunk: ### Want to dive deeper
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "### Want to dive deeper"
}
id: "return"
}

---
Generated chunk: ?

- **Variations
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "?\n\n- **Variations"
}
id: "return"
}

---
Generated chunk: **: C₄
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "**: C₄"
}
id: "return"
}

---
Generated chunk: and CAM photosynthesis (
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " and CAM photosynthesis ("
}
id: "return"
}

---
Generated chunk: adaptations for hot/d
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "adaptations for hot/d"
}
id: "return"
}

---
Generated chunk: ry environments).
- **Molecular details**
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: "ry environments). \n- **Molecular details**"
}
id: "return"
}

---
Generated chunk: : Structure of photosystems
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ": Structure of photosystems"
}
id: "return"
}

---
Generated chunk: I & II, the
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " I & II, the"
}
id: "return"
}

---
Generated chunk: role of the electron carrier
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " role of the electron carrier"
}
id: "return"
}

---
Generated chunk: plastoquinone,
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " plastoquinone,"
}
id: "return"
}

---
Generated chunk: etc.
- **Biotechnological angles**
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " etc. \n- **Biotechnological angles**"
}
id: "return"
}

---
Generated chunk: : Engineering crops for higher
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ": Engineering crops for higher"
}
id: "return"
}

---
Generated chunk: photosynthetic efficiency, artificial
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " photosynthetic efficiency, artificial"
}
id: "return"
}

---
Generated chunk: photosynthesis for clean energy
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " photosynthesis for clean energy"
}
id: "return"
}

---
Generated chunk: .

Feel free to ask
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: ".\n\nFeel free to ask"
}
id: "return"
}

---
Generated chunk: if any part intrigues
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " if any part intrigues"
}
id: "return"
}

---
Generated chunk: you!
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
string_value: " you!"
}
id: "return"
}

---
Generated chunk:
Request ID for debugging: sdk-python-11.10.2-da226933309d40f58a35d585b3c188ce
Success or error status code: 10000
Human-readable status description: Ok
Additional status details:
Percent progress completed: 0
Number of Outputs: 1
Output status code: 10000
Output status description:
Raw output data: parts {
data {
}
id: "return"
}
tip

Retrieving raw Protobuf response information works with any custom method defined in the ModelClient class. For example:

result, proto = model.my_custom_method(
input_data="some data",
temperature=0.7,
with_proto=True
)