Nodered-contrib-anthropic example

Hello, does anyone here use nodered-contrib-anthropic? I just need a simple example of how to use it. This node would be useful to me, but I can't use it and there is no documentation. I don't want to try it by trial and error.

I tried to contact the author, but without success.

Thank you

Hi!

I’ve tried the nodered-contrib-anthropic node and it works well for sending prompts to Claude AI and receiving responses.

You just need to enter your API key and choose the model (via msg.topic). To send a prompt, you can use an Inject of Function node with text in msg.payload. The response will be returned in msg.payload.content, which you can display using a Debug node.

The node also supports msg.history if you want to keep conversation context - you can store it using flow or global context. This works fine in most cases, but for long conversations it’s a good idea to limit history to the last few messages (e.g. with .slice(-10)) to avoid unnecessary memory usage in Node-RED.

I also tried to find more information, but unfortunately the documentation is empty. I had to look through the code to figure out what’s possible.

I hope this will be helpful :smiley:

Thanks a lot. It helps.

P.