From e69eb2ff1bccb682c49dc65c4c75ce4759a79384 Mon Sep 17 00:00:00 2001 From: Thibault Genaitay Date: Thu, 14 Nov 2024 11:28:14 +0100 Subject: [PATCH 1/4] fix(genapi): added warning regarding system prompt --- ai-data/generative-apis/how-to/use-function-calling.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ai-data/generative-apis/how-to/use-function-calling.mdx b/ai-data/generative-apis/how-to/use-function-calling.mdx index eac3a5de15..bf1b89be1b 100644 --- a/ai-data/generative-apis/how-to/use-function-calling.mdx +++ b/ai-data/generative-apis/how-to/use-function-calling.mdx @@ -146,6 +146,10 @@ response = client.chat.completions.create( The model automatically decides which functions to call. However, you can specify a particular function by using the `tool_choice` parameter. In the example above, you can replace `tool_choice=auto` with `tool_choice={"type": "function", "function": {"name": "get_flight_schedule"}}` to explicitly call the desired function. + + Some models specifically need to be told they can use external functions in system prompt. If you don't provide a system prompt when using tools, Scaleway will automatically add one that works best for that specific model. + + ### Multi-turn conversation handling For more complex interactions, you will need to handle multiple turns of conversation: From 10ffa5efd49f3bc43af69e1237c72581d232c9f4 Mon Sep 17 00:00:00 2001 From: Thibault Genaitay Date: Thu, 14 Nov 2024 11:29:48 +0100 Subject: [PATCH 2/4] fix(genapi): added warning regarding system prompt 2 --- ai-data/generative-apis/how-to/use-function-calling.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai-data/generative-apis/how-to/use-function-calling.mdx b/ai-data/generative-apis/how-to/use-function-calling.mdx index bf1b89be1b..7650ce25e8 100644 --- a/ai-data/generative-apis/how-to/use-function-calling.mdx +++ b/ai-data/generative-apis/how-to/use-function-calling.mdx @@ -147,7 +147,7 @@ response = client.chat.completions.create( - Some models specifically need to be told they can use external functions in system prompt. If you don't provide a system prompt when using tools, Scaleway will automatically add one that works best for that specific model. + Some models shall be told they can use external functions in system prompt. If you don't provide a system prompt when using tools, Scaleway will automatically add one that works best for that specific model. ### Multi-turn conversation handling From 7cb9f008c33f0f3dfc31cd0a13473145d1bd8422 Mon Sep 17 00:00:00 2001 From: Benedikt Rollik Date: Thu, 14 Nov 2024 11:42:04 +0100 Subject: [PATCH 3/4] Apply suggestions from code review --- ai-data/generative-apis/how-to/use-function-calling.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai-data/generative-apis/how-to/use-function-calling.mdx b/ai-data/generative-apis/how-to/use-function-calling.mdx index 7650ce25e8..b4d5293407 100644 --- a/ai-data/generative-apis/how-to/use-function-calling.mdx +++ b/ai-data/generative-apis/how-to/use-function-calling.mdx @@ -147,7 +147,7 @@ response = client.chat.completions.create( - Some models shall be told they can use external functions in system prompt. If you don't provide a system prompt when using tools, Scaleway will automatically add one that works best for that specific model. + Some models shall be told they can use external functions in the system prompt. If you do not provide a system prompt when using tools, Scaleway will automatically add one that works best for that specific model. ### Multi-turn conversation handling From 6c335334b6dddb0a9b252afa84766d0e3b0cc397 Mon Sep 17 00:00:00 2001 From: nerda-codes <87707325+nerda-codes@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:51:59 +0100 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: SamyOubouaziz --- ai-data/generative-apis/how-to/use-function-calling.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai-data/generative-apis/how-to/use-function-calling.mdx b/ai-data/generative-apis/how-to/use-function-calling.mdx index b4d5293407..4f58e4ac66 100644 --- a/ai-data/generative-apis/how-to/use-function-calling.mdx +++ b/ai-data/generative-apis/how-to/use-function-calling.mdx @@ -147,7 +147,7 @@ response = client.chat.completions.create( - Some models shall be told they can use external functions in the system prompt. If you do not provide a system prompt when using tools, Scaleway will automatically add one that works best for that specific model. + Some models must be told they can use external functions in the system prompt. If you do not provide a system prompt when using tools, Scaleway will automatically add one that works best for that specific model. ### Multi-turn conversation handling