Help creating an API request through OPENAI or other LLM
Sacharbonne π€π¦₯
28 days ago
Nov 13, 2024, 10:59 AM
Hello, i'm starting building with Toddle, and to present a case, i'm building quick App to get CatFacts API + CatImagesApi. But all the facts are in english and i want to make an OpenAi call to translate the fact in French. But i struggle to construct the formula to handle the JSON body sending like in the screen. I only need chat completion for the moment : https://platform.openai.com/docs/api-reference/chat/create When i will understand how to build the API it will be fine for other endpoints. If anyone can help me ?
Armand
28 days ago
Nov 13, 2024, 11:06 AM
From what I see in your image you are trying to put an array into one object's value. I'm guessing you just need to create an object like this:
Armand
28 days ago
Nov 13, 2024, 11:07 AM
I'm guessing that the model and role values will be static (and not the same values as I put in) and that the content value is the dynamic string of text of whichever text you need translated by the API
Max
28 days ago
Nov 13, 2024, 11:16 AM
@Sacharbonne π€π¦₯ you should noz make the call to OpenAI from toddle. This will expose your api keys. You need to make that call in the backend