firefly-compiler 0.6.27 → 0.6.30

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.
@@ -1,47 +0,0 @@
1
- nodeMain(system: NodeSystem) {
2
- let secretKey = system.arguments().grab(0)
3
- let json = Json->(
4
- model = "moonshotai/Kimi-K2.6"
5
- messages = [
6
- Json->(role = "user", content = "Can you summerize firefly-lang.org for me.")
7
- ]
8
- tools = [
9
- Json->(type = "function", function = Json->(
10
- name = "web_search"
11
- description = "Search the web for up-to-date information, images, or data based on a query."
12
- parameters = Json->(
13
- type = "object"
14
- properties = Json->(
15
- query = Json->(
16
- type = "string"
17
- description = "The search query to look up on the web."
18
- )
19
- )
20
- required = ["query"]
21
- )
22
- ))
23
- Json->(type = "function", function = Json->(
24
- name = "web_fetch"
25
- description = "Fetch the contents of a URL using a GET request."
26
- parameters = Json->(
27
- type = "object"
28
- properties = Json->(
29
- url = Json->(
30
- type = "string"
31
- description = "The URL to fetch."
32
- )
33
- )
34
- required = ["url"]
35
- )
36
- ))
37
- ]
38
- )
39
- // To give a tool result: {"role": "tool", "content": "... e.g. encoded JSON", "tool_call_id": "call_123"}
40
- system.httpClient().post("https://api.inceptron.io/v1/chat/completions", [
41
- Pair("Content-Type", "application/json")
42
- Pair("Authorization", "Bearer " + secretKey)
43
- ], json.write().toBuffer()) {response =>
44
- Log.debug("Response ok? " + Show.show(response.ok()))
45
- Log.debug(response.readJson().write(Some(" ")))
46
- }
47
- }
@@ -1,44 +0,0 @@
1
- nodeMain(system: NodeSystem) {
2
-
3
- let x: Float = 123.0
4
- let s: String = "Hi"
5
- let p = s + x
6
- let r1: Int = 123.8.round().toInt()
7
- Log.show(p)
8
-
9
- let player = Human("RawFood23", None)
10
- let bot = Bot(42)
11
-
12
- let players: List[Player] = [
13
- Human("RawFood23", None)
14
- Human("Nokoline123", Some(system.date()))
15
- bot
16
-
17
- ]
18
-
19
- players.each {
20
- | Human(name, None) =>
21
- Log.trace(name + " is in lobby")
22
- | Human(name, Some(joined)) =>
23
- Log.trace(name + " joined at " + Show.show(joined))
24
- | Bot(n) =>
25
- Log.trace("Bot nr. " + n)
26
- }
27
-
28
- let player2 = (name = "Jogn", age = 11)
29
-
30
- }
31
-
32
- addPlayer(player: Player) {
33
-
34
- }
35
-
36
- data Player {
37
- Human(
38
- name: String
39
- joined: Option[Date]
40
- )
41
- Bot(
42
- number: Int
43
- )
44
- }
@@ -1,7 +0,0 @@
1
- nodeMain(system: NodeSystem) {
2
-
3
- let result = Ordering.compare([1], [2])
4
- Log.debug(Show.show(result.toInt()))
5
-
6
-
7
- }
@@ -1,4 +0,0 @@
1
- nodeMain(system: NodeSystem) {
2
- let result = Ordering.compare([1], [2])
3
- Log.trace(Show.show(result.toInt()))
4
- }
@@ -1,18 +0,0 @@
1
- dependency ff:postgresql:0.0.0
2
-
3
- import Pg from ff:postgresql
4
-
5
-
6
- testSql(connection: PgConnection): List[String] {
7
- connection.statement("""
8
- -- Comment
9
- select *, benefit, g.deleted, 'Fooo', 123
10
- from guide."GuideHistory" g
11
- join guide."GuideDepartment" GD on g.id = GD.guideid
12
- where g.benefit is not null and $name = '0x42' and true
13
- """)
14
- .withInt("name", 34)
15
- .map {row =>
16
- row.getString("name").grab()
17
- }
18
- }
@@ -1,62 +0,0 @@
1
- data SemanticTokenTypes(
2
- namespace: Pair[String, Int]
3
- type: Pair[String, Int]
4
- class: Pair[String, Int]
5
- enum: Pair[String, Int]
6
- interface: Pair[String, Int]
7
- struct: Pair[String, Int]
8
- typeParameter: Pair[String, Int]
9
- parameter: Pair[String, Int]
10
- variable: Pair[String, Int]
11
- property: Pair[String, Int]
12
- enumMember: Pair[String, Int]
13
- event: Pair[String, Int]
14
- function: Pair[String, Int]
15
- method: Pair[String, Int]
16
- macro: Pair[String, Int]
17
- keyword: Pair[String, Int]
18
- modifier: Pair[String, Int]
19
- comment: Pair[String, Int]
20
- string: Pair[String, Int]
21
- number: Pair[String, Int]
22
- regexp: Pair[String, Int]
23
- operator: Pair[String, Int]
24
- decorator: Pair[String, Int]
25
- label: Pair[String, Int]
26
- )
27
-
28
- new(): Pair[SemanticTokenTypes, List[String]] {
29
- let names = Array.new()
30
- function add(name: String): Pair[String, Int] {
31
- let index = names.size()
32
- names.push(name)
33
- Pair(name, index)
34
- }
35
- let types = SemanticTokenTypes(
36
- namespace = add("namespace")
37
- type = add("type")
38
- class = add("class")
39
- enum = add("enum")
40
- interface = add("interface")
41
- struct = add("struct")
42
- typeParameter = add("typeParameter")
43
- parameter = add("parameter")
44
- variable = add("variable")
45
- property = add("property")
46
- enumMember = add("enumMember")
47
- event = add("event")
48
- function = add("function")
49
- method = add("method")
50
- macro = add("macro")
51
- keyword = add("keyword")
52
- modifier = add("modifier")
53
- comment = add("comment")
54
- string = add("string")
55
- number = add("number")
56
- regexp = add("regexp")
57
- operator = add("operator")
58
- decorator = add("decorator")
59
- label = add("label")
60
- )
61
- Pair(types, names.drain())
62
- }