Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 805 Bytes

File metadata and controls

31 lines (24 loc) · 805 Bytes

AI Module Example

This example demonstrates how to import and use the standard ai module to execute generative text completions using the Gemini API.

Code (prompt.txs)

use ai

say "Loading Gemini AI model..."
model = ai.load("gemini-2.5")

say "Sending prompt: Explain stack-based VMs..."
response = ai.prompt(model, "Explain stack-based VMs")

say "AI Response Received:"
say response

Running the Example

tech run prompt.txs

Expected Output

Loading Gemini AI model...
Sending prompt: Explain stack-based VMs...
AI Response Received:
[Gemini 2.5] A stack-based virtual machine evaluates expressions using an execution stack. Operators pop operands, calculate, and push results back.

(Note: Output response content is simulated locally for verification)