Examples / Getting Started / Hello World
Hello World
Has SpecsRequires API Keys
A minimal Tactus program demonstrating the core workflow without the formal `Procedure` structure. This example shows how to: - Define an agent with a provider and model - Write simple Tactus code that just returns an agent call - Include an embedded BDD specification with Gherkin syntax - Use fuzzy matching to validate agent responses flexibly
Source Code
World = Agent {
model = "openai/gpt-4o-mini",
system_prompt = "Your name is World."
}
Specification([[
Feature: Hello World
Scenario: Greeter returns greeting
Given the procedure has started
And the message is "Hello, World!"
And the agent "World" responds with "Hello! I'm World, nice to meet you!"
When the procedure runs
Then the output should fuzzy match any of ["Hello", "Hi", "Hey"] with threshold 0.9
]])
local result = World({message = "Hello, World!"})
return (result and (result.output or result)) or ""
Quick Start
Run the example:
$tactus run 01-getting-started/01-hello-world.tacTest with mocks:
$tactus test 01-getting-started/01-hello-world.tac --mockNote
This example requires API keys. Set your OPENAI_API_KEY environment variable before running.
Explore more examples
Learn Tactus through practical, runnable examples organized by topic.