From e5ca6c6848e9b5aa1fd6b6201141da0de0eb88ba Mon Sep 17 00:00:00 2001 From: LucBERTON <76648347+LucBERTON@users.noreply.github.com> Date: Fri, 29 Nov 2024 11:04:59 +0100 Subject: [PATCH] Update agents.md : variable typo fix + secret disclosure warning Corrected variable name from agentId to agent_id in typescript. Added a note stating that if sdk is used on the client side, It may be dangerous to store API_KEY in environment variables as suggested by the documentation. --- docs/capabilities/agents.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/capabilities/agents.md b/docs/capabilities/agents.md index fddab1d..20ddce2 100644 --- a/docs/capabilities/agents.md +++ b/docs/capabilities/agents.md @@ -112,7 +112,7 @@ const apiKey = process.env.MISTRAL_API_KEY; const client = new Mistral({apiKey: apiKey}); const chatResponse = await client.agents.complete({ - agent_id: "ag:3996db2b:20240805:french-agent:a8997aab", + agentId: "ag:3996db2b:20240805:french-agent:a8997aab", messages: [{role: 'user', content: 'What is the best French cheese?'}], }); @@ -136,6 +136,10 @@ curl --location "https://api.mistral.ai/v1/agents/completions" \ +:::note[ ] +- Typescript : Please note that storing secrets such as the API key on the client side (`process.env.MISTRAL_API_KEY`) is dangerous and may lead to secret disclosure +::: +