Skip to content

Commit 66925d3

Browse files
committed
further sdk module/docs/example updates
Signed-off-by: Vaughn Dice <vdice@akamai.com>
1 parent 96588ca commit 66925d3

23 files changed

Lines changed: 156 additions & 40 deletions

File tree

docs/v4/http/index.html

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v4/key_value.html

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

docs/v4/mqtt.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v4/postgres.html

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

docs/v4/redis.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v4/sqlite.html

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

docs/v4/variables.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/spin-kv/app.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
class WasiHttpHandler030Rc20260315(http.Handler):
55
async def handle_request(self, request: Request) -> Response:
6-
with key_value.open_default() as a:
7-
a.set("test", bytes("hello world!", "utf-8"))
8-
print(a.get_keys())
9-
print(a.exists("test"))
10-
print(a.get("test"))
11-
a.delete("test")
12-
print(a.get_keys())
6+
with await key_value.open_default() as a:
7+
await a.set("test", bytes("hello world!", "utf-8"))
8+
print(await a.get_keys())
9+
print(await a.exists("test"))
10+
print(await a.get("test"))
11+
await a.delete("test")
12+
print(await a.get_keys())
1313

1414
return Response(
1515
200,

examples/spin-llm/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from spin_sdk import http, llm
22
from spin_sdk.http import Request, Response
33

4-
class WasiHttpHandler030Rc20260315(http.Handler):
5-
async def handle_request(self, request: Request) -> Response:
4+
class WasiHttpIncomingHandler020(http.IncomingHandler):
5+
def handle_request(self, request: Request) -> Response:
66
res = llm.infer("llama2-chat", "tell me a joke")
77
print(res.text)
88
print(res.usage)

examples/spin-llm/spin.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ source = "app.wasm"
1515
allowed_outbound_hosts = []
1616
ai_models = ["llama2-chat"]
1717
[component.test.build]
18-
command = "componentize-py -w spin:up/http-trigger@4.0.0 componentize app -o app.wasm"
18+
command = "componentize-py -w fermyon:spin/http-trigger@3.0.0 componentize app -o app.wasm"

0 commit comments

Comments
 (0)