diff --git a/content/v3/http-outbound.md b/content/v3/http-outbound.md index 7328be83..272110cf 100644 --- a/content/v3/http-outbound.md +++ b/content/v3/http-outbound.md @@ -109,9 +109,9 @@ You can find a complete example of using outbound HTTP in the JavaScript SDK rep {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/http/index.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/http/index.html) -HTTP functions and classes are available in the `http` module. The function name is [`send`](https://spinframework.github.io/spin-python-sdk/http/index.html#spin_sdk.http.send). The [request type](https://spinframework.github.io/spin-python-sdk/http/index.html#spin_sdk.http.Request) is `Request`, and the [response type](https://spinframework.github.io/spin-python-sdk/http/index.html#spin_sdk.http.Response) is `Response`. For example: +HTTP functions and classes are available in the `http` module. The function name is [`send`](https://spinframework.github.io/spin-python-sdk/v3/http/index.html#spin_sdk.http.send). The [request type](https://spinframework.github.io/spin-python-sdk/http/index.html#spin_sdk.http.Request) is `Request`, and the [response type](https://spinframework.github.io/spin-python-sdk/v3/http/index.html#spin_sdk.http.Response) is `Response`. For example: ```python from spin_sdk.http import Request, Response, send diff --git a/content/v3/http-trigger.md b/content/v3/http-trigger.md index 3ff565dd..7f06e032 100644 --- a/content/v3/http-trigger.md +++ b/content/v3/http-trigger.md @@ -281,9 +281,9 @@ addEventListener('fetch', async (event: FetchEvent) => { {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/) -In Python, the application must define a top-level class named IncomingHandler which inherits from [IncomingHandler](https://spinframework.github.io/spin-python-sdk/http/index.html#spin_sdk.http.IncomingHandler), overriding the `handle_request` method. +In Python, the application must define a top-level class named IncomingHandler which inherits from [IncomingHandler](https://spinframework.github.io/spin-python-sdk/v3/http/index.html#spin_sdk.http.IncomingHandler), overriding the `handle_request` method. ```python from spin_sdk import http diff --git a/content/v3/kv-store-api-guide.md b/content/v3/kv-store-api-guide.md index c8e1ce0a..d4167c3a 100644 --- a/content/v3/kv-store-api-guide.md +++ b/content/v3/kv-store-api-guide.md @@ -123,7 +123,7 @@ addEventListener('fetch', async (event: FetchEvent) => { {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/key_value.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/key_value.html) The key value functions are provided through the `spin_key_value` module in the Python SDK. For example: @@ -148,7 +148,7 @@ class IncomingHandler(http.IncomingHandler): **General Notes** - The Python SDK doesn't surface the `close` operation. It automatically closes all stores at the end of the request; there's no way to close them early. -[`get` **Operation**](https://spinframework.github.io/spin-python-sdk/wit/imports/key_value.html#spin_sdk.wit.imports.key_value.Store.get) +[`get` **Operation**](https://spinframework.github.io/spin-python-sdk/v3/wit/imports/key_value.html#spin_sdk.wit.imports.key_value.Store.get) - If a key does not exist, it returns `None` {{ blockEnd }} diff --git a/content/v3/language-support-overview.md b/content/v3/language-support-overview.md index 530a5b73..94598dfc 100644 --- a/content/v3/language-support-overview.md +++ b/content/v3/language-support-overview.md @@ -61,7 +61,7 @@ This page contains information about language support for Spin features: {{ startTab "Python"}} -**[📄 Visit the Python Spin SDK reference documentation](https://spinframework.github.io/spin-python-sdk/v1) to see specific modules, functions, variables and syntax relating to the following Python SDK.** +**[📄 Visit the Python Spin SDK reference documentation](https://spinframework.github.io/spin-python-sdk/v3) to see specific modules, functions, variables and syntax relating to the following Python SDK.** | Feature | SDK Supported? | |-----|-----| diff --git a/content/v3/python-components.md b/content/v3/python-components.md index 708f1d58..353666e9 100644 --- a/content/v3/python-components.md +++ b/content/v3/python-components.md @@ -32,7 +32,7 @@ With Python being a very p > This guide assumes you are familiar with the Python programming language, but if you are just getting started, be sure to check out the official Python documentation and comprehensive language reference. -[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk) +[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3) ## Prerequisite @@ -174,7 +174,7 @@ command = "componentize-py -w spin-http componentize app -o app.wasm" In Spin, HTTP components are triggered by the occurrence of an HTTP request and must return an HTTP response at the end of their execution. Components can be built in any language that compiles to WASI. If you would like additional information about building HTTP applications you may find [the HTTP trigger page](./http-trigger.md) useful. -Building a Spin HTTP component using the Python SDK means defining a top-level class named IncomingHandler which inherits from [`IncomingHandler`](https://spinframework.github.io/spin-python-sdk/wit/exports/index.html#spin_sdk.wit.exports.IncomingHandler), overriding the `handle_request` method. Here is an example of the default Python code which the previous `spin new` created for us; a simple example of a request/response: +Building a Spin HTTP component using the Python SDK means defining a top-level class named IncomingHandler which inherits from [`IncomingHandler`](https://spinframework.github.io/spin-python-sdk/v3/wit/exports/index.html#spin_sdk.wit.exports.IncomingHandler), overriding the `handle_request` method. Here is an example of the default Python code which the previous `spin new` created for us; a simple example of a request/response: diff --git a/content/v3/rdbms-storage.md b/content/v3/rdbms-storage.md index b7a503f1..176da8fc 100644 --- a/content/v3/rdbms-storage.md +++ b/content/v3/rdbms-storage.md @@ -115,7 +115,7 @@ addEventListener('fetch', async (event: FetchEvent) => { {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/) The code below is an [Outbound MySQL example](https://github.com/spinframework/spin-python-sdk/tree/main/examples/spin-mysql). There is also an outbound [PostgreSQL example](https://github.com/spinframework/spin-python-sdk/tree/main/examples/spin-postgres) available. diff --git a/content/v3/redis-outbound.md b/content/v3/redis-outbound.md index e99ce33f..1308f710 100644 --- a/content/v3/redis-outbound.md +++ b/content/v3/redis-outbound.md @@ -115,9 +115,9 @@ You can find a complete TypeScript example for using outbound Redis from an HTTP {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/redis.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/redis.html) -Redis functions are available in [the `redis` module](https://spinframework.github.io/spin-python-sdk/redis.html). The function names are prefixed `redis_`. You must pass the Redis instance address to _each_ operation as its first parameter. For example: +Redis functions are available in [the `redis` module](https://spinframework.github.io/spin-python-sdk/v3/redis.html). The function names are prefixed `redis_`. You must pass the Redis instance address to _each_ operation as its first parameter. For example: ```python from spin_sdk import redis diff --git a/content/v3/redis-trigger.md b/content/v3/redis-trigger.md index 6f9db12b..ffb2a3bc 100644 --- a/content/v3/redis-trigger.md +++ b/content/v3/redis-trigger.md @@ -101,7 +101,7 @@ The JavaScript/TypeScript SDK doesn't currently support Redis components. Pleas {{ startTab "Python"}} -In Python, the handler needs to implement the [`InboundRedis`](https://spinframework.github.io/spin-python-sdk/wit/exports/index.html#spin_sdk.wit.exports.InboundRedis) class, and override the `handle_message` method: +In Python, the handler needs to implement the [`InboundRedis`](https://spinframework.github.io/spin-python-sdk/v3/wit/exports/index.html#spin_sdk.wit.exports.InboundRedis) class, and override the `handle_message` method: ```python from spin_sdk.wit import exports diff --git a/content/v3/serverless-ai-api-guide.md b/content/v3/serverless-ai-api-guide.md index 0a0e7d51..84cb465a 100644 --- a/content/v3/serverless-ai-api-guide.md +++ b/content/v3/serverless-ai-api-guide.md @@ -160,7 +160,7 @@ addEventListener('fetch', async (event: FetchEvent) => { {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/llm.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/llm.html) ```python from spin_sdk import http @@ -178,12 +178,12 @@ class IncomingHandler(http.IncomingHandler): **General Notes** -[`infer` operation](https://spinframework.github.io/spin-python-sdk/llm.html#spin_sdk.llm.infer): +[`infer` operation](https://spinframework.github.io/spin-python-sdk/v3/llm.html#spin_sdk.llm.infer): - The model name is passed in as a string (as shown above; `"llama2-chat"`). -[`infer_with_options` operation](https://spinframework.github.io/spin-python-sdk/llm.html#spin_sdk.llm.infer_with_options): +[`infer_with_options` operation](https://spinframework.github.io/spin-python-sdk/v3/llm.html#spin_sdk.llm.infer_with_options): -- It takes in a model name, prompt text, and optionally a [parameter object](https://spinframework.github.io/spin-python-sdk/llm.html#spin_sdk.llm.InferencingParams) to control the inferencing. +- It takes in a model name, prompt text, and optionally a [parameter object](https://spinframework.github.io/spin-python-sdk/v3/llm.html#spin_sdk.llm.InferencingParams) to control the inferencing. {{ blockEnd }} diff --git a/content/v3/sqlite-api-guide.md b/content/v3/sqlite-api-guide.md index 365aefb4..92cfa450 100644 --- a/content/v3/sqlite-api-guide.md +++ b/content/v3/sqlite-api-guide.md @@ -151,9 +151,9 @@ addEventListener('fetch', async (event: FetchEvent) => { {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/sqlite.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/sqlite.html) -To use SQLite functions, use the `sqlite` module in the Python SDK. The [`sqlite_open`](https://spinframework.github.io/spin-python-sdk/sqlite.html#spin_sdk.sqlite.open) and [`sqlite_open_default`](https://spinframework.github.io/spin-python-sdk/sqlite.html#spin_sdk.sqlite.open_default) functions return a [connection object](https://spinframework.github.io/spin-python-sdk/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.Connection). The connection object provides the [`execute` method](https://spinframework.github.io/spin-python-sdk/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.Connection.execute) as described above. For example: +To use SQLite functions, use the `sqlite` module in the Python SDK. The [`sqlite_open`](https://spinframework.github.io/spin-python-sdk/v3/sqlite.html#spin_sdk.sqlite.open) and [`sqlite_open_default`](https://spinframework.github.io/spin-python-sdk/v3/sqlite.html#spin_sdk.sqlite.open_default) functions return a [connection object](https://spinframework.github.io/spin-python-sdk/v3/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.Connection). The connection object provides the [`execute` method](https://spinframework.github.io/spin-python-sdk/v3/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.Connection.execute) as described above. For example: ```python from spin_sdk import http, sqlite @@ -174,7 +174,7 @@ class IncomingHandler(http.IncomingHandler): ``` **General Notes** -* The `execute` method returns [a `QueryResult` object](https://spinframework.github.io/spin-python-sdk/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.QueryResult) with `rows` and `columns` methods. `columns` returns a list of strings representing column names. `rows` is an array of rows, each of which is an array of [`RowResult`](https://spinframework.github.io/spin-python-sdk/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.RowResult) in the same order as `columns`. +* The `execute` method returns [a `QueryResult` object](https://spinframework.github.io/spin-python-sdk/v3/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.QueryResult) with `rows` and `columns` methods. `columns` returns a list of strings representing column names. `rows` is an array of rows, each of which is an array of [`RowResult`](https://spinframework.github.io/spin-python-sdk/v3/wit/imports/sqlite.html#spin_sdk.wit.imports.sqlite.RowResult) in the same order as `columns`. * The connection object doesn't surface the `close` function. * Errors are surfaced as exceptions. diff --git a/content/v3/variables.md b/content/v3/variables.md index dc7f78a2..46ed0198 100644 --- a/content/v3/variables.md +++ b/content/v3/variables.md @@ -171,9 +171,9 @@ addEventListener('fetch', async (event: FetchEvent) => { {{ startTab "Python"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/variables.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-python-sdk/v3/variables.html) -The `variables` module has a function called `get`(https://spinframework.github.io/spin-python-sdk/variables.html#spin_sdk.variables.get). +The `variables` module has a function called `get`(https://spinframework.github.io/spin-python-sdk/v3/variables.html#spin_sdk.variables.get). ```py from spin_sdk.http import IncomingHandler, Request, Response, send