From b4a40e3fedb438570770a224b890ea24f6e660a9 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 18 May 2024 19:06:21 +0800 Subject: feat: support function calling (#514) * feat: support function calling * fix on Windows OS * implement multi-steps function calling * fix on Windows OS * add error for client not support function calling * refactor message data structure and make claude client supporting function calling * support reuse previous call results * improve error handling for function calling * use prefix `may_` as indicator for `execute` type fucntions --- models.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'models.yaml') diff --git a/models.yaml b/models.yaml index 903e285..3c78470 100644 --- a/models.yaml +++ b/models.yaml @@ -15,33 +15,39 @@ max_output_tokens: 4096 input_price: 0.5 output_price: 1.5 + supports_function_calling: true - name: gpt-3.5-turbo-1106 max_input_tokens: 16385 max_output_tokens: 4096 input_price: 1 output_price: 2 + supports_function_calling: true - name: gpt-4o max_input_tokens: 128000 max_output_tokens: 4096 input_price: 5 output_price: 15 supports_vision: true + supports_function_calling: true - name: gpt-4-turbo max_input_tokens: 128000 max_output_tokens: 4096 input_price: 10 output_price: 30 supports_vision: true + supports_function_calling: true - name: gpt-4-turbo-preview max_input_tokens: 128000 max_output_tokens: 4096 input_price: 10 output_price: 30 + supports_function_calling: true - name: gpt-4-1106-preview max_input_tokens: 128000 max_output_tokens: 4096 input_price: 10 output_price: 30 + supports_function_calling: true - name: gpt-4-vision-preview max_input_tokens: 128000 max_output_tokens: 4096 @@ -73,6 +79,7 @@ max_output_tokens: 2048 input_price: 0.5 output_price: 1.5 + supports_function_calling: true - name: gemini-1.0-pro-vision-latest max_input_tokens: 12288 max_output_tokens: 4096 @@ -85,12 +92,14 @@ input_price: 0.35 output_price: 0.53 supports_vision: true + supports_function_calling: true - name: gemini-1.5-pro-latest max_input_tokens: 1048576 max_output_tokens: 8192 input_price: 3.5 output_price: 10.5 supports_vision: true + supports_function_calling: true - platform: claude # docs: @@ -106,6 +115,7 @@ input_price: 15 output_price: 75 supports_vision: true + supports_function_calling: true - name: claude-3-sonnet-20240229 max_input_tokens: 200000 max_output_tokens: 4096 @@ -113,6 +123,7 @@ input_price: 3 output_price: 15 supports_vision: true + supports_function_calling: true - name: claude-3-haiku-20240307 max_input_tokens: 200000 max_output_tokens: 4096 @@ -120,6 +131,7 @@ input_price: 0.25 output_price: 1.25 supports_vision: true + supports_function_calling: true - platform: mistral # docs: @@ -149,6 +161,7 @@ max_input_tokens: 32000 input_price: 8 output_price: 24 + supports_function_calling: true - platform: cohere # docs: @@ -163,11 +176,13 @@ max_output_tokens: 4000 input_price: 0.5 output_price: 1.5 + supports_function_calling: true - name: command-r-plus max_input_tokens: 128000 max_output_tokens: 4000 input_price: 3 output_price: 15 + supports_function_calling: true - platform: perplexity # docs: @@ -242,12 +257,13 @@ # notes: # - get max_output_tokens info from models doc models: - - name: gemini-1.0-pro + - name: gemini-1.0-pro-002 max_input_tokens: 24568 max_output_tokens: 8192 input_price: 0.125 output_price: 0.375 - - name: gemini-1.0-pro-vision + supports_function_calling: true + - name: gemini-1.0-pro-vision-001 max_input_tokens: 14336 max_output_tokens: 2048 input_price: 0.125 @@ -387,6 +403,7 @@ # docs: # - https://replicate.com/docs # - https://replicate.com/pricing + # - https://replicate.com/docs/reference/http # notes: # - max_output_tokens is required but unknown models: @@ -695,20 +712,24 @@ max_input_tokens: 16385 input_price: 0.5 output_price: 1.5 + supports_function_calling: true - name: openai/gpt-4o max_input_tokens: 128000 input_price: 5 output_price: 15 supports_vision: true + supports_function_calling: true - name: openai/gpt-4-turbo max_input_tokens: 128000 input_price: 10 output_price: 30 supports_vision: true + supports_function_calling: true - name: openai/gpt-4-turbo-preview max_input_tokens: 128000 input_price: 10 output_price: 30 + supports_function_calling: true - name: openai/gpt-4-vision-preview max_input_tokens: 128000 max_output_tokens: 4096 -- cgit v1.2.3