Skip to content

Commit 453ad6a

Browse files
committed
google
1 parent 53c9bb2 commit 453ad6a

File tree

14 files changed

+1712
-1
lines changed

14 files changed

+1712
-1
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace]
22
resolver = "2"
33

4-
members = [ "golem-llm/llm", "golem-llm/llm-anthropic", "golem-llm/llm-grok", "golem-llm/llm-ollama", "golem-llm/llm-openai", "golem-llm/llm-openrouter", "golem-web-search/web-search"]
4+
members = [ "golem-llm/llm", "golem-llm/llm-anthropic", "golem-llm/llm-grok", "golem-llm/llm-ollama", "golem-llm/llm-openai", "golem-llm/llm-openrouter", "golem-web-search/web-search", "golem-web-search/websearch-google"]
55

66
[profile.release]
77
debug = false

golem-web-search/Makefile.toml

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
[config]
2+
default_to_workspace = false
3+
skip_core_tasks = true
4+
5+
[tasks.clean]
6+
command = "cargo"
7+
args = ["clean"]
8+
9+
[tasks.unit-tests]
10+
command = "cargo"
11+
args = ["test"]
12+
13+
[tasks.build-google]
14+
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
15+
command = "cargo-component"
16+
args = ["build", "-p", "golem-websearch-google"]
17+
18+
[tasks.build-google-portable]
19+
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
20+
command = "cargo-component"
21+
args = ["build", "-p", "golem-websearch-google", "--no-default-features"]
22+
23+
[tasks.build]
24+
dependencies = [
25+
"build-google",
26+
]
27+
28+
[tasks.build-portable]
29+
dependencies = [
30+
"build-google-portable",
31+
]
32+
33+
[tasks.build-all]
34+
script_runner = "@duckscript"
35+
script = '''
36+
mkdir ../components/web-search/debug
37+
38+
cm_run_task clean
39+
cm_run_task build
40+
41+
cp ../target/wasm32-wasip1/debug/golem_websearch_google.wasm ../components/web-search/debug/golem_websearch_google.wasm
42+
43+
cm_run_task clean
44+
cm_run_task build-portable
45+
46+
cp ../target/wasm32-wasip1/debug/golem_websearch_google.wasm ../components/web-search/debug/golem_websearch_google-portable.wasm
47+
'''
48+
49+
[tasks.release-build-google]
50+
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
51+
command = "cargo-component"
52+
args = ["build", "-p", "golem-websearch-google", "--release"]
53+
54+
[tasks.release-build-google-portable]
55+
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
56+
command = "cargo-component"
57+
args = ["build", "-p", "golem-websearch-google", "--release", "--no-default-features"]
58+
59+
[tasks.release-build]
60+
dependencies = [
61+
"release-build-google",
62+
]
63+
64+
[tasks.release-build-portable]
65+
dependencies = [
66+
"release-build-google-portable",
67+
]
68+
69+
[tasks.release-build-all]
70+
script_runner = "@duckscript"
71+
script = '''
72+
mkdir ../components/web-search/release
73+
74+
cm_run_task set-version
75+
76+
cm_run_task clean
77+
cm_run_task release-build
78+
79+
cp ../target/wasm32-wasip1/release/golem_websearch_google.wasm ../components/web-search/release/golem_websearch_google.wasm
80+
81+
cm_run_task clean
82+
cm_run_task release-build-portable
83+
84+
cp ../target/wasm32-wasip1/release/golem_websearch_google.wasm ../components/web-search/release/golem_websearch_google-portable.wasm
85+
'''
86+
87+
[tasks.wit-update]
88+
install_crate = { crate_name = "wit-deps-cli" }
89+
command = "wit-deps"
90+
args = ["update"]
91+
92+
[tasks.wit]
93+
dependencies = ["wit-update"]
94+
script_runner = "@duckscript"
95+
script = """
96+
rm -r web-search/wit/deps
97+
mkdir web-search/wit/deps/golem-web-search
98+
cp wit/golem-web-search.wit web-search/wit/deps/golem-web-search/golem-web-search.wit
99+
cp wit/deps/wasi:io web-search/wit/deps
100+
101+
rm -r websearch-google/wit/deps
102+
mkdir websearch-google/wit/deps/golem-web-search
103+
cp wit/golem-web-search.wit websearch-google/wit/deps/golem-web-search/golem-web-search.wit
104+
cp wit/deps/wasi:io websearch-google/wit/deps
105+
"""
106+
107+
[tasks.check]
108+
description = "Runs rustfmt and clippy checks without applying any fix"
109+
dependencies = ["check-clippy", "check-rustfmt"]
110+
111+
[tasks.check-rustfmt]
112+
description = "Runs rustfmt checks without applying any fix"
113+
install_crate = "rustfmt"
114+
command = "cargo"
115+
args = ["fmt", "--all", "--", "--check"]
116+
117+
[tasks.check-clippy]
118+
description = "Runs clippy checks without applying any fix"
119+
install_crate = "clippy"
120+
command = "cargo"
121+
args = ["clippy", "--all-targets", "--", "--no-deps", "-Dwarnings"]
122+
123+
[tasks.fix]
124+
description = "Runs rustfmt and clippy checks and applies fixes"
125+
dependencies = ["wit", "fix-clippy", "fix-rustfmt"]
126+
127+
[tasks.fix-rustfmt]
128+
description = "Runs rustfmt checks and applies fixes"
129+
install_crate = "rustfmt"
130+
command = "cargo"
131+
args = ["fmt", "--all"]
132+
133+
[tasks.fix-clippy]
134+
description = "Runs clippy checks and applies fixes"
135+
install_crate = "clippy"
136+
command = "cargo"
137+
args = [
138+
"clippy",
139+
"--fix",
140+
"--allow-dirty",
141+
"--allow-staged",
142+
"--",
143+
"--no-deps",
144+
"-Dwarnings",
145+
]
146+
147+
[tasks.set-version]
148+
description = "Sets the version in all Cargo.toml files to the value of the VERSION environment variable"
149+
condition = { env_set = ["VERSION"] }
150+
script = '''
151+
grep -rl --include 'Cargo.toml' '0\.0\.0' | xargs sed -i "s/0\.0\.0/${VERSION}/g"
152+
'''
153+
154+
[tasks.set-version.mac]
155+
condition = { env_set = ["VERSION"] }
156+
script = '''
157+
grep -rl --include '.*Cargo\.toml' '0\.0\.0' | xargs sed -i "" "s/0\.0\.0/${VERSION}/g"
158+
'''
159+
160+
[tasks.set-version.windows]
161+
script_runner = "powershell"
162+
script_extension = "ps1"
163+
condition = { env_set = ["VERSION"] }
164+
script = '''
165+
$cargoFiles = Get-ChildItem . Cargo.toml -rec
166+
foreach ($file in $cargoFiles)
167+
{
168+
(Get-Content $file.PSPath) |
169+
Foreach-Object { $_ -replace "0.0.0", $Env:VERSION } |
170+
Set-Content $file.PSPath
171+
}
172+
'''
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[package]
2+
name = "golem-websearch-google"
3+
version = "0.0.0"
4+
edition = "2021"
5+
license = "Apache-2.0"
6+
homepage = "https://golem.cloud"
7+
repository = "https://github.com/golemcloud/golem-llm"
8+
description = "WebAssembly component for working with Anthropic APIs, with special support for Golem Cloud"
9+
10+
[lib]
11+
path = "src/lib.rs"
12+
crate-type = ["cdylib"]
13+
14+
[features]
15+
default = ["durability"]
16+
durability = ["golem-rust/durability", "golem-web-search/durability"]
17+
18+
[dependencies]
19+
golem-web-search = { path = "../web-search", version = "0.0.0", default-features = false }
20+
21+
golem-rust = { workspace = true }
22+
log = { workspace = true }
23+
reqwest = { workspace = true }
24+
serde = { workspace = true }
25+
serde_json = { workspace = true }
26+
wit-bindgen-rt = { workspace = true }
27+
base64 = { workspace = true }
28+
29+
[package.metadata.component]
30+
package = "golem:websearch-google"
31+
32+
[package.metadata.component.bindings]
33+
generate_unused_types = true
34+
35+
[package.metadata.component.bindings.with]
36+
"golem:web-search/web-search@1.0.0" = "golem_web_search::golem::web_search::web_search"
37+
38+
[package.metadata.component.target]
39+
path = "wit"
40+
41+
[package.metadata.component.target.dependencies]
42+
"golem:web-search" = { path = "wit/deps/golem-web-search" }
43+
"wasi:io" = { path = "wit/deps/wasi:io"}

0 commit comments

Comments
 (0)