|
5 | 5 | Reasoning models return an additional `reasoning_content` field in their output, which contains the reasoning steps that led to the final conclusion. |
6 | 6 |
|
7 | 7 | ## Supported Models |
8 | | -| Model Name | Parser Name | Eable_thinking by Default | |
9 | | -|----------------|----------------|---------------------------| |
10 | | -| baidu/ERNIE-4.5-VL-424B-A47B-Paddle | ernie-45-vl | ✓ | |
11 | | -| baidu/ERNIE-4.5-VL-28B-A3B-Paddle | ernie-45-vl | ✓ | |
| 8 | +| Model Name | Parser Name | Eable_thinking by Default | Tool Calling | |
| 9 | +|---------------|-------------|---------|---------| |
| 10 | +| baidu/ERNIE-4.5-VL-424B-A47B-Paddle | ernie-45-vl | ✅ | ❌ | |
| 11 | +| baidu/ERNIE-4.5-VL-28B-A3B-Paddle | ernie-45-vl | ✅ | ❌ | |
| 12 | +| baidu/ERNIE-4.5-21B-A3B-Thinking | ernie-x1 | ✅ no off supported | ✅| |
12 | 13 |
|
13 | 14 | The reasoning model requires a specified parser to extract reasoning content. The reasoning mode can be disabled by setting the `"enable_thinking": false` parameter. |
14 | 15 |
|
@@ -81,3 +82,78 @@ for chunk in chat_response: |
81 | 82 | print(chunk.choices[0].delta, end='') |
82 | 83 | print("\n") |
83 | 84 | ``` |
| 85 | +## Tool Calling |
| 86 | +The reasoning content is also available when both tool calling and the reasoning parser are enabled. Additionally, tool calling only parses functions from the `content` field, not from the `reasoning_content`. |
| 87 | + |
| 88 | +Model request example: |
| 89 | +```bash |
| 90 | +curl -X POST "http://0.0.0.0:8390/v1/chat/completions" \ |
| 91 | +-H "Content-Type: application/json" \ |
| 92 | +-d '{ |
| 93 | + "messages": [ |
| 94 | + { |
| 95 | + "role": "user", |
| 96 | + "content": "Get the current weather in BeiJing" |
| 97 | + } |
| 98 | + ], |
| 99 | + "tools": [ |
| 100 | + { |
| 101 | + "type": "function", |
| 102 | + "function": { |
| 103 | + "name": "get_weather", |
| 104 | + "description": "Determine weather in my location", |
| 105 | + "parameters": { |
| 106 | + "type": "object", |
| 107 | + "properties": { |
| 108 | + "location": { |
| 109 | + "type": "string", |
| 110 | + "description": "The city and state e.g. San Francisco, CA" |
| 111 | + }, |
| 112 | + "unit": { |
| 113 | + "type": "string", |
| 114 | + "enum": [ |
| 115 | + "c", |
| 116 | + "f" |
| 117 | + ] |
| 118 | + } |
| 119 | + }, |
| 120 | + "additionalProperties": false, |
| 121 | + "required": [ |
| 122 | + "location", |
| 123 | + "unit" |
| 124 | + ] |
| 125 | + }, |
| 126 | + "strict": true |
| 127 | + } |
| 128 | + }], |
| 129 | + "stream": false |
| 130 | +}' |
| 131 | +``` |
| 132 | +Model output example |
| 133 | + |
| 134 | +```json |
| 135 | +{ |
| 136 | + "choices": [ |
| 137 | + { |
| 138 | + "index": 0, |
| 139 | + "message": { |
| 140 | + "role": "assistant", |
| 141 | + "content": "", |
| 142 | + "reasoning_content": "The user asks about ...", |
| 143 | + "tool_calls": [ |
| 144 | + { |
| 145 | + "id": "chatcmpl-tool-311b9bda34274722afc654c55c8ce6a0", |
| 146 | + "type": "function", |
| 147 | + "function": { |
| 148 | + "name": "get_weather", |
| 149 | + "arguments": "{\"location\": \"BeiJing\", \"unit\": \"c\"}" |
| 150 | + } |
| 151 | + } |
| 152 | + ] |
| 153 | + }, |
| 154 | + "finish_reason": "tool_calls" |
| 155 | + } |
| 156 | + ] |
| 157 | +} |
| 158 | +``` |
| 159 | +More reference documentation related to tool calling usage: [Tool Calling](./tool_calling.md) |
0 commit comments