You'd probably be better off passing in a key/ID which correlates to Secrets Manager (or a database
You'd probably be better off passing in a key/ID which correlates to Secrets Manager (or a database row) which contains the creds
finally in JS for try/catch).run function in try/catch and that would effectively act as a "on failure" handler? As it'd catch any step failure after retries based on what you saidI guess for now... could you literally wrap the entire run function in try/catch and that would effectively act as a "on failure" handler?yhep, that would work
get requests are ok for the most part, the requests that are failing are post. finallyrungetpost const generatedContent = await step.do("Write content", async () => {
const ai = new OpenAI({
apiKey: this.env.CLOUDFLARE_AI_TOKEN,
baseURL: `https://api.cloudflare.com/client/v4/accounts/{my account id}/ai/v1`,
});
const result = await ai.chat.completions.create({
model: "@cf/meta/llama-3.1-8b-instruct",
messages: [...example]
})
return result.choices[0].message.content;
})