Skip to content

Commit d66e95a

Browse files
authored
add spin 3 interfaces and bump version number (#291)
* add spin 3 interfaces and bump version number Signed-off-by: karthik2804 <[email protected]> * fix templates and update spin version in ci Signed-off-by: karthik2804 <[email protected]> --------- Signed-off-by: karthik2804 <[email protected]>
1 parent 676d850 commit d66e95a

File tree

31 files changed

+1739
-386
lines changed

31 files changed

+1739
-386
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
uses: fermyon/actions/spin/setup@v1
3232
with:
3333
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
version: "v3.0.0-rc.1"
3435

3536
- name: Run Test
3637
shell: bash
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
package spin:postgres@3.0.0;
2+
3+
interface postgres {
4+
/// Errors related to interacting with a database.
5+
variant error {
6+
connection-failed(string),
7+
bad-parameter(string),
8+
query-failed(string),
9+
value-conversion-failed(string),
10+
other(string)
11+
}
12+
13+
/// Data types for a database column
14+
enum db-data-type {
15+
boolean,
16+
int8,
17+
int16,
18+
int32,
19+
int64,
20+
floating32,
21+
floating64,
22+
str,
23+
binary,
24+
date,
25+
time,
26+
datetime,
27+
timestamp,
28+
other,
29+
}
30+
31+
/// Database values
32+
variant db-value {
33+
boolean(bool),
34+
int8(s8),
35+
int16(s16),
36+
int32(s32),
37+
int64(s64),
38+
floating32(f32),
39+
floating64(f64),
40+
str(string),
41+
binary(list<u8>),
42+
date(tuple<s32, u8, u8>), // (year, month, day)
43+
time(tuple<u8, u8, u8, u32>), // (hour, minute, second, nanosecond)
44+
/// Date-time types are always treated as UTC (without timezone info).
45+
/// The instant is represented as a (year, month, day, hour, minute, second, nanosecond) tuple.
46+
datetime(tuple<s32, u8, u8, u8, u8, u8, u32>),
47+
/// Unix timestamp (seconds since epoch)
48+
timestamp(s64),
49+
db-null,
50+
unsupported,
51+
}
52+
53+
/// Values used in parameterized queries
54+
variant parameter-value {
55+
boolean(bool),
56+
int8(s8),
57+
int16(s16),
58+
int32(s32),
59+
int64(s64),
60+
floating32(f32),
61+
floating64(f64),
62+
str(string),
63+
binary(list<u8>),
64+
date(tuple<s32, u8, u8>), // (year, month, day)
65+
time(tuple<u8, u8, u8, u32>), // (hour, minute, second, nanosecond)
66+
/// Date-time types are always treated as UTC (without timezone info).
67+
/// The instant is represented as a (year, month, day, hour, minute, second, nanosecond) tuple.
68+
datetime(tuple<s32, u8, u8, u8, u8, u8, u32>),
69+
/// Unix timestamp (seconds since epoch)
70+
timestamp(s64),
71+
db-null,
72+
}
73+
74+
/// A database column
75+
record column {
76+
name: string,
77+
data-type: db-data-type,
78+
}
79+
80+
/// A database row
81+
type row = list<db-value>;
82+
83+
/// A set of database rows
84+
record row-set {
85+
columns: list<column>,
86+
rows: list<row>,
87+
}
88+
89+
/// A connection to a postgres database.
90+
resource connection {
91+
/// Open a connection to the Postgres instance at `address`.
92+
open: static func(address: string) -> result<connection, error>;
93+
94+
/// Query the database.
95+
query: func(statement: string, params: list<parameter-value>) -> result<row-set, error>;
96+
97+
/// Execute command to the database.
98+
execute: func(statement: string, params: list<parameter-value>) -> result<u64, error>;
99+
}
100+
}
File renamed without changes.

bin/wit/llm.wit renamed to bin/wit/deps/[email protected]/llm.wit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ interface llm {
1010
/// Note: the backing implementation may return less tokens.
1111
max-tokens: u32,
1212
/// The amount the model should avoid repeating tokens.
13-
repeat-penalty: float32,
13+
repeat-penalty: f32,
1414
/// The number of tokens the model should apply the repeat penalty to.
1515
repeat-penalty-last-n-token-count: u32,
1616
/// The randomness with which the next token is selected.
17-
temperature: float32,
17+
temperature: f32,
1818
/// The number of possible next tokens the model will choose from.
1919
top-k: u32,
2020
/// The probability total of next tokens the model will choose from.
21-
top-p: float32
21+
top-p: f32
2222
}
2323

2424
/// The set of errors which may be raised by functions in this interface
@@ -57,7 +57,7 @@ interface llm {
5757
/// Result of generating embeddings
5858
record embeddings-result {
5959
/// The embeddings generated by the request
60-
embeddings: list<list<float32>>,
60+
embeddings: list<list<f32>>,
6161
/// Usage related to the embeddings generation request
6262
usage: embeddings-usage
6363
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ interface rdbms-types {
3737
uint16(u16),
3838
uint32(u32),
3939
uint64(u64),
40-
floating32(float32),
41-
floating64(float64),
40+
floating32(f32),
41+
floating64(f64),
4242
str(string),
4343
binary(list<u8>),
4444
db-null,
@@ -56,8 +56,8 @@ interface rdbms-types {
5656
uint16(u16),
5757
uint32(u32),
5858
uint64(u64),
59-
floating32(float32),
60-
floating64(float64),
59+
floating32(f32),
60+
floating64(f64),
6161
str(string),
6262
binary(list<u8>),
6363
db-null,
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)