@misterscan/sesi 1.2.1 → 1.2.2
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/bin/sesi.js +2 -2
- package/dist/ai-runtime.d.ts.map +1 -1
- package/dist/ai-runtime.js +11 -3
- package/dist/ai-runtime.js.map +1 -1
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +6 -1
- package/dist/builtins.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +10 -1
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +62 -10
- package/dist/interpreter.js.map +1 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +8 -0
- package/dist/parser.js.map +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/BUILTINS.md +62 -1
- package/docs/IMAGE_GENERATION.md +3 -3
- package/docs/SKILLS.md +133 -0
- package/docs/SPECIFICATION.md +75 -19
- package/docs/SYSTEMS_REASONING.md +22 -22
- package/examples/16_modules.sesi +1 -1
- package/main/sesi_db_chatbot.sesi +280 -252
- package/main/start.sesi +1 -1
- package/main/unified_sesi_ai.sesi +1 -1
- package/package.json +6 -6
|
@@ -114,14 +114,13 @@ print response
|
|
|
114
114
|
### Model Configuration
|
|
115
115
|
|
|
116
116
|
```sesi
|
|
117
|
-
let creative = model("gemini-3-flash
|
|
117
|
+
let creative = model("gemini-3.5-flash") {thinkingLevel: "low"} {"Write a creative poem about technology."}
|
|
118
118
|
print creative
|
|
119
119
|
|
|
120
120
|
// Config options:
|
|
121
|
-
// - "
|
|
121
|
+
// - thinkingLevel: "minimal", "low", "medium", "high" (natively configures Gemini's reasoning budget)
|
|
122
122
|
// - max_tokens: max length of response (OPTIONAL: if not specified, will use the model's default max tokens=2048)
|
|
123
|
-
// - top_k:
|
|
124
|
-
// - top_p: nucleus sampling parameter (OPTIONAL)
|
|
123
|
+
// - temperature / top_k / top_p: *Will be deprecated in Gemini 3.x+, use thinkingLevel instead (reasoning is mathematically optimized for default settings)*
|
|
125
124
|
```
|
|
126
125
|
|
|
127
126
|
### Model Selection
|
|
@@ -129,7 +128,7 @@ print creative
|
|
|
129
128
|
```sesi
|
|
130
129
|
// Fast model for simple tasks
|
|
131
130
|
let text = " Coding with Reasoning systems language is fun!"
|
|
132
|
-
let quick = model("gemini-3-flash-
|
|
131
|
+
let quick = model("gemini-3.1-flash-lite") {"Summarize this in one sentence:" text}
|
|
133
132
|
|
|
134
133
|
// Powerful model for complex reasoning
|
|
135
134
|
let code = "def calculate_sum(n):
|
|
@@ -141,7 +140,7 @@ let smart = model("gemini-3.1-pro-preview") {"Analyze this code for bugs:" code}
|
|
|
141
140
|
|
|
142
141
|
// Efficient model for many calls
|
|
143
142
|
let item = " Programming Languages"
|
|
144
|
-
let cheap = model("gemini-3.
|
|
143
|
+
let cheap = model("gemini-3.5-flash") {thinkingLevel: "minimal"} {"Classify:" item}
|
|
145
144
|
|
|
146
145
|
print quick
|
|
147
146
|
print smart
|
|
@@ -153,11 +152,12 @@ print cheap
|
|
|
153
152
|
- `gemini-2.5-flash` - Legacy, but supported. 1M tokens.
|
|
154
153
|
- `gemini-2.5-pro` - Legacy, but supported. 1M tokens.
|
|
155
154
|
- `gemini-2.5-flash-image` - Standard image model. (No `512` image size support for this model. Only `1K` is supported.)
|
|
156
|
-
- `gemini-3-flash-preview` - Fast, balanced,
|
|
157
|
-
- `gemini-3.1-
|
|
158
|
-
- `gemini-3.
|
|
159
|
-
- `gemini-3.1-
|
|
160
|
-
- `gemini-3-
|
|
155
|
+
- `gemini-3-flash-preview` - Fast, balanced, legacy preview.
|
|
156
|
+
- `gemini-3.1-flash-lite` - Fastest, most cost-efficient.
|
|
157
|
+
- `gemini-3.5-flash` - Standard GA Model. Fast, balanced, supports all native thinking effort levels (`minimal`, `low`, `medium`, `high`).
|
|
158
|
+
- `gemini-3.1-pro-preview` - Most powerful reasoning model, doesn't support `minimal` thinking (falls back to `low`).
|
|
159
|
+
- `gemini-3.1-flash-image-preview` - Cost efficient image generation model.
|
|
160
|
+
- `gemini-3-pro-image-preview` - High quality image generation model. (No `512` image size support for this model.)
|
|
161
161
|
|
|
162
162
|
#### Planned for (v2+)
|
|
163
163
|
|
|
@@ -183,7 +183,7 @@ print diff
|
|
|
183
183
|
|
|
184
184
|
// Mixed with other config keys
|
|
185
185
|
let scannedDocument = "doc_scan.jpg"
|
|
186
|
-
let result = model("gemini-3.
|
|
186
|
+
let result = model("gemini-3.5-flash") {images: scannedDocument, thinkingLevel: "low", max_tokens: 2048} {"Transcribe all text visible in this scan."}
|
|
187
187
|
write_file("transcript.txt", result)
|
|
188
188
|
```
|
|
189
189
|
|
|
@@ -216,12 +216,12 @@ print bookInfo["title"]
|
|
|
216
216
|
|
|
217
217
|
- Always include instructions for JSON format
|
|
218
218
|
- Specify the exact schema in the prompt
|
|
219
|
-
- Use "
|
|
219
|
+
- Use "thinkingLevel": "low" for fast, consistent parsing
|
|
220
220
|
- Validate output structure in code
|
|
221
221
|
|
|
222
222
|
```sesi
|
|
223
223
|
let listText = "eggs, milk, bread, cheese, fruit, vegetables"
|
|
224
|
-
let output = structured_output({items: string})(model("gemini-3-flash
|
|
224
|
+
let output = structured_output({items: string})(model("gemini-3.5-flash") {thinkingLevel: "minimal"}{"Return JSON with items array containing: " listText})
|
|
225
225
|
|
|
226
226
|
// Validate
|
|
227
227
|
if type(output["items"]) == "array" {print "Got" str(len(output["items"])) "items"} // Got 6 items
|
|
@@ -329,7 +329,7 @@ print conversation
|
|
|
329
329
|
let categories = "fruit, vegetable, grain"
|
|
330
330
|
let item = "banana"
|
|
331
331
|
fn classify(item: string, categories: string) -> string
|
|
332
|
-
{return model("gemini-3.
|
|
332
|
+
{return model("gemini-3.5-flash") {thinkingLevel: "minimal"}
|
|
333
333
|
{"Classify this item into one category. Categories: " categories " Item: " item " Return only the category name."}}
|
|
334
334
|
print "Item: " item //banana
|
|
335
335
|
print "Category: " classify(item, categories) //fruit
|
|
@@ -341,7 +341,7 @@ print "Category: " classify(item, categories) //fruit
|
|
|
341
341
|
let text = "Elon Musk is the CEO of Tesla and SpaceX."
|
|
342
342
|
fn extractEntities(text: string) -> object
|
|
343
343
|
{let result = structured_output({people: string, places: string, organizations: string})
|
|
344
|
-
(model("gemini-3.
|
|
344
|
+
(model("gemini-3.5-flash") {thinkingLevel: "minimal"}{"Extract named entities from:" text})
|
|
345
345
|
print "Name(s) found: result"
|
|
346
346
|
return result}
|
|
347
347
|
print extractEntities(text)
|
|
@@ -364,7 +364,7 @@ print translate(text, language)
|
|
|
364
364
|
Like `model`, the `image` command evaluates prompts and accepts configuration variables mapping accurately to backend SDKs requirements.
|
|
365
365
|
|
|
366
366
|
```sesi
|
|
367
|
-
let logo = image("gemini-3.1-flash-image-preview") {
|
|
367
|
+
let logo = image("gemini-3.1-flash-image-preview") {ratio: "1:1", size: "512"} {"A high quality vector logo representing a new programming language named Sesi"}
|
|
368
368
|
write_image("logo.png", logo)
|
|
369
369
|
print "Image generated!"
|
|
370
370
|
```
|
|
@@ -376,7 +376,7 @@ print "Image generated!"
|
|
|
376
376
|
```sesi
|
|
377
377
|
let requirement = "Write a function that reverses a string."
|
|
378
378
|
fn generateCode(requirement: string) -> string
|
|
379
|
-
{return model("gemini-3.
|
|
379
|
+
{return model("gemini-3.5-flash") {thinkingLevel: "low"} {"Generate JavaScript code for:" requirement "Only provide code, no explanation."}}
|
|
380
380
|
print "Code generation:"
|
|
381
381
|
print generateCode(requirement)
|
|
382
382
|
```
|
|
@@ -507,10 +507,10 @@ fn smartSummarize(text: string) -> string
|
|
|
507
507
|
|
|
508
508
|
// Chain multiple Reasoning operations
|
|
509
509
|
// Step 1: Extract key points
|
|
510
|
-
{let keyPoints = model("gemini-3.1-pro-preview") {"
|
|
510
|
+
{let keyPoints = model("gemini-3.1-pro-preview") {thinkingLevel: "low"} {"Extract 5 key points from:" text}
|
|
511
511
|
|
|
512
512
|
// Step 2: Analyze topics
|
|
513
|
-
let topics = structured_output({ topics: string })(model("gemini-3.
|
|
513
|
+
let topics = structured_output({ topics: string })(model("gemini-3.5-flash") {thinkingLevel: "low"} {"Identify topics in:" keyPoints})
|
|
514
514
|
|
|
515
515
|
// Step 3: Generate summary
|
|
516
516
|
let summary = model("gemini-3-flash-preview") {"Summarize with topics " topics ":" keyPoints} return summary}
|
|
@@ -520,7 +520,7 @@ print "Summary:" smartSummarize(text)
|
|
|
520
520
|
### Reasoning Pattern
|
|
521
521
|
|
|
522
522
|
```sesi
|
|
523
|
-
let analysis = model("gemini-3-flash
|
|
523
|
+
let analysis = model("gemini-3.5-flash") {thinkingLevel: "medium", max_tokens: 8192} {"Reason carefully about:" problem}
|
|
524
524
|
print analysis
|
|
525
525
|
```
|
|
526
526
|
|
|
@@ -529,7 +529,7 @@ print analysis
|
|
|
529
529
|
```sesi
|
|
530
530
|
let text = "banana"
|
|
531
531
|
fn classifyWithExamples(text: string) -> string
|
|
532
|
-
{return model("gemini-3.
|
|
532
|
+
{return model("gemini-3.5-flash") {thinkingLevel: "minimal"} {"Classify as A, B, or C" "Examples:" "'apple' -> A" "'dog' -> B" "'happy' -> C" "Classify: " text}}
|
|
533
533
|
print "Classification:" classifyWithExamples(text)
|
|
534
534
|
```
|
|
535
535
|
|
package/examples/16_modules.sesi
CHANGED
|
@@ -12,7 +12,7 @@ print "2 raised to power of 10:" + str(pow(2, 10))
|
|
|
12
12
|
print "Sine of PI/2:" + str(sin(PI / 2.0))
|
|
13
13
|
print "=== 2. Standard JSON Module ==="
|
|
14
14
|
import {stringify, parse} from "std/json"
|
|
15
|
-
let original = {"project": "Sesi Language", "version": "1.2.
|
|
15
|
+
let original = {"project": "Sesi Language", "version": "1.2.2", "features": ["modules", "http", "parallel"]}
|
|
16
16
|
let json_str = stringify(original)
|
|
17
17
|
print "Serialized JSON string:"
|
|
18
18
|
print json_str
|