File tree Expand file tree Collapse file tree 4 files changed +15
-22
lines changed Expand file tree Collapse file tree 4 files changed +15
-22
lines changed Original file line number Diff line number Diff line change 11__pycache__
22some-world
3+ component /output.wasm
4+
Original file line number Diff line number Diff line change 1- from pydantic import BaseModel
1+ import wit_world
22
3- class Protocol (BaseModel ):
4- text : str
3+ # from pydantic import BaseModel
54
5+ # class Protocol(BaseModel):
6+ # text: str
67
7- def run (text : str ):
8- return Protocol (text = text ).model_dump_json ()
8+
9+ class WitWorld (wit_world .WitWorld ):
10+ def hello (text : str = "meh" ):
11+ return Protocol (text = text ).model_dump_json ()
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- componentize-py -d main.wit -w string-actor-sync bindings some-world
3+ componentize-py -d main.wit -w hello bindings some-world
44
55cd /app
6- componentize-py -w string-actor-sync -d /component/main.wit componentize --stub-wasi main -o /component/output.wasm -p .
7- # same with: -p /wasi_deps
6+ componentize-py -w hello -d /component/main.wit componentize --stub-wasi main -o /component/output.wasm -p . -p /wasi_deps
Original file line number Diff line number Diff line change 1- package ax : quantum ;
1+ package ax : hello ;
22
3- interface incoming-sync {
4- incoming-request : func (path : string , payload : string ) -> result <string , string >;
5- }
6- interface outgoing-sync {
7- outgoing-request : func (path : string , payload : string ) -> result <string , string >;
8- }
9- world string-actor-sync {
10- import outgoing-sync ;
11- export incoming-sync ;
12-
13- export init : interface {
14- init : func ();
15- }
3+ world hello {
4+ export hello : func () -> string ;
165}
You can’t perform that action at this time.
0 commit comments