Function calling allows users to connect our latest models to external tools, streamlining agentic use cases, and allowing users to integrate our models much more deeply into their workflows. Some examples of tools that users could pass to our model are:
Currently, only Reka Flash supports function calling. We are working hard to quickly enable support for our other classes of models.

In this section, we will go through step by step how to use Reka’s function calling capabilities with a concrete example. For this example, we will define two functions: get_product_availability, and get_similar_products. Both take in a product id, and get_similar_products additionally takes in the maximum number of results to return, allowing customers to ask questions about various products.
First, we must create a specification for each function. We pass these specs to the model to connect them to the tools.
Now that we have defined the tools our model has access to, we can query the model by passing in these tools along with a user query:
The response will contain a tool call like:
The tool_choice parameter controls how the model uses the tools you pass. There are three available options:

Note that if tool_choice is set to auto, the model will decide whether or not to invoke a function. If the model chooses to invoke a function, the response message will contain tool_calls and content will be null/None. If the model refrains from making a function call, the converse will be true: tool_calls will be null/None and content will contain the model’s natural language response.
In the case the model decides to invoke a tool, the next step is to execute the function to obtain the output from the function invocation.
Finally, we can pass the result back to the model in order to receive a natural language response based on the result of the function execution. The message history must include the original user message, the assistant’s tool call, and the tool output:
This will return a response like: