Tool call
Call a tool in your local codebase
Tool Calling
You can call tools in your local codebase using Laminar. The only requirement on the node is that the name of the node must match the tool (function) name in your codebase.
The tool format must match OpenAI’s tool calling format (See the response example on the right-hand side of the page).
We are currently adding support for converting other providers’ tool calling format to OpenAI format, please contact us if you’d like us to prioritize any provider.
There are 2 ways to use tool call nodes. Using Laminar’s remote debugger, or calling the endpoint through our SDK.
Laminar remote debugger.
If you want to test a flow that includes a tool call, you can use Laminar remote debugger in NodeJS or in Python.
The overall flow must be the following:
- Create a pipeline that includes tool call nodes.
- Don’t forget to name tool call nodes after your local functions that you would like to call
- Run the LaminarRemoteDebugger in your NodeJS or Python code with references to your local functions.
This will return and print your unique session ID.
- Find specific instructions on how to do that in the SDK docs (README in each package)
- Copy the session ID and paste it as an environment variable
DEBUGGER_SESSION_ID
in lmnr.ai workshop in your browser. - Run the pipeline from your browser
Calling endpoints through SDK
SDK in NodeJS or in Python also supports
running Laminar endpoints. You can deploy your pipeline with a tool call node just like any other pipeline; however,
when calling the pipeline from your code, make sure to specify the optional parameter tools
, which is a list of local functions.
Example code snippets:
Python:
JS:
Read more on how to use our SDK in each package’s readme.