Skip to main content

Overview

Function calling allows Jamba models to intelligently decide when and how to call external functions or tools based on the conversation context. Instead of trying to answer everything directly, the model can request specific function calls with appropriate parameters, enabling integration with APIs, databases, calculators, and other external systems.
Function calling is available for all Jamba models via the Chat Completions API.

How It Works

  1. Define your functions - Provide JSON schemas describing available tools
  2. Jamba decides - The model determines if and when to call functions
  3. Execute functions - Your code runs the requested functions
  4. Get response - Jamba uses the results to generate its final answer

Function Calling Example

1

Define Your Function

First, define the function you want to make available to the model:
2

Make the Chat Request

Create a chat request with your tools and user message:
3

Execute Function Calls

Check if the model wants to call a function and execute it:
4

Get Final Response

Send the function results back to the model for the final response:

Complete Examples

For reference, here are the complete working examples that put all the steps together: