Skip to content
このページは AI の支援により作成・翻訳されました。誤りがあれば、改善にご協力ください。 GitHub で編集

ホスト関数

ホスト関数は PRX が WASM プラグインに公開する API サーフェスです。HTTP リクエスト、ファイル操作、エージェント状態などのホスト機能への制御されたアクセスを提供します。

利用可能なホスト関数

HTTP

関数説明権限
http_request(method, url, headers, body)HTTP リクエストを実行net.http
http_get(url)GET リクエストのショートハンドnet.http
http_post(url, body)POST リクエストのショートハンドnet.http

ファイルシステム

関数説明権限
fs_read(path)ファイルを読み取りfs.read
fs_write(path, data)ファイルに書き込みfs.write
fs_list(path)ディレクトリの内容を一覧表示fs.read

エージェント状態

関数説明権限
memory_get(key)エージェントメモリから読み取りagent.memory.read
memory_set(key, value)エージェントメモリに書き込みagent.memory.write
config_get(key)プラグイン設定を読み取りagent.config

ログ

関数説明権限
log_info(msg)info レベルでログ記録常に許可
log_warn(msg)warn レベルでログ記録常に許可
log_error(msg)error レベルでログ記録常に許可

権限マニフェスト

各プラグインはマニフェストで必要な権限を宣言します:

toml
[permissions]
net.http = ["api.example.com"]
fs.read = ["/data/*"]
agent.memory.read = true

関連ページ

Released under the Apache-2.0 License.