Skip to content

Commit 9c57741

Browse files
tomek-labukfabianrbz
authored andcommitted
Add function calling to ai-proxy (#3727)
1 parent b060b97 commit 9c57741

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

app/_data/plugins/ai-proxy.yaml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ providers:
2323
route_type: 'llm/v1/embeddings'
2424
model_example: '<a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html">Use the model name for the specific LLM provider</a>'
2525
min_version: '3.11'
26+
function_calling:
27+
supported: true
28+
streaming: false
29+
upstream_path: 'Uses the <code>Converse</code> API with tool configuration'
30+
route_type: 'llm/v1/chat'
31+
model_example: 'Model-dependent. Supported for Claude, Command, and select models'
32+
min_version: '3.8'
2633
batches: # Native format from SDK only
2734
supported: 'n/a'
2835
streaming: false
@@ -82,6 +89,13 @@ providers:
8289
route_type: 'llm/v1/completions'
8390
model_example: 'claude-2.1'
8491
min_version: '3.6'
92+
function_calling:
93+
supported: true
94+
streaming: false
95+
upstream_path: '/v1/messages'
96+
route_type: 'llm/v1/chat'
97+
model_example: 'claude-3-opus-20240229'
98+
min_version: '3.6'
8599
batches: # Native format from SDK only
86100
supported: 'n/a'
87101
streaming: true
@@ -116,6 +130,13 @@ providers:
116130
route_type: 'llm/v1/embeddings'
117131
model_example: 'text-embedding-ada-002<sup>1</sup>'
118132
min_version: '3.11'
133+
function_calling:
134+
supported: true
135+
streaming: false
136+
upstream_path: '/openai/deployments/{deployment_name}/chat/completions'
137+
route_type: 'llm/v1/chat'
138+
model_example: 'gpt-4'
139+
min_version: '3.6'
119140
files:
120141
supported: true
121142
streaming: false
@@ -232,6 +253,13 @@ providers:
232253
route_type: 'llm/v1/embeddings'
233254
model_example: 'embed-english-v3.0'
234255
min_version: '3.11'
256+
function_calling:
257+
supported: true
258+
streaming: false
259+
upstream_path: '/v1/chat'
260+
route_type: 'llm/v1/chat'
261+
model_example: 'command-r-plus'
262+
min_version: '3.6'
235263

236264
- name: 'Dashscope'
237265
url_pattern: 'https://dashscope.aliyuncs.com or https://dashscope-intl.aliyuncs.com'
@@ -283,6 +311,13 @@ providers:
283311
route_type: 'llm/v1/embeddings'
284312
model_example: 'text-embedding-004'
285313
min_version: '3.11'
314+
function_calling:
315+
supported: true
316+
streaming: false
317+
upstream_path: 'Uses <code>generateContent</code> API with function declarations'
318+
route_type: 'llm/v1/chat'
319+
model_example: 'gemini-2.0-flash'
320+
min_version: '3.8'
286321
files: # Native format from SDK only
287322
supported: 'n/a'
288323
streaming: false
@@ -358,6 +393,13 @@ providers:
358393
route_type: 'llm/v1/embeddings'
359394
model_example: 'text-embedding-004'
360395
min_version: '3.11'
396+
function_calling:
397+
supported: true
398+
streaming: false
399+
upstream_path: 'Uses <code>generateContent</code> API with function declarations'
400+
route_type: 'llm/v1/chat'
401+
model_example: 'gemini-2.0-flash'
402+
min_version: '3.8'
361403
files:
362404
supported: 'n/a'
363405
streaming: false
@@ -468,6 +510,13 @@ providers:
468510
route_type: 'llm/v1/embeddings'
469511
model_example: 'mistral-embed'
470512
min_version: '3.11'
513+
function_calling:
514+
supported: true
515+
streaming: false
516+
upstream_path: '/v1/chat/completions or user-defined'
517+
route_type: 'llm/v1/chat'
518+
model_example: 'mistral-large-latest'
519+
min_version: '3.6'
471520

472521
- name: 'OpenAI'
473522
formats: 'GPT-3.5, GPT-4, GPT-4o, and Multi-Modal'
@@ -494,6 +543,13 @@ providers:
494543
route_type: 'llm/v1/embeddings'
495544
model_example: 'text-embedding-ada-002<sup>1</sup>'
496545
min_version: '3.11'
546+
function_calling:
547+
supported: true
548+
streaming: false
549+
upstream_path: '/v1/chat/completions'
550+
route_type: 'llm/v1/chat'
551+
model_example: 'gpt-4'
552+
min_version: '3.6'
497553
files:
498554
supported: true
499555
streaming: false
@@ -591,6 +647,13 @@ providers:
591647
embeddings:
592648
supported: false
593649
streaming: false
650+
function_calling:
651+
supported: true
652+
streaming: false
653+
upstream_path: '/v1/chat/completions'
654+
route_type: 'llm/v1/chat'
655+
model_example: 'grok-2-latest'
656+
min_version: '3.13'
594657
files:
595658
supported: false
596659
streaming: false
@@ -637,4 +700,4 @@ parameters:
637700
route_type: 'config.targets.route_type'
638701
options: 'config.targets[].model.options'
639702
upstream_url: 'config.targets[].model.options.upstream_url'
640-
model_name: 'config.targets[].model.name'
703+
model_name: 'config.targets[].model.name'

app/_includes/plugins/ai-proxy/overview.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,13 @@ Support for chat, completions, and embeddings:
205205
206206
### Advanced text generation {% new_in 3.11 %}
207207

208-
Support for function calling, tool use, and batch processing:
208+
Support for files and batch processing and function calling (tool use):
209209

210210
{% include plugins/ai-proxy/tables/supported-providers-processing.html providers=providers %}
211211

212+
{:.info}
213+
> Function calling uses the llm/v1/chat route type.
214+
212215
### Audio features {% new_in 3.11 %}
213216

214217
Support for text-to-speech, transcription, and translation:

app/_includes/plugins/ai-proxy/tables/supported-providers-processing.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% assign note_counter = 0 %}
22
{% assign notes = "" | split: "" %}
3-
{% assign features = "files,batches,assistants,responses" | split: "," %}
3+
{% assign features = "files,batches,assistants,responses,function_calling" | split: "," %}
44

55
{% comment %}First pass: collect all notes{% endcomment %}
66
{% for provider in include.providers %}
@@ -24,6 +24,7 @@
2424
<th>Batches</th>
2525
<th>Assistants</th>
2626
<th>Responses</th>
27+
<th>Function Calling</th>
2728
</tr>
2829
</thead>
2930
<tbody>

0 commit comments

Comments
 (0)