From 0a178379964a08936ed7a6641f4015845ff7a7ba Mon Sep 17 00:00:00 2001 From: karthik2804 Date: Mon, 17 Feb 2025 11:07:51 +0100 Subject: [PATCH] update js sdk doc links Signed-off-by: karthik2804 --- content/spin/v2/http-trigger.md | 4 ++-- content/spin/v2/javascript-components.md | 2 +- content/spin/v2/kv-store-api-guide.md | 10 ++++----- content/spin/v2/language-support-overview.md | 2 +- content/spin/v2/mqtt-outbound.md | 4 ++-- content/spin/v2/rdbms-storage.md | 2 +- content/spin/v2/redis-outbound.md | 4 ++-- content/spin/v2/serverless-ai-api-guide.md | 14 ++++++------- content/spin/v2/sqlite-api-guide.md | 4 ++-- content/spin/v2/variables.md | 2 +- content/spin/v3/http-trigger.md | 22 +++++++++++++------- content/spin/v3/javascript-components.md | 2 +- content/spin/v3/kv-store-api-guide.md | 10 ++++----- content/spin/v3/language-support-overview.md | 2 +- content/spin/v3/mqtt-outbound.md | 4 ++-- content/spin/v3/rdbms-storage.md | 2 +- content/spin/v3/redis-outbound.md | 4 ++-- content/spin/v3/serverless-ai-api-guide.md | 14 ++++++------- content/spin/v3/sqlite-api-guide.md | 4 ++-- content/spin/v3/variables.md | 2 +- 20 files changed, 60 insertions(+), 54 deletions(-) diff --git a/content/spin/v2/http-trigger.md b/content/spin/v2/http-trigger.md index c828c064f..9482b39a5 100644 --- a/content/spin/v2/http-trigger.md +++ b/content/spin/v2/http-trigger.md @@ -265,11 +265,11 @@ For a full Rust SDK reference, see the [Rust Spin SDK documentation](https://doc {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/) The user must a define a function named `handler` which the SDK attaches to the [`FetchEvent` listener](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent). Note that the incoming HTTP event is translated to a `FetchEvent`. -The handler function takes in two arguments a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and a [ResponseBuilder](https://spinframework.github.io/spin-js-sdk/classes/ResponseBuilder.html) +The handler function takes in two arguments a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and a [ResponseBuilder](https://spinframework.github.io/spin-js-sdk/v2.3/classes/ResponseBuilder.html) ```ts import { ResponseBuilder } from "@fermyon/spin-sdk"; diff --git a/content/spin/v2/javascript-components.md b/content/spin/v2/javascript-components.md index 3b6b6ba41..e3cd6e5fb 100644 --- a/content/spin/v2/javascript-components.md +++ b/content/spin/v2/javascript-components.md @@ -31,7 +31,7 @@ With JavaScript being a very popular language, Spin provides an SDK to support b > All examples from this page can be found in [the JavaScript SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples). -[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/) ## Installing Templates diff --git a/content/spin/v2/kv-store-api-guide.md b/content/spin/v2/kv-store-api-guide.md index a0297d6ff..f7dc72b77 100644 --- a/content/spin/v2/kv-store-api-guide.md +++ b/content/spin/v2/kv-store-api-guide.md @@ -83,9 +83,9 @@ fn handle_request(_req: Request) -> Result { {{ startTab "Typescript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/) -The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html). For example: +The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html). For example: ```ts import { ResponseBuilder , Kv} from "@fermyon/spin-sdk"; @@ -102,14 +102,14 @@ export async function handler(req: Request, res: ResponseBuilder) { **General Notes** - The 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-js-sdk/interfaces/Kv.Store.html#get) +[`get` **Operation**](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html#get) - The result is of the type `Uint8Array | null` - If the key does not exist, `get` returns `null` -[`set` **Operation**](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#set) +[`set` **Operation**](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html#set) - The value argument is of the type `Uint8Array | string | object`. -[`setJson`](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#setJson) and [`getJson` **Operation**](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#getJson) +[`setJson`](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html#setJson) and [`getJson` **Operation**](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Kv.Store.html#getJson) - Applications can store JavaScript objects using `setJson`; these are serialized within the store as JSON. These serialized objects can be retrieved and deserialized using `getJson`. If you call `getJson` on a key that doesn't exist then it returns an empty object. {{ blockEnd }} diff --git a/content/spin/v2/language-support-overview.md b/content/spin/v2/language-support-overview.md index afba23a95..b01eb28b4 100644 --- a/content/spin/v2/language-support-overview.md +++ b/content/spin/v2/language-support-overview.md @@ -37,7 +37,7 @@ This page contains information about language support for Spin features: {{ startTab "TypeScript"}} -**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.** +**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/v2.3/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.** | Feature | SDK Supported? | |-----|-----| diff --git a/content/spin/v2/mqtt-outbound.md b/content/spin/v2/mqtt-outbound.md index 0b331965a..d1f6a3f73 100644 --- a/content/spin/v2/mqtt-outbound.md +++ b/content/spin/v2/mqtt-outbound.md @@ -57,7 +57,7 @@ You can find a complete Rust code example for using outbound MQTT from an HTTP c {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Mqtt.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Mqtt.html) To access an MQTT server, use the `Mqtt.open` function. @@ -72,7 +72,7 @@ let catPicture = new Uint8Array(await req.arraybuffer()); connection.publish("pets", catPicture, QoS.AtleastOnce); ``` -For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/modules/Mqtt.html) +For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Mqtt.html) You can find a complete Rust code example for using outbound MQTT from an HTTP component in the [Spin Rust SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-mqtt). diff --git a/content/spin/v2/rdbms-storage.md b/content/spin/v2/rdbms-storage.md index c9312cf90..8e7c011f0 100644 --- a/content/spin/v2/rdbms-storage.md +++ b/content/spin/v2/rdbms-storage.md @@ -71,7 +71,7 @@ For full information about the MySQL and PostgreSQL APIs, see [the Spin SDK refe {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/) The code below is an [Outbound MySQL example](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-mysql). There is also an outbound [PostgreSQL example](https://github.com/spinframework/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-postgres) available. diff --git a/content/spin/v2/redis-outbound.md b/content/spin/v2/redis-outbound.md index 113ec2501..ef5adb55a 100644 --- a/content/spin/v2/redis-outbound.md +++ b/content/spin/v2/redis-outbound.md @@ -89,9 +89,9 @@ You can find a complete Rust code example for using outbound Redis from an HTTP {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/) -Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/modules/Redis.html). The function names match the operations above. For example: +Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Redis.html). The function names match the operations above. For example: ```javascript import { Redis } from "@fermyon/spin-sdk" diff --git a/content/spin/v2/serverless-ai-api-guide.md b/content/spin/v2/serverless-ai-api-guide.md index 407915fd9..3da6044b4 100644 --- a/content/spin/v2/serverless-ai-api-guide.md +++ b/content/spin/v2/serverless-ai-api-guide.md @@ -112,9 +112,9 @@ The `infer_with_options` examples, operation: {{ startTab "Typescript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Llm.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Llm.html) -To use Serverless AI functions, [the `Llm` module](https://spinframework.github.io/spin-js-sdk/modules/Llm.html) from the Spin SDK provides two methods: `infer` and `generateEmbeddings`. For example: +To use Serverless AI functions, [the `Llm` module](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Llm.html) from the Spin SDK provides two methods: `infer` and `generateEmbeddings`. For example: ```javascript import { ResponseBuilder, Llm} from "@fermyon/spin-sdk" @@ -134,15 +134,15 @@ export async function handler(req: Request, res: ResponseBuilder) { `infer` operation: - It takes in the following arguments - model name, prompt and a optional third parameter for inferencing options. -- The model name is a string. There are enums for the inbuilt models (llama2-chat and codellama) in [`InferencingModels`](https://spinframework.github.io/spin-js-sdk/enums/Llm.InferencingModels.html). -- The optional third parameter which is an [InferencingOptions](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.InferencingOptions.html) interface allows you to specify parameters such as `maxTokens`, `repeatPenalty`, `repeatPenaltyLastNTokenCount`, `temperature`, `topK`, `topP`. -- The return value is an [`InferenceResult`](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.EmbeddingResult.html). +- The model name is a string. There are enums for the inbuilt models (llama2-chat and codellama) in [`InferencingModels`](https://spinframework.github.io/spin-js-sdk/v2.3/enums/Llm.InferencingModels.html). +- The optional third parameter which is an [InferencingOptions](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Llm.InferencingOptions.html) interface allows you to specify parameters such as `maxTokens`, `repeatPenalty`, `repeatPenaltyLastNTokenCount`, `temperature`, `topK`, `topP`. +- The return value is an [`InferenceResult`](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Llm.EmbeddingResult.html). `generateEmbeddings` operation: - It takes two arguments - model name and list of strings to generate the embeddings for. -- The model name is a string. There are enums for the inbuilt models (AllMiniLmL6V2) in [`EmbeddingModels`](https://spinframework.github.io/spin-js-sdk/enums/Llm.EmbeddingModels.html). -- The return value is an [`EmbeddingResult`](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.EmbeddingResult.html) +- The model name is a string. There are enums for the inbuilt models (AllMiniLmL6V2) in [`EmbeddingModels`](https://spinframework.github.io/spin-js-sdk/v2.3/enums/Llm.EmbeddingModels.html). +- The return value is an [`EmbeddingResult`](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Llm.EmbeddingResult.html) {{ blockEnd }} diff --git a/content/spin/v2/sqlite-api-guide.md b/content/spin/v2/sqlite-api-guide.md index 790717083..767e58627 100644 --- a/content/spin/v2/sqlite-api-guide.md +++ b/content/spin/v2/sqlite-api-guide.md @@ -120,9 +120,9 @@ struct ToDo { {{ startTab "Typescript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Sqlite.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Sqlite.html) -To use SQLite functions, use [the `Sqlite.open` or `Sqlite.openDefault` function](https://spinframework.github.io/spin-js-sdk/modules/Sqlite.html) to obtain [a `SqliteConnection` object](https://spinframework.github.io/spin-js-sdk/interfaces/Sqlite.SqliteConnection.html). `SqliteConnection` provides the `execute` method as described above. For example: +To use SQLite functions, use [the `Sqlite.open` or `Sqlite.openDefault` function](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Sqlite.html) to obtain [a `SqliteConnection` object](https://spinframework.github.io/spin-js-sdk/v2.3/interfaces/Sqlite.SqliteConnection.html). `SqliteConnection` provides the `execute` method as described above. For example: ```javascript import { ResponseBuilder, Sqlite } from "@fermyon/spin-sdk"; diff --git a/content/spin/v2/variables.md b/content/spin/v2/variables.md index 7495bd066..c7e28a8c9 100644 --- a/content/spin/v2/variables.md +++ b/content/spin/v2/variables.md @@ -133,7 +133,7 @@ async fn handle_api_call_with_token(_req: Request) -> anyhow::Result [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Variables.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/v2.3/modules/Variables.html) ```ts import { ResponseBuilder, Variables } from "@fermyon/spin-sdk"; diff --git a/content/spin/v3/http-trigger.md b/content/spin/v3/http-trigger.md index 9b62ebaf6..12bbc32cf 100644 --- a/content/spin/v3/http-trigger.md +++ b/content/spin/v3/http-trigger.md @@ -256,19 +256,25 @@ For a full Rust SDK reference, see the [Rust Spin SDK documentation](https://doc {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/) -The user must a define a function named `handler` which the SDK attaches to the [`FetchEvent` listener](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent). Note that the incoming HTTP event is translated to a `FetchEvent`. +Building a Spin HTTP component with the JavaScript/TypeScript SDK now involves adding an event listener for the `fetch` event. This event listener handles incoming HTTP requests and allows you to construct and return HTTP responses. -The handler function takes in two arguments a [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and a [ResponseBuilder](https://spinframework.github.io/spin-js-sdk/classes/ResponseBuilder.html) +Below is a complete implementation for such a component in TypeScript: ```ts -import { ResponseBuilder } from "@fermyon/spin-sdk"; +import { AutoRouter } from 'itty-router'; -export async function handler(req: Request, res: ResponseBuilder) { - console.log(req); - res.send("hello universe"); -} +let router = AutoRouter(); + +router + .get("/", () => new Response("hello universe")) + .get('/hello/:name', ({ name }) => `Hello, ${name}!`) + +//@ts-ignore +addEventListener('fetch', async (event: FetchEvent) => { + event.respondWith(router.fetch(event.request)); +}); ``` {{ blockEnd }} diff --git a/content/spin/v3/javascript-components.md b/content/spin/v3/javascript-components.md index 14e65cb3c..b04c355f2 100644 --- a/content/spin/v3/javascript-components.md +++ b/content/spin/v3/javascript-components.md @@ -30,7 +30,7 @@ With JavaScript being a very popular language, Spin provides an SDK to support b > All examples from this page can be found in [the JavaScript SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/main/examples). -[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/) ## Installing Templates diff --git a/content/spin/v3/kv-store-api-guide.md b/content/spin/v3/kv-store-api-guide.md index e2720cdbc..5edfe3822 100644 --- a/content/spin/v3/kv-store-api-guide.md +++ b/content/spin/v3/kv-store-api-guide.md @@ -83,9 +83,9 @@ fn handle_request(_req: Request) -> Result { {{ startTab "Typescript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/) -The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html). For example: +The key value functions can be accessed after opening a store using either [the `Kv.open` or the `Kv.openDefault` methods](https://spinframework.github.io/spin-js-sdk/stable/modules/Kv.html) which returns a [handle to the store](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html). For example: ```ts import { AutoRouter } from 'itty-router'; @@ -109,14 +109,14 @@ addEventListener('fetch', async (event: FetchEvent) => { **General Notes** - The 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-js-sdk/interfaces/Kv.Store.html#get) +[`get` **Operation**](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html#get) - The result is of the type `Uint8Array | null` - If the key does not exist, `get` returns `null` -[`set` **Operation**](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#set) +[`set` **Operation**](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html#set) - The value argument is of the type `Uint8Array | string | object`. -[`setJson`](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#setJson) and [`getJson` **Operation**](https://spinframework.github.io/spin-js-sdk/interfaces/Kv.Store.html#getJson) +[`setJson`](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html#setJson) and [`getJson` **Operation**](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Kv.Store.html#getJson) - Applications can store JavaScript objects using `setJson`; these are serialized within the store as JSON. These serialized objects can be retrieved and deserialized using `getJson`. If you call `getJson` on a key that doesn't exist then it returns an empty object. {{ blockEnd }} diff --git a/content/spin/v3/language-support-overview.md b/content/spin/v3/language-support-overview.md index 02bd10ea5..fddfefb6c 100644 --- a/content/spin/v3/language-support-overview.md +++ b/content/spin/v3/language-support-overview.md @@ -37,7 +37,7 @@ This page contains information about language support for Spin features: {{ startTab "TypeScript"}} -**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.** +**[📄 Visit the JS/TS Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/stable/) to see specific modules, functions, variables and syntax relating to the following TS/JS features.** | Feature | SDK Supported? | |-----|-----| diff --git a/content/spin/v3/mqtt-outbound.md b/content/spin/v3/mqtt-outbound.md index 0d4910350..af2c9bf04 100644 --- a/content/spin/v3/mqtt-outbound.md +++ b/content/spin/v3/mqtt-outbound.md @@ -57,7 +57,7 @@ You can find a complete Rust code example for using outbound MQTT from an HTTP c {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Mqtt.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/modules/Mqtt.html) To access an MQTT server, use the `Mqtt.open` function. @@ -72,7 +72,7 @@ let catPicture = new Uint8Array(await req.arraybuffer()); connection.publish("pets", catPicture, QoS.AtleastOnce); ``` -For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/modules/Mqtt.html) +For full details of the MQTT API, see the [Spin SDK reference documentation](https://spinframework.github.io/spin-js-sdk/stable/modules/Mqtt.html) You can find a complete Rust code example for using outbound MQTT from an HTTP component in the [Spin Rust SDK repository on GitHub](https://github.com/spinframework/spin-js-sdk/tree/main/examples/spin-host-apis/spin-mqtt). diff --git a/content/spin/v3/rdbms-storage.md b/content/spin/v3/rdbms-storage.md index fea1110e7..1de43b0e7 100644 --- a/content/spin/v3/rdbms-storage.md +++ b/content/spin/v3/rdbms-storage.md @@ -73,7 +73,7 @@ For full information about the MySQL and PostgreSQL APIs, see [the Spin SDK refe {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/) The code below is an [Outbound MySQL example](https://github.com/spinframework/spin-js-sdk/tree/main/examples/spin-host-apis/spin-mysql). There is also an outbound [PostgreSQL example](https://github.com/spinframework/spin-js-sdk/tree/main/examples/spin-host-apis/spin-postgres) available. diff --git a/content/spin/v3/redis-outbound.md b/content/spin/v3/redis-outbound.md index 4d1a5e53f..89756e538 100644 --- a/content/spin/v3/redis-outbound.md +++ b/content/spin/v3/redis-outbound.md @@ -89,9 +89,9 @@ You can find a complete Rust code example for using outbound Redis from an HTTP {{ startTab "TypeScript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/) -Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/modules/Redis.html). The function names match the operations above. For example: +Redis functions are available on [the `Redis` module](https://spinframework.github.io/spin-js-sdk/stable/modules/Redis.html). The function names match the operations above. For example: ```javascript import { Redis } from "@fermyon/spin-sdk" diff --git a/content/spin/v3/serverless-ai-api-guide.md b/content/spin/v3/serverless-ai-api-guide.md index 3f2ab3402..af3b3bba0 100644 --- a/content/spin/v3/serverless-ai-api-guide.md +++ b/content/spin/v3/serverless-ai-api-guide.md @@ -116,9 +116,9 @@ The `infer_with_options` examples, operation: {{ startTab "Typescript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Llm.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/modules/Llm.html) -To use Serverless AI functions, [the `Llm` module](https://spinframework.github.io/spin-js-sdk/modules/Llm.html) from the Spin SDK provides two methods: `infer` and `generateEmbeddings`. For example: +To use Serverless AI functions, [the `Llm` module](https://spinframework.github.io/spin-js-sdk/stable/modules/Llm.html) from the Spin SDK provides two methods: `infer` and `generateEmbeddings`. For example: ```javascript import { AutoRouter } from 'itty-router'; @@ -146,15 +146,15 @@ addEventListener('fetch', async (event: FetchEvent) => { `infer` operation: - It takes in the following arguments - model name, prompt and a optional third parameter for inferencing options. -- The model name is a string. There are enums for the inbuilt models (llama2-chat and codellama) in [`InferencingModels`](https://spinframework.github.io/spin-js-sdk/enums/Llm.InferencingModels.html). -- The optional third parameter which is an [InferencingOptions](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.InferencingOptions.html) interface allows you to specify parameters such as `maxTokens`, `repeatPenalty`, `repeatPenaltyLastNTokenCount`, `temperature`, `topK`, `topP`. -- The return value is an [`InferenceResult`](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.EmbeddingResult.html). +- The model name is a string. There are enums for the inbuilt models (llama2-chat and codellama) in [`InferencingModels`](https://spinframework.github.io/spin-js-sdk/stable/enums/Llm.InferencingModels.html). +- The optional third parameter which is an [InferencingOptions](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Llm.InferencingOptions.html) interface allows you to specify parameters such as `maxTokens`, `repeatPenalty`, `repeatPenaltyLastNTokenCount`, `temperature`, `topK`, `topP`. +- The return value is an [`InferenceResult`](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Llm.EmbeddingResult.html). `generateEmbeddings` operation: - It takes two arguments - model name and list of strings to generate the embeddings for. -- The model name is a string. There are enums for the inbuilt models (AllMiniLmL6V2) in [`EmbeddingModels`](https://spinframework.github.io/spin-js-sdk/enums/Llm.EmbeddingModels.html). -- The return value is an [`EmbeddingResult`](https://spinframework.github.io/spin-js-sdk/interfaces/Llm.EmbeddingResult.html) +- The model name is a string. There are enums for the inbuilt models (AllMiniLmL6V2) in [`EmbeddingModels`](https://spinframework.github.io/spin-js-sdk/stable/enums/Llm.EmbeddingModels.html). +- The return value is an [`EmbeddingResult`](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Llm.EmbeddingResult.html) {{ blockEnd }} diff --git a/content/spin/v3/sqlite-api-guide.md b/content/spin/v3/sqlite-api-guide.md index fdc223019..c2135ef11 100644 --- a/content/spin/v3/sqlite-api-guide.md +++ b/content/spin/v3/sqlite-api-guide.md @@ -120,9 +120,9 @@ struct ToDo { {{ startTab "Typescript"}} -> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Sqlite.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/modules/Sqlite.html) -To use SQLite functions, use [the `Sqlite.open` or `Sqlite.openDefault` function](https://spinframework.github.io/spin-js-sdk/modules/Sqlite.html) to obtain [a `SqliteConnection` object](https://spinframework.github.io/spin-js-sdk/interfaces/Sqlite.SqliteConnection.html). `SqliteConnection` provides the `execute` method as described above. For example: +To use SQLite functions, use [the `Sqlite.open` or `Sqlite.openDefault` function](https://spinframework.github.io/spin-js-sdk/stable/modules/Sqlite.html) to obtain [a `SqliteConnection` object](https://spinframework.github.io/spin-js-sdk/stable/interfaces/Sqlite.SqliteConnection.html). `SqliteConnection` provides the `execute` method as described above. For example: ```javascript import { AutoRouter } from 'itty-router'; diff --git a/content/spin/v3/variables.md b/content/spin/v3/variables.md index 2df3a22ea..8e2b33a40 100644 --- a/content/spin/v3/variables.md +++ b/content/spin/v3/variables.md @@ -134,7 +134,7 @@ async fn handle_api_call_with_token(_req: Request) -> anyhow::Result [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/modules/Variables.html) +> [**Want to go straight to the reference documentation?** Find it here.](https://spinframework.github.io/spin-js-sdk/stable/modules/Variables.html) ```ts import { AutoRouter } from 'itty-router';