HiveLang v5

Variables

Variables let you name data, reuse tool results, and build responses step by step.

Assign values

Use =. Variable names do not start with $.

name = "Ada"
greeting = f"Hello {name}"
say greeting

Common value types

String

"hello"

Number

42 or 3.14

Boolean

true or false

List

["sales", "support"]

Use f-strings for interpolation

Prefix text with f when you want variables inserted into the string.

name = "Alice"
say f"Welcome back, {name}"

A plain string like "Welcome {name}" prints the braces literally.

Store tool results

Assign the result of a tool call, then read fields from it.

results = call web.search with { query: "AI news" }
say f"Found: {results.summary}"

Complete example

bot Calculator {
  on user.message {
    price = 100
    tax = 0.2
    total = price * (1 + tax)
    say f"Total: {total}"
  }
}

Did this page help?

Not helpfulExcellent