@misterscan/sesi 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -19
- package/bin/sesi.js +35 -34
- package/dist/ai-runtime.d.ts +5 -0
- package/dist/ai-runtime.d.ts.map +1 -1
- package/dist/ai-runtime.js +157 -7
- package/dist/ai-runtime.js.map +1 -1
- package/dist/builtins.d.ts +1 -1
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +114 -1
- package/dist/builtins.js.map +1 -1
- package/dist/interpreter.d.ts +6 -1
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +210 -36
- package/dist/interpreter.js.map +1 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +2 -0
- package/dist/parser.js.map +1 -1
- package/dist/sesi.bundled.js +55012 -0
- package/dist/types.d.ts +9 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +9 -9
- package/docs/BUILTINS.md +87 -8
- package/docs/DISTRIBUTED_SYSTEMS.md +1 -1
- package/docs/IMAGE_GENERATION.md +82 -1
- package/docs/IMPLEMENTATION_SUMMARY.md +544 -533
- package/docs/QUICKSTART.md +52 -33
- package/docs/README.md +21 -39
- package/docs/ROADMAP.md +10 -11
- package/docs/SPECIFICATION.md +37 -14
- package/docs/SYSTEMS_REASONING.md +35 -11
- package/docs/bakery_logo.png +0 -0
- package/docs/coffee_mug.png +0 -0
- package/docs/desk_lamp.png +0 -0
- package/docs/logo.png +0 -0
- package/docs/notebook.png +0 -0
- package/docs/sesi_ai_chronicles.md +209 -0
- package/examples/16_modules.sesi +28 -0
- package/examples/17_http_client.sesi +29 -0
- package/examples/18_parallel_requests.sesi +37 -0
- package/main/chatbot.sesi +36 -0
- package/main/conversational_classifier_weights.json +45 -0
- package/main/conversational_sentences.json +304 -0
- package/main/epochs.sesi +94 -0
- package/main/gpu_orchestrator.sesi +36 -0
- package/main/hardware_diagnostics.sesi +118 -0
- package/main/inference.sesi +54 -0
- package/main/native_chatbot.sesi +180 -0
- package/main/native_synthesizer.sesi +83 -0
- package/main/nn_personas_trainer.sesi +302 -0
- package/main/nn_responses_trainer.sesi +269 -0
- package/main/nn_sentences_trainer.sesi +330 -0
- package/main/personas.json +124 -0
- package/main/personas_classifier_weights.json +45 -0
- package/main/playground.sesi +3 -1
- package/main/predictive_typing.sesi +127 -0
- package/main/query_brain.sesi +45 -0
- package/main/response_classifier_weights.json +45 -0
- package/main/retro_chat.html +239 -0
- package/main/retro_chat_generator.sesi +745 -0
- package/main/sesi_ai.sesi +158 -0
- package/main/sesi_db_chatbot.sesi +261 -0
- package/main/terminal_chat.py +385 -0
- package/main/tests/temp_math_mod.sesi +3 -0
- package/main/tests/test_image_input.sesi +40 -0
- package/main/tests/test_v2_features.sesi +48 -0
- package/main/unified_sesi_ai.sesi +334 -0
- package/main/varied_responses.json +304 -0
- package/package.json +12 -5
- package/main/atm_deposit.sesi +0 -37
- package/main/atm_withdraw.sesi +0 -37
- package/main/data.txt +0 -1
- package/main/math_aggregator.sesi +0 -15
- package/main/math_generator.sesi +0 -7
- package/main/math_processor.sesi +0 -23
- package/main/tax_calculator.sesi +0 -15
- package/main/vault.sesi +0 -15
package/docs/QUICKSTART.md
CHANGED
|
@@ -1,32 +1,6 @@
|
|
|
1
1
|
# Quick Start Guide: Sesi Programming Language
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
### Prerequisites
|
|
6
|
-
|
|
7
|
-
- Node.js 18+
|
|
8
|
-
- npm or yarn
|
|
9
|
-
|
|
10
|
-
### Setup
|
|
11
|
-
|
|
12
|
-
1. **Clone and install**:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
git clone https://github.com/Misterscan/Sesi.git
|
|
16
|
-
cd sesi-programming-lang
|
|
17
|
-
npm install
|
|
18
|
-
|
|
19
|
-
# Unlock the `sesi` command
|
|
20
|
-
npm install -g
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
2. **Build from TypeScript**:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm run build
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
3. **Run a program (if installed globally)**:
|
|
3
|
+
## Run a program:
|
|
30
4
|
|
|
31
5
|
```bash
|
|
32
6
|
sesi main/start.sesi
|
|
@@ -189,9 +163,14 @@ print "Both workers are now running concurrently."
|
|
|
189
163
|
```sesi
|
|
190
164
|
print value // Print to stdout
|
|
191
165
|
read_file(path) // Read a file as text
|
|
166
|
+
from_json(path) // Read a JSON file
|
|
192
167
|
write_file(path, content) // Write text to a file
|
|
193
168
|
write_image(path, content) // Write base64 encoded image to a file
|
|
194
169
|
list_dir(path) // List directory contents
|
|
170
|
+
spawn(path) // Launch concurrent background process
|
|
171
|
+
exec(command) // Synchronous shell execution
|
|
172
|
+
time() // Unix timestamp (ms)
|
|
173
|
+
random() // Random number (0-1)
|
|
195
174
|
```
|
|
196
175
|
|
|
197
176
|
### Type Checking
|
|
@@ -217,6 +196,24 @@ values(object) // Get object values
|
|
|
217
196
|
range(n) // Create [0, 1, ..., n-1]
|
|
218
197
|
```
|
|
219
198
|
|
|
199
|
+
### Network & Concurrency
|
|
200
|
+
|
|
201
|
+
```sesi
|
|
202
|
+
web_get(url, headers = {}) // Natively fetch from URL via HTTP GET
|
|
203
|
+
web_send(url, body, headers = {}) // Natively post body to URL via HTTP POST
|
|
204
|
+
multi_req(array<function>) // Run multiple tasks/requests physically in parallel
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Standard Library Modules
|
|
208
|
+
|
|
209
|
+
Standard library features are available natively in **v1.2.0** using imports:
|
|
210
|
+
|
|
211
|
+
```sesi
|
|
212
|
+
import { PI, sqrt } from "std/math"
|
|
213
|
+
import { sleep, now } from "std/time"
|
|
214
|
+
import { stringify, parse } from "std/json"
|
|
215
|
+
```
|
|
216
|
+
|
|
220
217
|
## Running Examples
|
|
221
218
|
|
|
222
219
|
Try the included examples:
|
|
@@ -236,6 +233,16 @@ sesi examples/09_structured_output.sesi
|
|
|
236
233
|
sesi examples/10_code_generation.sesi
|
|
237
234
|
sesi examples/11_memory_conversation.sesi
|
|
238
235
|
sesi examples/12_classification.sesi
|
|
236
|
+
sesi examples/13_data_pipeline.sesi
|
|
237
|
+
sesi examples/14_folder_explainer.sesi
|
|
238
|
+
|
|
239
|
+
# Image generation example
|
|
240
|
+
sesi examples/15_image_generation.sesi
|
|
241
|
+
|
|
242
|
+
# Advanced Version 1.2 features
|
|
243
|
+
sesi examples/16_modules.sesi
|
|
244
|
+
sesi examples/17_http_client.sesi
|
|
245
|
+
sesi examples/18_parallel_requests.sesi
|
|
239
246
|
```
|
|
240
247
|
|
|
241
248
|
## Common Patterns
|
|
@@ -324,16 +331,28 @@ else {print "Response: " response}
|
|
|
324
331
|
|
|
325
332
|
## Next Steps
|
|
326
333
|
|
|
327
|
-
1. **Read the spec**: [SPECIFICATION.md](
|
|
328
|
-
2. **Learn about reasoning**: [SYSTEMS_REASONING.md](
|
|
329
|
-
3. **Understand architecture**: [ARCHITECTURE.md](
|
|
330
|
-
4. **Check roadmap**: [ROADMAP.md](
|
|
331
|
-
5. **Study examples**: [examples/](examples/)
|
|
334
|
+
1. **Read the spec**: [SPECIFICATION.md](SPECIFICATION.md)
|
|
335
|
+
2. **Learn about reasoning**: [SYSTEMS_REASONING.md](SYSTEMS_REASONING.md)
|
|
336
|
+
3. **Understand architecture**: [ARCHITECTURE.md](ARCHITECTURE.md)
|
|
337
|
+
4. **Check roadmap**: [ROADMAP.md](ROADMAP.md)
|
|
338
|
+
5. **Study examples**: [examples/](/examples/)
|
|
332
339
|
|
|
333
340
|
## Getting Help
|
|
334
341
|
|
|
342
|
+
Sesi comes with an advanced, built-in **Interactive RAG Co-Pilot** right in your command line! Instead of static help messages, you can query Sesi directly about how to use any statement, standard library, or architectural pattern:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
# Ask the Sesi Co-Pilot for help directly
|
|
346
|
+
sesi -help "how do I parse a JSON string?"
|
|
347
|
+
sesi --help "explain structured_output and give an example"
|
|
348
|
+
sesi -h "how to spawn background processes?"
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
The co-pilot will dynamically index and train on Sesi's native repository database and retrieve full RAG context from our standard specification docs to generate a syntactically correct, 100% accurate, conversational answer in real-time!
|
|
352
|
+
|
|
353
|
+
You can also:
|
|
335
354
|
- Check documentation in [docs/](docs/)
|
|
336
|
-
- Review examples in [examples/](examples/)
|
|
355
|
+
- Review examples in [examples/](/examples/)
|
|
337
356
|
- Read error messages carefully
|
|
338
357
|
- Try simpler programs first
|
|
339
358
|
|
package/docs/README.md
CHANGED
|
@@ -19,31 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
## Quick Start
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Clone the repository:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
git clone https://github.com/Misterscan/Sesi.git
|
|
28
|
-
cd sesi-programming-lang
|
|
29
|
-
```
|
|
30
|
-
You'll need a [Gemini API Key](https://aistudio.google.com/app/apikey). Create a `.env` file referencing your key:
|
|
31
|
-
|
|
32
|
-
```env
|
|
33
|
-
GEMINI_API_KEY="AIzaSy..."
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
You can install Sesi globally to use the `sesi` command anywhere on your system:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Install required dependencies
|
|
40
|
-
npm install
|
|
41
|
-
|
|
42
|
-
# Unlock the `sesi` command
|
|
43
|
-
npm install -g .
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Then run any program directly:
|
|
22
|
+
Run any program directly:
|
|
47
23
|
|
|
48
24
|
```bash
|
|
49
25
|
# Standard script execution
|
|
@@ -58,7 +34,7 @@ sesi examples.sesi
|
|
|
58
34
|
|
|
59
35
|
# Local Execution (Development)
|
|
60
36
|
|
|
61
|
-
If you choose not
|
|
37
|
+
If you choose not use the `sesi` command, use the helper npm scripts:
|
|
62
38
|
|
|
63
39
|
```bash
|
|
64
40
|
npm run example 01_hello.sesi
|
|
@@ -93,14 +69,14 @@ print code
|
|
|
93
69
|
|
|
94
70
|
## Documentation
|
|
95
71
|
|
|
96
|
-
- [Getting Started](QUICKSTART.md)
|
|
72
|
+
- [Getting Started](./QUICKSTART.md)
|
|
97
73
|
- [Examples](./examples/)
|
|
98
|
-
- [Language Specification](SPECIFICATION.md)
|
|
99
|
-
- [Language Comparison Showcase](COMPARISON.md)
|
|
100
|
-
- [Built-in Functions](BUILTINS.md)
|
|
101
|
-
- [Reasoning Guide](
|
|
102
|
-
- [Distributed Systems](DISTRIBUTED_SYSTEMS.md)
|
|
103
|
-
- [Runtime Architecture](ARCHITECTURE.md)
|
|
74
|
+
- [Language Specification](./docs/SPECIFICATION.md)
|
|
75
|
+
- [Language Comparison Showcase](./docs/COMPARISON.md)
|
|
76
|
+
- [Built-in Functions](./docs/BUILTINS.md)
|
|
77
|
+
- [Reasoning Guide](./docs/SYSTEMS_REASONING.md)
|
|
78
|
+
- [Distributed Systems](./docs/DISTRIBUTED_SYSTEMS.md)
|
|
79
|
+
- [Runtime Architecture](./docs/ARCHITECTURE.md)
|
|
104
80
|
|
|
105
81
|
## AI Agent Context
|
|
106
82
|
|
|
@@ -109,7 +85,7 @@ The root-level `SKILLS.md` file is a workspace context file for AI agents. It re
|
|
|
109
85
|
## Project Structure
|
|
110
86
|
|
|
111
87
|
```
|
|
112
|
-
|
|
88
|
+
Sesi/
|
|
113
89
|
├── SKILLS.md # AI-agent workspace context and repo guardrails
|
|
114
90
|
├── index.html # Sesi-generated landing page
|
|
115
91
|
├── eslint.config.mjs # ESLint configuration
|
|
@@ -130,7 +106,7 @@ sesi-programming-lang/
|
|
|
130
106
|
│ └── index.ts # Main entry point
|
|
131
107
|
├── bin/
|
|
132
108
|
│ └── sesi.js # CLI executable
|
|
133
|
-
├── examples/ #
|
|
109
|
+
├── examples/ # 18 sample programs demonstrating all features
|
|
134
110
|
├── main/ # Main entry and specialized tests
|
|
135
111
|
│ ├── playground.sesi # Main playground script
|
|
136
112
|
│ ├── start.sesi # Beginner script
|
|
@@ -140,7 +116,7 @@ sesi-programming-lang/
|
|
|
140
116
|
└── docs/ # Documentation (ARCHITECTURE, BUILTINS, SPECIFICATION, etc.)
|
|
141
117
|
```
|
|
142
118
|
|
|
143
|
-
## Version 1.
|
|
119
|
+
## Version 1.2 Features (In Progress)
|
|
144
120
|
|
|
145
121
|
### Core Language ✅
|
|
146
122
|
|
|
@@ -149,6 +125,11 @@ sesi-programming-lang/
|
|
|
149
125
|
- **Control Flow**: `if/else`, `while`, `for`, and `try/catch`.
|
|
150
126
|
- **Collections**: Robust Arrays and Objects.
|
|
151
127
|
- **Error Handling**: Structured `try/catch` for both runtime and Reasoning-level errors.
|
|
128
|
+
- **Local Module Imports/Exports**: Import custom local `.sesi` modules cleanly using relative import/export syntax!
|
|
129
|
+
- **Standard Library Modules**: Native support for imported standard libraries, including:
|
|
130
|
+
- `std/math` (providing `PI`, `E`, `sqrt`, `pow`, `sin`, `cos`, etc.)
|
|
131
|
+
- `std/time` (providing `sleep` and `now`)
|
|
132
|
+
- `std/json` (providing JSON serialization/deserialization)
|
|
152
133
|
|
|
153
134
|
### Reasoning-Native Features ✅
|
|
154
135
|
|
|
@@ -159,7 +140,10 @@ sesi-programming-lang/
|
|
|
159
140
|
- `tool_call()` for function calling
|
|
160
141
|
- Basic memory for multi-turn reasoning
|
|
161
142
|
- `read_file()`, `write_file()`, `to_json()`, `write_image()`, and `list_dir()` for local file I/O
|
|
162
|
-
- **Native
|
|
143
|
+
- **Native Concurrency**: `spawn()` and `exec()` for concurrent process management, and `multi_req(array<function>)` for physical parallel request execution.
|
|
144
|
+
- **Logic Caching**: High-efficiency Sesi Logic Caching (`.sesi_cache.json`) for local call caching.
|
|
145
|
+
- **Thinking Scale**: Scaled Gemini reasoning configurations using the `thinking` parameters.
|
|
146
|
+
- **HTTP Client**: Built-in, native HTTP client support using `web_get(url)` and `web_send(url, body, headers)` with zero external dependencies.
|
|
163
147
|
- **Async Polling**: Native looping to auto-resume generation when hitting `MAX_TOKENS` limit
|
|
164
148
|
- **Utility Builtins**: `time()` and `random()` for robust coordination
|
|
165
149
|
|
|
@@ -174,8 +158,6 @@ sesi-programming-lang/
|
|
|
174
158
|
### V2: Advanced Reasoning
|
|
175
159
|
|
|
176
160
|
- Long-term memory and context management
|
|
177
|
-
- Parallel model calls
|
|
178
|
-
- Advanced error handling with Reasoning fallbacks
|
|
179
161
|
- Custom tool definitions
|
|
180
162
|
- Streaming responses
|
|
181
163
|
|
package/docs/ROADMAP.md
CHANGED
|
@@ -51,20 +51,19 @@
|
|
|
51
51
|
- No async/await
|
|
52
52
|
- Blocking Reasoning calls
|
|
53
53
|
- Limited error messages
|
|
54
|
-
- No module system (imports/exports planned)
|
|
55
54
|
- No pattern matching
|
|
56
55
|
- No generics or custom types
|
|
57
56
|
|
|
58
57
|
---
|
|
59
58
|
|
|
60
|
-
## Version 1.
|
|
59
|
+
## Version 1.2 - Stability & Systems Logic (In Progress)
|
|
61
60
|
|
|
62
|
-
**Status**:
|
|
61
|
+
**Status**: In Progress V1.2 implementation
|
|
63
62
|
**Ready for**: Distributed systems orchestration and prototypes
|
|
64
63
|
**Not ready for**: Massive-scale production (until v2.0 bytecode)
|
|
65
64
|
**Next milestone**: V2.0 (Async & advanced reasoning)
|
|
66
65
|
|
|
67
|
-
### Improvements & Features
|
|
66
|
+
### Improvements & Features ⌛
|
|
68
67
|
|
|
69
68
|
- [x] Systems Builtins: `spawn`, `exec`, `time`, `random`
|
|
70
69
|
- [x] Concurrency: Async polling via file locks for completion and MAX_TOKENS
|
|
@@ -99,14 +98,14 @@
|
|
|
99
98
|
### Async/Await Support
|
|
100
99
|
|
|
101
100
|
- [ ] async/await syntax (language level)
|
|
102
|
-
- [
|
|
101
|
+
- [x] Parallel reasoning calls (native)
|
|
103
102
|
- [ ] Promise-like operations
|
|
104
103
|
- [x] Concurrent execution (Multi-process via `spawn`)
|
|
105
104
|
|
|
106
105
|
### Advanced Reasoning Features
|
|
107
106
|
|
|
108
107
|
- [ ] Streaming responses
|
|
109
|
-
- [
|
|
108
|
+
- [x] Extended thinking/reasoning budget
|
|
110
109
|
- [ ] Multi-step reasoning workflows
|
|
111
110
|
- [ ] Tool composition and piping
|
|
112
111
|
- [ ] Custom tool definitions
|
|
@@ -131,7 +130,7 @@
|
|
|
131
130
|
### Performance
|
|
132
131
|
|
|
133
132
|
- [ ] Bytecode compilation
|
|
134
|
-
- [
|
|
133
|
+
- [x] Logic caching
|
|
135
134
|
- [ ] Token counting and cost estimation
|
|
136
135
|
- [ ] Lazy evaluation
|
|
137
136
|
|
|
@@ -142,12 +141,12 @@
|
|
|
142
141
|
- [ ] Math functions (sqrt, sin, cos, floor, ceil, etc.)
|
|
143
142
|
- [ ] Date/time functions
|
|
144
143
|
- [ ] JSON parsing and serialization
|
|
145
|
-
- [
|
|
144
|
+
- [x] HTTP client (get, post)
|
|
146
145
|
|
|
147
146
|
### Module System
|
|
148
147
|
|
|
149
|
-
- [
|
|
150
|
-
- [
|
|
148
|
+
- [x] import/export statements
|
|
149
|
+
- [x] Standard library modules (std/math, std/time, etc.)
|
|
151
150
|
- [ ] Third-party package management
|
|
152
151
|
- [ ] Namespace support
|
|
153
152
|
|
|
@@ -273,7 +272,7 @@
|
|
|
273
272
|
|
|
274
273
|
```
|
|
275
274
|
2026 Q2
|
|
276
|
-
└─ v1.
|
|
275
|
+
└─ v1.2 - Polish & stabilize
|
|
277
276
|
|
|
278
277
|
2026 Q3-Q4
|
|
279
278
|
└─ v2.0 - Advanced Reasoning & async
|
package/docs/SPECIFICATION.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Sesi Systems Language Specification (v1.
|
|
1
|
+
# Sesi Systems Language Specification (v1.2)
|
|
2
2
|
|
|
3
3
|
## 1. Philosophy & Design Principles
|
|
4
4
|
|
|
@@ -27,7 +27,7 @@ Sesi is built on these core principles:
|
|
|
27
27
|
- Concurrent process management and distributed locking
|
|
28
28
|
- Multi-stage reasoning workflows with stateful memory
|
|
29
29
|
|
|
30
|
-
## 3. V1.
|
|
30
|
+
## 3. V1.2 Feature Set (Current)
|
|
31
31
|
|
|
32
32
|
### Core Language Features
|
|
33
33
|
|
|
@@ -47,6 +47,7 @@ Sesi is built on these core principles:
|
|
|
47
47
|
- ✅ `prompt` blocks (composable message templates)
|
|
48
48
|
- ✅ `model()` calls (native model with configuration)
|
|
49
49
|
- ✅ `image()` calls (native image generation with configuration)
|
|
50
|
+
- ✅ `images` config key (multimodal vision input for `model()` and `image()`)
|
|
50
51
|
- ✅ `structured_output()` (schema-guided structured output with JSON recovery and empty-object fallback on failure)
|
|
51
52
|
- ✅ `tool_call()` (Fully functional function calling via models)
|
|
52
53
|
- ✅ Simple memory (conversation context)
|
|
@@ -222,17 +223,28 @@ prompt codeReview {"Review this code for bugs:" code "Provide specific issues fo
|
|
|
222
223
|
#### Model & Image Calls
|
|
223
224
|
|
|
224
225
|
```
|
|
225
|
-
model_call := 'model' '('STRING')'
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
config := ((STRING | identifier) ':' expression (',' (STRING | identifier) ':' expression)*)?
|
|
226
|
+
model_call := 'model' '('STRING')' config_block? '{'prompt'}'
|
|
227
|
+
image_call := 'image' '('STRING')' config_block? '{'prompt'}'
|
|
228
|
+
config_block := '{' config_entry (',' config_entry)* '}'
|
|
229
|
+
config_entry := (STRING | identifier) ':' expression
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
+
**Config keys:**
|
|
233
|
+
|
|
234
|
+
| Key | Applies to | Type | Description |
|
|
235
|
+
|-----|-----------|------|-------------|
|
|
236
|
+
| `temperature` | `model`, `image` | `number` | Sampling temperature (0.0–1.0) |
|
|
237
|
+
| `max_tokens` | `model` | `number` | Max output token count |
|
|
238
|
+
| `top_k` | `model` | `number` | Top-K diversity |
|
|
239
|
+
| `top_p` | `model` | `number` | Nucleus sampling |
|
|
240
|
+
| `ratio` | `image` | `string` | Aspect ratio e.g. `"16:9"` |
|
|
241
|
+
| `size` | `image` | `string` | `"512"`, `"1K"`, `"2K"`, `"4K"` |
|
|
242
|
+
| `images` | `model`, `image` | `string \| array<string>` | Local file path(s) passed as visual input |
|
|
243
|
+
|
|
232
244
|
Example:
|
|
233
245
|
|
|
234
246
|
```sesi
|
|
235
|
-
let result = model("gemini-3
|
|
247
|
+
let result = model("gemini-3-flash-preview") {images: "scan.png", temperature: 0} {"Transcribe all visible text."}
|
|
236
248
|
let output = model("gemini-3.1-flash-lite") {"temperature": 0.4, "max_tokens": 2000} {prompt}
|
|
237
249
|
```
|
|
238
250
|
|
|
@@ -283,7 +295,7 @@ optional_type := type '?'
|
|
|
283
295
|
|
|
284
296
|
1. **Short-circuit evaluation**: `&&` and `||` short-circuit
|
|
285
297
|
2. **Type coercion**: Automatic for numeric operations; explicit for string/number
|
|
286
|
-
3. **Null propagation**: Operations on `null` return `null` (no exceptions in v1.
|
|
298
|
+
3. **Null propagation**: Operations on `null` return `null` (no exceptions in v1.2)
|
|
287
299
|
4. **Model responses**: Always returned as strings initially; structured_output provides type safety
|
|
288
300
|
|
|
289
301
|
## 6. Scope and Binding
|
|
@@ -345,7 +357,7 @@ random() -> number // Random float (0.0 to 1.0)
|
|
|
345
357
|
|
|
346
358
|
## 9. Module System
|
|
347
359
|
|
|
348
|
-
|
|
360
|
+
Runtime module execution and standard namespace modules are fully implemented and natively supported in v1.1.2.
|
|
349
361
|
|
|
350
362
|
### Defining Modules
|
|
351
363
|
|
|
@@ -378,15 +390,18 @@ import json from "std/json" // JSON parsing
|
|
|
378
390
|
Prompts are composable message templates:
|
|
379
391
|
|
|
380
392
|
```sesi
|
|
381
|
-
prompt translate {"
|
|
393
|
+
prompt translate {"translate the following to Spanish:" sourceText}
|
|
382
394
|
prompt summarize {"Summarize this in 3 sentences:" text}
|
|
383
|
-
prompt combined {summarize "Now
|
|
395
|
+
prompt combined {summarize " Now " translate}
|
|
384
396
|
```
|
|
385
397
|
|
|
386
398
|
### Model & Image Calls
|
|
387
399
|
|
|
400
|
+
Model calls can take optional configuration parameters (written on a single line) followed by one or more prompts/strings.
|
|
401
|
+
|
|
388
402
|
```sesi
|
|
389
|
-
|
|
403
|
+
// Model call with temperature and thinking scale configuration
|
|
404
|
+
let response = model("gemini-3.1-pro-preview") {"thinkingLevel": {"thinking": "yes", "level": "low"}, "temperature": 0} {"Say hello"}
|
|
390
405
|
print response // Returns string
|
|
391
406
|
|
|
392
407
|
let logo = image("gemini-3.1-flash-image-preview") {ratio: "1:1", size: "512"} {"A vector logo"}
|
|
@@ -394,6 +409,14 @@ write_image("logo.png", logo)
|
|
|
394
409
|
print "Image written to logo.png"
|
|
395
410
|
```
|
|
396
411
|
|
|
412
|
+
#### Config Block Options:
|
|
413
|
+
- **`temperature`**: `number` (0.0 to 1.0)
|
|
414
|
+
- **`max_tokens`**: `number` (maximum response tokens)
|
|
415
|
+
- **`images`**: `string` or `array<string>` (paths to multimodal vision input files)
|
|
416
|
+
- **`thinkingLevel`**: `object` with keys `"thinking"` (`"yes"` | `"no"`) and `"level"` (`"low"` | `"medium"` | `"high"`) - natively configures and scales Gemini's reasoning budget.
|
|
417
|
+
- **`cache`**: `bool` (set to `false` to explicitly bypass Sesi Logic Caching)
|
|
418
|
+
|
|
419
|
+
|
|
397
420
|
### Structured Output
|
|
398
421
|
|
|
399
422
|
```sesi
|
|
@@ -444,7 +467,7 @@ print sentiment.label
|
|
|
444
467
|
print sentiment.score
|
|
445
468
|
```
|
|
446
469
|
|
|
447
|
-
## 12. Undefined Behavior & Limitations (V1.
|
|
470
|
+
## 12. Undefined Behavior & Limitations (V1.2)
|
|
448
471
|
|
|
449
472
|
- **No async/await**: All operations within a script are blocking (including model calls). Concurrency must be achieved via `spawn()`.
|
|
450
473
|
- **No custom types**: Only built-in types are supported natively.
|
|
@@ -86,7 +86,7 @@ print greeting // "Hello, Alice! How are you?"
|
|
|
86
86
|
|
|
87
87
|
```sesi
|
|
88
88
|
prompt part1 {"First part"}
|
|
89
|
-
prompt part2 {part1 "
|
|
89
|
+
prompt part2 {part1 " Second part"}
|
|
90
90
|
print part2 // "First part Second part"
|
|
91
91
|
```
|
|
92
92
|
|
|
@@ -96,7 +96,7 @@ print part2 // "First part Second part"
|
|
|
96
96
|
let text = "Testing"
|
|
97
97
|
let language = "Spanish"
|
|
98
98
|
fn translatePrompt(text: string, language: string) -> string
|
|
99
|
-
{prompt translate {"Translate
|
|
99
|
+
{prompt translate {"Translate " text " to " language ": "} return translate}
|
|
100
100
|
print translatePrompt(text, language)
|
|
101
101
|
```
|
|
102
102
|
|
|
@@ -129,7 +129,7 @@ print creative
|
|
|
129
129
|
```sesi
|
|
130
130
|
// Fast model for simple tasks
|
|
131
131
|
let text = " Coding with Reasoning systems language is fun!"
|
|
132
|
-
let quick = model("gemini-3
|
|
132
|
+
let quick = model("gemini-3-flash-preview") {"Summarize this in one sentence:" text}
|
|
133
133
|
|
|
134
134
|
// Powerful model for complex reasoning
|
|
135
135
|
let code = "def calculate_sum(n):
|
|
@@ -148,16 +148,16 @@ print smart
|
|
|
148
148
|
print cheap
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
### Available Models (v1.
|
|
151
|
+
### Available Models (v1.2)
|
|
152
152
|
|
|
153
153
|
- `gemini-2.5-flash` - Legacy, but supported. 1M tokens.
|
|
154
154
|
- `gemini-2.5-pro` - Legacy, but supported. 1M tokens.
|
|
155
|
-
- `gemini-2.5-flash-image` -
|
|
155
|
+
- `gemini-2.5-flash-image` - Standard image model. (No `512` image size support for this model. Only `1K` is supported.)
|
|
156
156
|
- `gemini-3-flash-preview` - Fast, balanced, 1M tokens
|
|
157
|
-
- `gemini-3.1-pro-preview` - Most capable, 1M tokens
|
|
157
|
+
- `gemini-3.1-pro-preview` - Most capable, 1M tokens (Doesn't support `minimal` thinking. Only `low`, `medium`, and `high` are supported.)
|
|
158
158
|
- `gemini-3.1-flash-lite` - Fastest, cost-efficient
|
|
159
159
|
- `gemini-3.1-flash-image-preview` - Cost efficient while maintaining quality images.
|
|
160
|
-
- `gemini-3-pro-image-preview` - High quality image generation.
|
|
160
|
+
- `gemini-3-pro-image-preview` - High quality image generation. (No `512` image size support for this model.)
|
|
161
161
|
|
|
162
162
|
#### Planned for (v2+)
|
|
163
163
|
|
|
@@ -166,6 +166,29 @@ print cheap
|
|
|
166
166
|
- `Midjourney` integration
|
|
167
167
|
- `Newer Reasoning Models` - Native upgrades
|
|
168
168
|
|
|
169
|
+
### Passing Images as Input
|
|
170
|
+
|
|
171
|
+
Pass one or more local image files to `model()` or `image()` via the `images` config key. The runtime reads each file, base64-encodes it, and injects it as a vision part before the prompt text.
|
|
172
|
+
|
|
173
|
+
```sesi
|
|
174
|
+
// Single image
|
|
175
|
+
let referenceImage = "stills/frame_03.jpg"
|
|
176
|
+
let caption = model("gemini-3-flash-preview") {images: referenceImage} {"What is the subject of this photograph?"}
|
|
177
|
+
print caption
|
|
178
|
+
|
|
179
|
+
// Multiple images
|
|
180
|
+
let pair = ["ref_a.png", "ref_b.png"]
|
|
181
|
+
let diff = model("gemini-3-flash-preview") {images: pair} {"List every visual difference between these two."}
|
|
182
|
+
print diff
|
|
183
|
+
|
|
184
|
+
// Mixed with other config keys
|
|
185
|
+
let scannedDocument = "doc_scan.jpg"
|
|
186
|
+
let result = model("gemini-3.1-flash-lite") {images: scannedDocument, temperature: 0, max_tokens: 2048} {"Transcribe all text visible in this scan."}
|
|
187
|
+
write_file("transcript.txt", result)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
See [Image Generation & Input](IMAGE_GENERATION.md) for the full reference.
|
|
191
|
+
|
|
169
192
|
## 3. Structured Output
|
|
170
193
|
|
|
171
194
|
Get typed responses from Reasoning with field validation.
|
|
@@ -346,6 +369,8 @@ write_image("logo.png", logo)
|
|
|
346
369
|
print "Image generated!"
|
|
347
370
|
```
|
|
348
371
|
|
|
372
|
+

|
|
373
|
+
|
|
349
374
|
### Code Generation
|
|
350
375
|
|
|
351
376
|
```sesi
|
|
@@ -371,7 +396,7 @@ print analyzeSentiment(text)
|
|
|
371
396
|
|
|
372
397
|
Reasoning operations can fail. Handle gracefully.
|
|
373
398
|
|
|
374
|
-
### Try/Catch (v1.
|
|
399
|
+
### Try/Catch (v1.2)
|
|
375
400
|
|
|
376
401
|
```sesi
|
|
377
402
|
try
|
|
@@ -492,11 +517,10 @@ let summary = model("gemini-3-flash-preview") {"Summarize with topics " topics "
|
|
|
492
517
|
print "Summary:" smartSummarize(text)
|
|
493
518
|
```
|
|
494
519
|
|
|
495
|
-
### Reasoning Pattern
|
|
520
|
+
### Reasoning Pattern
|
|
496
521
|
|
|
497
522
|
```sesi
|
|
498
|
-
|
|
499
|
-
let analysis = model("gemini-3-flash-preview") {"temperature": 0, "thinking_level": "low"} {"Reason carefully about:" problem}
|
|
523
|
+
let analysis = model("gemini-3-flash-preview") {"thinkingLevel": {"thinking": "yes", "level": "medium"}, "temperature": 0, "max_tokens": 8192} {"Reason carefully about:" problem}
|
|
500
524
|
print analysis
|
|
501
525
|
```
|
|
502
526
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/logo.png
ADDED
|
Binary file
|
|
Binary file
|