Skip to content

Commit 52c1615

Browse files
authored
Merge pull request #103 from golemcloud/llm-session
LLM API refactor
2 parents a8141be + 43f910f commit 52c1615

File tree

73 files changed

+3081
-2049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3081
-2049
lines changed

.github/workflows/ci.yaml

Lines changed: 277 additions & 277 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exec/Makefile.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,8 @@ echo "Copied WIT for module test"
138138

139139
[tasks.build-test-components]
140140
dependencies = ["build"]
141-
install_crate = "cargo-binstall"
142141
description = "Builds exec test components with golem-cli"
143142
script = '''
144-
cargo-binstall [email protected] --locked --no-confirm
145-
cargo-binstall wac-cli --locked --no-confirm
146143
cd ../test/exec
147144
148145
golem-cli --version
@@ -152,11 +149,8 @@ golem-cli --dev-mode app build
152149

153150
[tasks.release-build-test-components]
154151
dependencies = ["release-build"]
155-
install_crate = "cargo-binstall"
156152
description = "Builds exec test components with golem-cli"
157153
script = '''
158-
cargo-binstall [email protected] --locked --no-confirm
159-
cargo-binstall wac-cli --locked --no-confirm
160154
cd ../test/exec
161155
162156
golem-cli --version

exec/exec/wit/deps/golem-exec/golem-exec.wit

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ package golem:[email protected];
33
interface types {
44
/// Supported language types and optional version
55
record language {
6+
/// The language to use
67
kind: language-kind,
8+
/// Optionally further narrow down the language version
79
version: option<string>,
810
}
911

12+
/// Supported languages
1013
enum language-kind {
1114
javascript,
1215
python,
@@ -21,54 +24,75 @@ interface types {
2124

2225
/// Code or data file
2326
record file {
27+
/// File name
2428
name: string,
29+
/// Raw file contents
2530
content: list<u8>,
26-
encoding: option<encoding>, // defaults to utf8
31+
/// Encoding of `content`, defaults to `utf8`
32+
encoding: option<encoding>,
2733
}
2834

2935
/// Resource limits
3036
record limits {
37+
/// Limit the execution time, in milliseconds
3138
time-ms: option<u64>,
39+
/// Limit the memory usage, in bytes
3240
memory-bytes: option<u64>,
41+
/// Limit the maximum file size, in bytes
3342
file-size-bytes: option<u64>,
43+
/// Limit the number of spawned processes
3444
max-processes: option<u32>,
3545
}
3646

3747
/// Execution outcome per stage
3848
record stage-result {
49+
/// Standard output
3950
stdout: string,
51+
/// Standard error output
4052
stderr: string,
53+
/// Exit code of the process, if any
4154
exit-code: option<s32>,
55+
/// Signal that caused the process to terminate, if any
4256
signal: option<string>,
4357
}
4458

4559
/// Complete execution result
4660
record exec-result {
61+
/// Result of the compilation stage, if any
4762
compile: option<stage-result>,
63+
/// Result of the execution stage
4864
run: stage-result,
65+
/// Execution time in milliseconds
4966
time-ms: option<u64>,
67+
/// Consumed memory in bytes
5068
memory-bytes: option<u64>,
5169
}
5270

5371
/// Execution error types
5472
variant error {
73+
/// The chosen langauge is not supported
5574
unsupported-language,
75+
/// Compilation failed
5676
compilation-failed(stage-result),
77+
/// Execution failed
5778
runtime-failed(stage-result),
79+
/// Timed out
5880
timeout,
81+
/// Resource limits exceeded
5982
resource-exceeded,
83+
/// Internal execution error
6084
internal(string),
6185
}
6286

6387
/// Options for controlling the script runner environment
64-
/// - `stdin` is optional input to provide to the program.
65-
/// - `args` are command line arguments passed to the program.
66-
/// - `env` is a list of environment variables to set for the execution.
67-
/// - `limits` are optional resource limits for the execution.
6888
record run-options {
89+
/// optional input to provide to the program.
6990
stdin: option<string>,
91+
/// command line arguments passed to the program
7092
args: option<list<string>>,
93+
/// a list of environment variables to set for the execution
7194
env: option<list<tuple<string, string>>>,
95+
/// optional resource limits for the execution
7296
limits: option<limits>
7397
}
7498
}

graph/Makefile.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,8 @@ echo "Copied WIT for module test/graph"
137137

138138
[tasks.build-test-components]
139139
dependencies = ["build"]
140-
install_crate = "cargo-binstall"
141140
description = "Builds graph test components with golem-cli"
142141
script = '''
143-
cargo-binstall [email protected] --locked --no-confirm
144-
cargo-binstall wac-cli --locked --no-confirm
145142
cd ../test/graph
146143
147144
golem-cli --version
@@ -155,11 +152,8 @@ golem-cli --dev-mode app build -b neo4j-debug
155152

156153
[tasks.release-build-test-components]
157154
dependencies = ["release-build"]
158-
install_crate = "cargo-binstall"
159155
description = "Builds graph test components with golem-cli"
160156
script = '''
161-
cargo-binstall [email protected] --locked --no-confirm
162-
cargo-binstall wac-cli --locked --no-confirm
163157
cd ../test/graph
164158
165159
golem-cli --version

llm/anthropic/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ serde = { workspace = true }
2525
serde_json = { workspace = true }
2626
wit-bindgen-rt = { workspace = true }
2727
base64 = { workspace = true }
28+
indoc = "2.0.6"
2829

2930
[package.metadata.component]
3031
package = "golem:llm-anthropic"

0 commit comments

Comments
 (0)