Skip to content

Commit

Permalink
docs(sdk-node): Add context arg to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjcsmith committed Nov 13, 2024
1 parent 03954df commit 7f7de1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center">
<dp align="center">
<img src="https://a.inferable.ai/logo-hex.png" width="200" style="border-radius: 10px" />
</p>

Expand Down Expand Up @@ -65,7 +65,7 @@ For language-specific quick start guides, please refer to the README in each SDK
| Call [Timeouts](https://docs.inferable.ai/pages/functions#config-timeoutseconds) ||||
| Call [Retries](https://docs.inferable.ai/pages/functions#config-retrycountonstall) ||||
| Call [Approval](https://docs.inferable.ai/pages/functions#config-requiresapproval) (Human in the loop) ||||
| Auth Context ||||
| [Auth / Run Context](https://docs.inferable.ai/pages/runs#context) ||||

## Documentation

Expand Down
4 changes: 3 additions & 1 deletion sdk-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Register a "sayHello" [function](https://docs.inferable.ai/pages/functions). Thi
// Register a simple function (using the 'default' service)
const sayHello = client.default.register({
name: "sayHello",
func: async ({ to }: { to: string }) => {
func: async (input: { to: string }, _context) => {
return `Hello, ${to}!`;
},
schema: {
Expand Down Expand Up @@ -97,6 +97,8 @@ const run = await client.run({
}),
// Optional: Subscribe an Inferable function to receive notifications when the run status changes
//onStatusChange: { function: { function: "handler", service: "default" } },
// Optional: Pass additioanl context (passed to each function call)
//context: { foo: "bar" },
});

console.log("Run Started", {
Expand Down

0 comments on commit 7f7de1b

Please sign in to comment.