You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/public_cloud/ai_machine_learning/endpoints_tuto_14_function_calling_langchain4j/guide.fr-fr.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: AI Endpoints - Utiliser les appels de fonctions avec LangChain4J
3
3
excerpt: Apprenez à utiliser les appels de fonctions avec Java, LangChain4j et OVHcloud AI Endpoints
4
-
updated: 2025-06-24
4
+
updated: 2025-08-06
5
5
---
6
6
7
7
> [!primary]
@@ -11,23 +11,23 @@ updated: 2025-06-24
11
11
12
12
## Objective
13
13
14
-
Stable Diffusion is a powerful artificial intelligence model to generate images from text descriptions.
15
-
You can use it, thanks to AI Endpoints, simply by calling the endpoint with a prompt.
16
-
However, creating a good prompt for Stable Diffusion can be challenging.
14
+
Stable Diffusion is a powerful artificial intelligence model to generate images from text descriptions. You can use it, thanks to AI Endpoints by simply calling the endpoint with a prompt. However, creating a good prompt for Stable Diffusion can be challenging.
15
+
17
16
Function Calling enables the AI system to perform more complex and dynamic tasks, and to leverage external knowledge and services to generate more accurate and informative responses.
18
17
In the context of image generation, function calling can be used to enhance the quality of the prompts by optimizing them thanks to external tool based on a LLM.
19
-
In this tutorial, we will show you how to optimize your prompts using **Function Calling** and OVHcloud AI Endpoints.
20
18
21
-
To do this, we will use **[LangChain4j](https://github.com/langchain4j/langchain4j)**, Java-based framework inspired by [LangChain](https://github.com/langchain-ai/langchain), designed to simplify the integration of LLMs (Large Language Models) into applications. Note that LangChain4j is not officially maintained by the LangChain team, despite the similar name.
19
+
**In this tutorial, we will show you how to optimize your prompts using **Function Calling** and OVHcloud AI Endpoints.**
20
+
21
+
To do this, we will use **[LangChain4j](https://github.com/langchain4j/langchain4j)**, a Java-based framework inspired by [LangChain](https://github.com/langchain-ai/langchain), designed to simplify the integration of LLMs (Large Language Models) into applications. Note that **LangChain4j** is not officially maintained by the LangChain team, despite the similar name.
22
22
23
23
Combined with OVHcloud **[AI Endpoints](https://endpoints.ai.cloud.ovh.net/)** which offers both LLM and embedding models, it becomes easy to create advanced, production-ready assistants.
24
24
25
25
{.thumbnail}
26
26
27
27
## Definition
28
28
29
-
-**Function Calling**: Function calling refers to the ability of a language model or AI system to ask to invoke and execute pre-defined functions or tasks, such as data processing, calculations, or external API calls, in response to user input or prompts.
30
-
-**[LangChain4j](https://github.com/langchain4j/langchain4j)**: Java-based framework inspired by [LangChain](https://github.com/langchain-ai/langchain), designed to simplify the integration of LLMs (Large Language Models) into applications. Note that LangChain4j is not officially maintained by the LangChain team, despite the similar name.
29
+
-**Function Calling**: Function calling refers to the ability of a language model or AI system AI system to request, invoke, and execute predefined functions or tasks such as data processing, calculations, or external API calls in response to user input or prompts.
30
+
-**[LangChain4j](https://github.com/langchain4j/langchain4j)**: a Java-based framework inspired by [LangChain](https://github.com/langchain-ai/langchain), designed to simplify the integration of LLMs (Large Language Models) into applications. Note that LangChain4j is not officially maintained by the LangChain team, despite the similar name.
31
31
-**[AI Endpoints](https://endpoints.ai.cloud.ovh.net/)**: A serverless platform by OVHcloud providing easy access to a variety of world-renowned AI models including Mistral, LLaMA, and more. This platform is designed to be simple, secure, and intuitive, with data privacy as a top priority.
32
32
33
33
## Requirements
@@ -43,6 +43,7 @@ To create our application we will use LangChain4J to simplify the integration of
43
43
### Tool creation
44
44
45
45
To use the function calling mechanism, we need to define a tool.
46
+
46
47
In our example the goal of the tool is to call Stable Diffusion API to generate an image.
47
48
48
49
⚠️ This is not the model itself that calls the tool but the client that invokes the model. ⚠️
@@ -104,7 +105,7 @@ interface ChatBot {
104
105
105
106
It’s not mandatory to create a such detailed system message, but it helps the model to choose the tool when needed.
ℹ️ We use a loop to be able to ask the model to optimize the image generation parameters based on the previous response. ℹ️
148
+
ℹ️ We use a loop to be able to ask the model to optimize the image generation parameters based on the previous response. ℹ️ And that is it!
148
149
149
-
And that it!
150
150
It’s time to test our Stable Diffusion optimizer.
151
151
152
152
```sh
@@ -170,7 +170,7 @@ with a warm and inviting atmosphere. If you have any issues or need further assi
170
170
Enter your message: exit
171
171
```
172
172
173
-
ℹ️ As you see, the model translate the prompt 😊
173
+
ℹ️ As you can see, the model translated the prompt 😊
174
174
175
175
Here is the result of the prompt:
176
176
@@ -196,4 +196,4 @@ Please feel free to send us your questions, feedback, and suggestions regarding
196
196
197
197
- In the #ai-endpoints channel of the OVHcloud [Discord server](https://discord.gg/ovhcloud), where you can engage with the community and OVHcloud team members.
198
198
199
-
If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](/links/professional-services) to get a quote and ask our Professional Services experts for a custom analysis of your project.
199
+
If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](/links/professional-services) to get a quote and ask our Professional Services experts for a custom analysis of your project.
0 commit comments