Data Science Collective

Advice, insights, and ideas from the Medium data science community

Member-only story

Agentic AI

Integrating LlamaIndex and DeepSeek-R1 for reasoning_content and Function Call Features

Empowering AgentWorkflow with the strong boost from DeepSeek-R1

Peng Qian
11 min readMar 22, 2025

--

Integrating LlamaIndex and DeepSeek-R1 for reasoning_content and Function Call Features.
Integrating LlamaIndex and DeepSeek-R1 for reasoning_content and Function Call Features. Image by DALL-E-3

In today’s article, I’ll show you how to use LlamaIndex’s AgentWorkflow to read the reasoning process from DeepSeek-R1’s output and how to enable function call features for DeepSeek-R1 within AgentWorkflow.

All the source code discussed is available at the end of this article for you to read and modify freely.

Introduction

DeepSeek-R1 is incredibly useful. Most of my work is now done with its help, and major cloud providers support its deployment, making API access even easier.

Most open-source models support OpenAI-compatible API interfaces, and DeepSeek-R1 is no exception. However, unlike other generative models, DeepSeek-R1 includes a reasoning_content key in its output, which stores the Chain-of-Thought (CoT) reasoning process.

Additionally, DeepSeek-R1 doesn’t support function calls, which makes developing agents with it quite challenging. (The official documentation claims that DeepSeek-R1 doesn’t support structured output, but in my tests, it does. So, I won’t cover that here.)

--

--

Data Science Collective
Data Science Collective

Published in Data Science Collective

Advice, insights, and ideas from the Medium data science community

Peng Qian
Peng Qian

Written by Peng Qian

Formerly a senior data scientist at Alibaba, now the chief data architect at a major investment bank. Visit: https://www.dataleadsfuture.com/#/portal

Responses (2)